I found the solution here: Use a function from an external DLL

Originally Posted By: Ch40zzC0d3r
Stop using stdcall in your typedef. The lite-c compiler may not know any other callingconventions then cdecl so stack is cleaned up 2 times (by caller and callee) and will crash you.
Try cdecl.


before:
Code:
void WINAPI hellozorro(char*);

after:
Code:
void __cdecl hellozorro(char*);


This works like a charm.

Conclusion: WINAPI is defined as __stdcall in windows.h. stdcall is not compatible with my DLL for reasons unknown. Instead, use cdecl.

Last edited by AndrewAMD; 04/10/17 11:35.