1. What is better, cdecl or stdcall?
- Posted by TheresNoTime Jun 28, 2013
- 1144 views
I need to write a DLL in C++. It will be linked to Euphoria project. What better use for exporting functions from C++ DLL to Euphoria script?
2. Re: What is better, cdecl or stdcall?
- Posted by Insolor Jun 28, 2013
- 1093 views
I need to write a DLL in C++. It will be linked to Euphoria project. What better use for exporting functions from C++ DLL to Euphoria script?
The most common practice is using stdcall unless you need functions with a variable count of arguments like WinAPI function wsprintf() etc. Anyway you can call a function with a fixed count of arguments from Euphoria (ie. you can import wsprintf() with define_c_proc(user32,"+wsprintfA",repeat(C_INT,10)) to use it with exactly 10 arguments).
4. Re: What is better, cdecl or stdcall?
- Posted by mattlewis (admin) Jun 28, 2013
- 1069 views
I need to write a DLL in C++. It will be linked to Euphoria project. What better use for exporting functions from C++ DLL to Euphoria script?
The most important thing is to export a C API for euphoria to use. Using a C++ DLL from anything but C++ (and the same compiler!) is a nightmare. Basically, this means writing your functions inside of an extern "C" block:
extern "C"{ /* functions here */ }
Matt