Re: Exporting function in VS2008 DLL
- From: "Alex Blekhman" <tkfx.REMOVE@xxxxxxxxx>
- Date: Mon, 18 Aug 2008 14:09:10 +0300
"Leon" wrote:
This is a brief description of my sample project. I have a Foo.h
which contains this:
//Foo.h
#ifdef BUILD_MYDLL
#define DLLENTRY __declspec(dllexport)
#else
#define DLLENTRY __declspec(dllimport)
#endif
extern "C" { DLLENTRY int Foo(LPCTSTR); }
In addition to other replies. Do not forget to put the calling
convention for an exported function, for example:
extern "C" { DLLENTRY int __stdcall Foo(LPCTSTR); }
Calling convention mismatch between DLL and a client is one of the
most common mistakes. By specifying calling convention explicitly
you ensure that this error won't happen.
HTH
Alex
.
- References:
- Exporting function in VS2008 DLL
- From: Leon
- Exporting function in VS2008 DLL
- Prev by Date: Re: VC9 + SP1 and manifests (broken)
- Next by Date: Re: VC9 + SP1 and manifests (broken)
- Previous by thread: Re: Exporting function in VS2008 DLL
- Next by thread: proxy stub code
- Index(es):
Relevant Pages
|