Created
April 18, 2015 01:12
-
-
Save mesaleh/9b25ebaa0c3070f73814 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* Moustafa Saleh ([email protected]) | |
* | |
* Test DLL | |
* Compile: | |
* GCC: gcc test_dll.c -o test_dll_gcc.dll -shared -Wl,--out-implib,test_dll_gcc.a -DBUILDING_TEST_DLL | |
* CL: cl test_dll.c kernel32.lib user32.lib /LD /D BUILDING_TEST_DLL | |
*/ | |
#include <windows.h> | |
#ifdef BUILDING_TEST_DLL | |
#define TEST_DLL __declspec(dllexport) | |
#else | |
#define TEST_DLL __declspec(dllimport) | |
#endif | |
#ifdef __cplusplus | |
extern "C" | |
{ | |
#endif | |
TEST_DLL void __stdcall bar() | |
{ | |
MessageBox(0, "Welcome, you're in bar()!", "Test DLL", 0); | |
} | |
TEST_DLL void __stdcall foo() | |
{ | |
MessageBox(0, "Welcome, you're in foo()!", "Test DLL", 0); | |
} | |
#ifdef __cplusplus | |
} | |
#endif | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment