Mostly, yes, though stdcall is a calling convention in its own right (Pascal was Win16 -- stdcall is the same as cdecl except that the called function clears the stack). And I believe the calling convention comes after the return type and before the function name, so:
Code: Select all
int __stdcall ReturnSomething(int n)
{ return something; }
<deep breath> Also, changing the calling convention changes the name decoration. Under cdecl, that function would be _ReturnSomething. Under stdcall, it's _ReturnSomething@4 (four because that's the size of the parameter list). Maybe this doesn't apply to gcc, but if you used __declspec(dllexport) to export this function, it would be called _ReturnSomething@4 in the DLL -- not what you want. So to resolve that you'd put together a .DEF file containing the name(s) of the function(s) you wanted exported, such as:
Code: Select all
NAME something.dll
EXPORTS
ReturnSomething
ReturnSomethingElse
Regarding the VB code, I don't know what the syntax under VB.NET (aka Visual Fred) would be. It's likely to be completely different from the VB6 equivalent.