summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/common.cpp9
-rw-r--r--src/install.sh2
-rw-r--r--src/test/GNUmakefile4
-rw-r--r--src/test/w32dtst.cpp2
-rw-r--r--src/w32dlib/common.h5
5 files changed, 19 insertions, 3 deletions
diff --git a/src/common.cpp b/src/common.cpp
index 9f5296c..d0b94a6 100644
--- a/src/common.cpp
+++ b/src/common.cpp
@@ -27,6 +27,15 @@ namespace W32DLib
// ------------------------------------------------------------
//
+void Common::Initialise()
+{
+ InitCommonControls();
+ CoInitialize(NULL);
+}
+
+
+// ------------------------------------------------------------
+//
void Common::Message(HWND parent, const char *msg)
{
::MessageBox(parent,msg,"Message",MB_ICONINFORMATION|MB_OK);
diff --git a/src/install.sh b/src/install.sh
index 54afb53..732b4e6 100644
--- a/src/install.sh
+++ b/src/install.sh
@@ -31,7 +31,7 @@ if [ $mkinfo == "1" ] ; then
#!/bin/sh
if [ "\$1" == "--libs" ] ; then
- echo -L$libdir -mwindows -lw32dlib
+ echo -L$libdir -mwindows -lw32dlib -lcomctl32 -lcomdlg32 -lole32
elif [ "\$1" == "--cflags" ] ; then
echo -I$incbase
elif [ "\$1" == "--archive" ] ; then
diff --git a/src/test/GNUmakefile b/src/test/GNUmakefile
index fe28cb0..db4a121 100644
--- a/src/test/GNUmakefile
+++ b/src/test/GNUmakefile
@@ -18,7 +18,7 @@
#
# -------------------------------------------------------------------------
#
-# $Id: GNUmakefile,v 1.2 2005-04-05 01:01:58 ianc Exp $
+# $Id: GNUmakefile,v 1.3 2005-04-11 23:00:49 ianc Exp $
#
@@ -26,7 +26,7 @@ TARGET = w32dtst.exe
SOURCES = w32dtst.cpp
-LIB = -L.. -lw32dlib
+LIB = -L.. -lw32dlib -lcomctl32 -lcomdlg32 -lole32
RES = dialog
diff --git a/src/test/w32dtst.cpp b/src/test/w32dtst.cpp
index 94245ba..6d579cc 100644
--- a/src/test/w32dtst.cpp
+++ b/src/test/w32dtst.cpp
@@ -342,6 +342,8 @@ int WINAPI WinMain (HINSTANCE hInstance,
Test t;
INT_PTR i;
+ W32DLib::Common::Initialise();
+
#ifdef DATAX_TEST
std::cout << "DATAX_TEST enabled" << std::endl;
#endif
diff --git a/src/w32dlib/common.h b/src/w32dlib/common.h
index 8fd4b14..7c0482c 100644
--- a/src/w32dlib/common.h
+++ b/src/w32dlib/common.h
@@ -35,6 +35,11 @@ namespace W32DLib
{
public:
+ /// \brief Initialises any Windows APIs required by W32DLib.
+ ///
+ static void Initialise();
+
+
/// \brief Displays a message box.
///
/// \param parent Parent window (NULL for none)