Re: How to build dll?

2020-12-03 Thread frame via Digitalmars-d-learn
On Wednesday, 2 December 2020 at 19:42:37 UTC, Jack wrote: What am I missing? As always... have you tired dmd -m32mscoff ?

Re: How to build dll?

2020-12-03 Thread Виталий Фадеев via Digitalmars-d-learn
On Wednesday, 2 December 2020 at 19:42:37 UTC, Jack wrote: D code: import core.sys.windows.dll; mixin SimpleDllMain; version(Windows) extern(C) export int foo() { return 42; } compiled with: dmd -ofmydll.dll -shared -m32 dll.d called from: typedef int (__cdecl *MYPROC)(void); int WINA

Re: How to build dll?

2020-12-02 Thread Ferhat Kurtulmuş via Digitalmars-d-learn
On Wednesday, 2 December 2020 at 20:08:29 UTC, Jack wrote: On Wednesday, 2 December 2020 at 19:42:37 UTC, Jack wrote: D code: [...] compiled with: [...] called from: [...] but hinstLib is NULL and GetLastError() = 193: [...] What am I missing? for same reason, the dll build

Re: How to build dll?

2020-12-02 Thread Jack via Digitalmars-d-learn
On Wednesday, 2 December 2020 at 19:42:37 UTC, Jack wrote: D code: import core.sys.windows.dll; mixin SimpleDllMain; version(Windows) extern(C) export int foo() { return 42; } compiled with: dmd -ofmydll.dll -shared -m32 dll.d called from: typedef int (__cdecl *MYPROC)(void); int WINA

How to build dll?

2020-12-02 Thread Jack via Digitalmars-d-learn
D code: import core.sys.windows.dll; mixin SimpleDllMain; version(Windows) extern(C) export int foo() { return 42; } compiled with: dmd -ofmydll.dll -shared -m32 dll.d called from: typedef int (__cdecl *MYPROC)(void); int WINAPI wWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance,