Re: Can't find windows' CreateThread function / concurrency.spawn crashes host application

2016-01-02 Thread alkololl via Digitalmars-d-learn
On Saturday, 2 January 2016 at 16:42:46 UTC, Rainer Schuetze wrote: On 02.01.2016 16:34, alkololl wrote: On Saturday, 2 January 2016 at 01:44:46 UTC, Adam D. Ruppe wrote: [...] Thanks for your reply. I replaced my switch statement with the one behind the link you left but the result (no re

Re: Can't find windows' CreateThread function / concurrency.spawn crashes host application

2016-01-02 Thread alkololl via Digitalmars-d-learn
On Saturday, 2 January 2016 at 01:44:46 UTC, Adam D. Ruppe wrote: On Saturday, 2 January 2016 at 00:32:20 UTC, alkololl wrote: Why is that? I'm not sure, but in the switch you posted, you didn't handle the DLL_THREAD_ATTACH and DLL_THREAD_DETACH cases, the runtime might be incrementing the

Re: Can't find windows' CreateThread function / concurrency.spawn crashes host application

2016-01-01 Thread alkololl via Digitalmars-d-learn
On Friday, 1 January 2016 at 22:45:20 UTC, Adam D. Ruppe wrote: On Friday, 1 January 2016 at 22:02:46 UTC, alkololl wrote: I've found that std.c.windows.windows doesn't include a std.c.windows is basically useless. The new version should have it in core.sys.windows.windows though I'm not sure

Re: Can't find windows' CreateThread function / concurrency.spawn crashes host application

2016-01-01 Thread alkololl via Digitalmars-d-learn
Here is my code: // File dllmain.d module dllmain; import core.runtime; import std.c.stdlib; import std.string; import std.c.windows.windows; import honmod; private HINSTANCE g_hInst; extern (Windows) BOOL DllMain(HINSTANCE hInstance, ULONG ulReason, LPVOID pvReserved) { g_hInst =

Can't find windows' CreateThread function / concurrency.spawn crashes host application

2016-01-01 Thread alkololl via Digitalmars-d-learn
Hey there and a happy new year, I wrote a C++ Dll which gets injecrted into another process. Now I want to port that Dll to D. In my C++ Dll I used a while loop which captures all keystrokes via GetAsyncKeyState and waited for F7 to be pressed and lastly unloads the dll via FreeLibraryAndExit