At first I thought of an entry point in the DLLMain DLL, but then when I try to import it into C #, I get an error that the entry point was not found. Here is my code:
#include <Windows.h> int Test(int x,int y) { return x+y; } BOOL APIENTRY DllMain( HMODULE hModule, DWORD ul_reason_for_call, LPVOID lpReserved ) { switch (ul_reason_for_call) { case DLL_PROCESS_ATTACH: MessageBox(0,L"Test",L"From unmanaged dll",0); case DLL_THREAD_ATTACH: case DLL_THREAD_DETACH: case DLL_PROCESS_DETACH: break; } return TRUE; }
How can I set an entry point for my dll? And if you don't mind, can you give me a little explanation about the entry point?
How do I need to import the same DLL again and change the entry point so that I can use other functions in the same DLL? thanks in advance.
c ++ dll winapi dllimport
method
source share