Post by DojoMike » 21 Aug 2017, 20:41
Hey there,
I'm writing a script that converts a C/C++ header file to AHK functions that wrap the DllCalls. For example, it would take this:
Code: Select all
extern "C" __declspec(dllexport) int add(int x, int y);
and turn it into this:
Code: Select all
add(x, y)
{
return DllCall("myDLL.dll/add", "int", x, "int", y, "Cdecl int")
}
Now every time I've written a DLL function, it has used the "C" calling convention, mostly because I'm not sure what the others are or how to use them. I did a bit of research on MSDN and found 3-4 others that are Windows-specific, but it was just a list (no example use). So any info on the subject would be awesome.
PS: I think a script like this would help newbies and pros alike, and I'm cool with doing it on my own, but it's a big project (especially when you get into pre-processor directives, typedefs etc. that can affect the compiled DLL). So if you like this idea, I'd be glad to team up on this.
Hey there,
I'm writing a script that converts a C/C++ header file to AHK functions that wrap the DllCalls. For example, it would take this:
[code]extern "C" __declspec(dllexport) int add(int x, int y);[/code]
and turn it into this:
[code]add(x, y)
{
return DllCall("myDLL.dll/add", "int", x, "int", y, "Cdecl int")
}[/code]
Now every time I've written a DLL function, it has used the "C" calling convention, mostly because I'm not sure what the others are or how to use them. I did a bit of research on MSDN and found 3-4 others that are Windows-specific, but it was just a list (no example use). So any info on the subject would be awesome.
PS: I think a script like this would help newbies and pros alike, and I'm cool with doing it on my own, but it's a big project (especially when you get into pre-processor directives, typedefs etc. that can affect the compiled DLL). So if you like this idea, I'd be glad to team up on this. :)