Dll with a different entry point as Dllmain

2021-03-17 Thread ludisposed
I am having another problem, the entire reason to use a different entrypoint as opposed to DllMain was that I needed to use threads in my Dll, but whenever I compile the dll with `--threads:on` it won't work (I guess problems with the LoadLibrary underneath, any suggestions how to use threads wi

Dll with a different entry point as Dllmain

2021-03-17 Thread ludisposed
@PMunch Thanks, it was actually as simple as that. You do however still need to add a DllMain and specify `--noman` in the compiler Example: import winim import os proc NimMain() {.cdecl, importc.} proc DllMain(hinstDLL: HINSTANCE, fdwReason: DWORD, lpvReserved: LPV

Dll with a different entry point as Dllmain

2021-03-16 Thread Araq
Compile with `--noMain` and use some linker command to specify the entry point's name. Maybe it's possible, I never had to do that.

Dll with a different entry point as Dllmain

2021-03-16 Thread PMunch
Yes, you just attach the pragmas `{.stdcall,exportc,dynlib.}` to the procedure and you can export any procedure just fine.

Dll with a different entry point as Dllmain

2021-03-15 Thread ludisposed
As described by the title, is it possible to export other function from a Dll as opposed to DllMain?