I searched here but none of these questions helped me so yeah I'll explain: My Dllmain function is not being called when it attaches to a process (rundll32.exe) in visual studio project settings I changed it to attach to rundll32.exe it was supposed to show a messagebox on attach but it just doesn't do it. My code:
// dllmain.cpp : Defines the entry point for the DLL application.
#include "pch.h"
BOOL APIENTRY DllMain( HMODULE hModule,
DWORD ul_reason_for_call,
LPVOID lpReserved
)
{
switch (ul_reason_for_call)
{
case DLL_PROCESS_ATTACH:
MessageBox(NULL,L"ThumbsUp",L"Attached",MB_ICONINFORMATION);
case DLL_THREAD_ATTACH:
case DLL_THREAD_DETACH:
case DLL_PROCESS_DETACH:
break;
}
return TRUE;
}
Thanks