.NETGURU
__stdcall and name decoration
Messages   Related Types
This message was discovered on microsoft.public.dotnet.languages.vc.
Responses highlighted in red are from those people who are likely to be able to contribute good, authoratitive information to this discussion. They include Microsoft employees, MVP's and others who IMHO contribute well to these kinds of discussions.
Post a new message to this list...

Eric Twietmeyer
Hello,

I am wondering how it is that all of the windows base dlls, like
kernel32.dll specify that all of their functions are __stdcall and yet the
exported names from the dll are not decorated with the preceeding underscore
and following @ parameter byte count.

When I export a function from my dll with __stdcall specified, the name is
something of the form "_funcname@4". If I export with __cdecl calling
convention I have simply "funcname" in the exported functions list (from
dumpbin).

But all of the Win32 functions specified in WinBase.h, for instance,
LoadLibraryA, are specified WINAPI, which expands to __stdcall. But doing
dumpbin on Kernel32.dll shows that the name is simply "LoadLibraryA" and not
"_LoadLibraryA@4", or whatever.

Am I misunderstanding something? Or is there some special compiler switch
that will not decorate __stdcall names when reported by dumpbin?

I would like to use the __stdcall calling convention but allow users of the
library to call GetProcAddress by passing the undecorated name, as is done
for functions from Kernel32.dll.

Thanks in advance,

-Eric Twietmeyer

Reply to this message...
 
    
Jeff Partch [MVP] (VIP)
"Eric Twietmeyer" <Click here to reveal e-mail address> wrote in message
news:Click here to reveal e-mail address...
[Original message clipped]

I think you can do it with a *.def file.
--
Jeff Partch [VC++ MVP]

Reply to this message...
 
 




ExamGuru IT Solutions - .Net Guru is owned and operated by ExamGuru, Inc., the man behind .Net Guru. If you're in the market for bespoke software or software consultancy, why not get him and his highly trained team to help? - www.examguru.net/ITCertification
Ad


Need Dot Net Interview Questions?
Ask ExamGuru, Inc. for advice and help on Passing .Net Interviews
.Net Projects
Best-of-breed application framework for .NET projects, developed by ExamGuru, Inc. and ExamGuru IT
Free .net Help
Commission ExamGuru, Inc. and his team for your next bespoke software project
FogBUGZ
The only bug tracking system carefully crafted with one goal in mind: helping teams create great software.
Awesome Tools
If you don't know about these, you're missing out... IT Certification Questions
IT Interview Questions
Free Oracle 10g Training
MCSE Boortcamp
Cisco Study Guides
Cheap Study Guides
Exact Questions
Dot Net Interview Questions
Oracle OCP
Cheap Travel
Designer Perfumes - Wholesale Prices
Free Programming Tutorials
 
ExamGuru IT Solutions - .Net Guru is owned and operated by ExamGuru, Inc., the man behind .Net Guru. If you're in the market for bespoke software or software consultancy, why not get him and his highly trained team to help? - www.examguru.net/ITCertification
 Copyright © ExamGuru, Inc. 2001-2006
Contact Us - Terms of Use - Privacy Policy - www.dot-net-guru.com - www.examguru.net - www.oraclesource.net - www.itinterviews.net - www.examguru.net/ITCertification