News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

Problem understanding DLL calls

Started by Robert Collins, February 28, 2005, 05:19:05 PM

Previous topic - Next topic

Robert Collins

As I have indicated on previous postings (elsewhere in this forum) I have to create all DLLs in 'C' (company policy). I thought it was necessary to put a _stdcall declarative on all exported functions in order to keep the parameter calling sequences correct for any function that I will later call in VB applications. l thought that this was only necessary if the DLL was written in C++ but I see that I have to also do this even if the DLL is written in just plain 'C'. Doesn't 'C' already use the left-to-right sequence and that the _stdcall was to force C++ to use the same sequence? Am I all mixed up about this or what?


Relvinian

Robert,

Different compilers by default will build in __stdcall or __cdecl based on their project settings. The default settings for Microsoft Visual C++ (Studio) is __cdecl on all functions. You can change this in the project settings or specify which functions will be __stdcall or __cdecl specific.

As for being C or C++ dependent, that it isn't. What you may be thinking about is the EXTERN "C" stuff for C++ functions to allow them to be used by C code or C++ (as in the case of assembling a ASM file and calling it in a C++ file).

Relvinian

Robert Collins

Thanks, Relvinian....

Your explanation eased my mind. I guess I was getting things confused. C/C++ is definitly not my language but I have to write certain things in it (someday I hope to convince the department to write DLLs in ASM (ha ha ha, big chance of that).