Hi, brand new to this forum, so please forgive me if I don't act similar to the rest of the community. I am here to ask what can I do to make a DLL compiled in Visual Studio run for others? When executed, the .NET created form runs fine when the DLL's starting point tells it to open. Unfortunately, it seems that this is the case only for me. For others, nothing happens at all for them. No form opens. Below is the code used for the DLL's entry.
Code:
void LOAD() {
ConsoleHacks();
Application::EnableVisualStyles();
Application::SetCompatibleTextRenderingDefault(false);
ApocClient::MainForm mainForm;
Application::Run(%mainForm);
exit(EXIT_FAILURE);
}
#pragma unmanaged
BOOL WINAPI DllMain(HINSTANCE hModule, DWORD dwReason, LPVOID lpReserved) {
DisableThreadLibraryCalls(hModule);
if (dwReason == DLL_PROCESS_ATTACH) {
HANDLE hThread = NULL;
HANDLE hDllMainThread = OpenThread(THREAD_ALL_ACCESS, NULL, GetCurrentThreadId());
if (lpReserved == NULL) {
if (!(hThread = CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE)LOAD, 0, 0, 0))) { //start main()
CloseHandle(hDllMainThread);
return FALSE;
}
CloseHandle(hThread);
}
else if (dwReason == DLL_PROCESS_DETACH) {}
return TRUE;
}
}