Hi, I'm new to Nim and messing around with creating x86 DLLs on Windows using the following code:
import winim
proc DllMain(hinstDLL: HINSTANCE, fdwReason: DWORD, lpvReserved: LPVOID) : BOOL {.stdcall.} =
result = 1
if fdwReason == DLL_PROCESS_ATTACH:
MessageBox(0, "Test", "Nim", 0)
and compiling it with the following:
nim c --cpu:i386 --app:lib --noMain -d:release -d:useNimRtl
From the documentation and some forum posts I've read I expected this would allow me to build a DLL that doesn't do Nim's default main initialization and allow me to use my own DllMain. However, my DLL still builds with NimMain inside it, does not call DllMain, and does not load nimrtl.dll(I was able to successfully build this.) I'm using version 0.17.2 of the Nim compiler.
So my question is: How do I properly build a DLL with Nim that uses a custom DllMain and the nimrtl.dll?