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 if it has actually been released yet.

If it isn't in there on your version, you can also just define teh function yourself somewhere and use it. Add to your module:

extern(Windows)
HANDLE CreateThread(
   LPSECURITY_ATTRIBUTES  lpThreadAttributes,
   SIZE_T                 dwStackSize,
   LPTHREAD_START_ROUTINE lpStartAddress,
   LPVOID                 lpParameter,
   DWORD                  dwCreationFlags,
   LPDWORD                lpThreadId
);

and then call it. If a type isn't defined you can replace it with void* usually.

Thanks, I replaced LPSECURITY_ATTRIBUTES and LPTHREAD_START_ROUTINE with void* and it works now. Anyhow the method FreeLibraryAndExitThread, which worked perfectly in the C++ Dll, doesn't unload the D Dll properly (the call has no effect at all). Why is that?

Reply via email to