aboutsummaryrefslogtreecommitdiff
path: root/win32/examples
diff options
context:
space:
mode:
Diffstat (limited to 'win32/examples')
-rw-r--r--win32/examples/dll.c7
-rw-r--r--win32/examples/hello_dll.c17
2 files changed, 13 insertions, 11 deletions
diff --git a/win32/examples/dll.c b/win32/examples/dll.c
index 4c1d8ce..052a056 100644
--- a/win32/examples/dll.c
+++ b/win32/examples/dll.c
@@ -4,9 +4,10 @@
//
#include <windows.h>
-#define DLL_EXPORT __declspec(dllexport)
-DLL_EXPORT void HelloWorld (void)
+__declspec(dllexport) const char *hello_data = "(not set)";
+
+__declspec(dllexport) void hello_func (void)
{
- MessageBox (0, "Hello World!", "From DLL", MB_ICONINFORMATION);
+ MessageBox (0, hello_data, "From DLL", MB_ICONINFORMATION);
}
diff --git a/win32/examples/hello_dll.c b/win32/examples/hello_dll.c
index 7adba77..4813c5b 100644
--- a/win32/examples/hello_dll.c
+++ b/win32/examples/hello_dll.c
@@ -5,15 +5,16 @@
#include <windows.h>
-void HelloWorld (void);
+void hello_func (void);
+__declspec(dllimport) extern const char *hello_data;
int WINAPI WinMain(
- HINSTANCE hInstance,
- HINSTANCE hPrevInstance,
- LPSTR lpCmdLine,
- int nCmdShow)
+ HINSTANCE hInstance,
+ HINSTANCE hPrevInstance,
+ LPSTR lpCmdLine,
+ int nCmdShow)
{
- HelloWorld();
- return 0;
+ hello_data = "Hello World!";
+ hello_func();
+ return 0;
}
-