hello world dll c 2b 2b

Solutions on MaxInterview for hello world dll c 2b 2b by the best coders in the world

showing results for - "hello world dll c 2b 2b"
Valerio
10 Mar 2016
1#define WIN32_LEAN_AND_MEAN
2#include <windows.h>
3
4extern "C" __declspec(dllexport)
5DWORD WINAPI MessageBoxThread(LPVOID lpParam) {
6  MessageBox(NULL, "Hello world!", "Hello World!", NULL);
7  return 0;
8}
9
10extern "C" __declspec(dllexport)
11BOOL APIENTRY DllMain(HMODULE hModule,
12                      DWORD ul_reason_for_call,
13                      LPVOID lpReserved) {
14  switch (ul_reason_for_call) {
15    case DLL_PROCESS_ATTACH:
16      CreateThread(NULL, NULL, MessageBoxThread, NULL, NULL, NULL);
17      break;
18    case DLL_THREAD_ATTACH:
19    case DLL_THREAD_DETACH:
20    case DLL_PROCESS_DETACH:
21      break;
22  }
23  return TRUE;
24}