1. DLLs should always have a default entry point (e.g. C has Main(), Windows GUI have WinMain). DLLs have DllMain(). The following compiles in C.
Code:
BOOL APIENTRY DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved)
{
return TRUE;
}
2. Try:
Code:
DLLIMPORT void HelloWorld(void)
{
MessageBox (0, "Hello World from DLL!\n", "Hi", MB_ICONINFORMATION);
}
w/ the header files as:
Code:
#include <windows.h>
#ifndef _DLL_H_
#define _DLL_H_
#if BUILDING_DLL
# define DLLIMPORT __declspec (dllexport)
#else /* Not BUILDING_DLL */
# define DLLIMPORT __declspec (dllimport)
#endif /* Not BUILDING_DLL */
BOOL APIENTRY DllMain (HINSTANCE, DWORD, LPVOID);
DLLIMPORT void HelloWorld(void);
#endif /* _DLL_H_ */