Re: syntax for function header/prototype and implementation

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



On Fri, 3 Aug 2007 22:20:12 +0300, "Alex Blekhman" <tkfx.REMOVE@xxxxxxxxx>
wrote:

"Jeff Kish" wrote:
I did this but it decorated the function name in the dll
...

HEADER (wrapped in exter "C")
__declspec(dllexport) void WINAPI
NavImagingRegisterPaintNotificationCallback(int
nControlId,
fpTypeNavImagingPaintCallback);

CPP
extern "C" __declspec(dllexport) void WINAPI myFunc(int
...)

I thought the extern "C" would prevent that. Any thoughts?

You need to add a .DEF file to your project if you want to
avoid decorated names. See here for more info:

"Exporting from a DLL Using DEF Files"
http://msdn2.microsoft.com/en-us/library/d91k01sh(VS.80).aspx

Alex
Alex,
I thought that is what extern "C" did.
;> (

Jeff Kish
.



Relevant Pages

  • Re: syntax for function header/prototype and implementation
    ... fpTypeNavImagingPaintCallback); ... extern "C" __declspecvoid WINAPI myFunc ... I thought the extern "C" would prevent that. ... You need to add a .DEF file to your project if you want to avoid decorated names. ...
    (microsoft.public.vc.language)
  • Re: HOWTO Overload ADVAPI32.DLLs registry functions
    ... If so, use a .DEF file and list MY_RegOpenKeyA etc., or use extern "C" on ... > IN HKEY hKey, ... > int i = 2; ...
    (microsoft.public.win32.programmer.kernel)
  • Re: building dynamic runtime library through command line.
    ... line (i.e. through nmake) without adding "extern "C" ... You can write a .def file instead to list exported functions. ...
    (microsoft.public.vc.language)
  • Re: C++ in user mode dll
    ... I use def file for C functions and dont have to use extern C. ... though and it compiles and links with App and executes properly. ... I am trying to export a class or class member function. ...
    (microsoft.public.development.device.drivers)
  • Re: Calling a DLL function
    ... I was wondering if I can do that without using the .def file. ... You could declare it extern "C", but the downside includes: ...
    (microsoft.public.vc.mfc)