(from MSDN)
There are three methods for exporting a definition, listed in recommended
order of use:
__declspec(dllexport) in the source code
An EXPORTS statement in a .def file
An /EXPORT specification in a LINK command
All three methods can be used in the same program. When LINK builds a
program that contains exports, it also creates an import library, unless an
..exp file is used in the build.
LINK uses decorated forms of identifiers. The compiler decorates an
identifier when it creates the .obj file. If entryname is specified to the
linker in its undecorated form (as it appears in the source code), LINK
attempts to match the name. If it cannot find a unique match, LINK issues an
error message. Use the DUMPBIN tool to get the decorated names form of an
identifier when you need to specify it to the linker.
.....
(or use to extern "C" to "undecorated" the name)
Each one has it's plus ans minus.
Reagrds Jan
"Doug Gordon" <go******@hotmail.com> wrote in message
news:%2***************@TK2MSFTNGP09.phx.gbl...
I want to create an "MFC DLL" with VC.NET that will be explicitly loaded
when needed. That is, the main application will do a "LoadLibrary" call
and then a series of "GetProcAddress" calls to set up the entry points. What I
want is to be able to refer to the entry points as simple names, e.g.,
"MyFunction", as opposed to the "decorated" names that C++ generates by
default. So what I am asking about is the syntax for declaring the
functions in the DLL code.
I think I've done this in the distant past, and all I remember is
stringing together a lot of declarations and macros like "__dllexport", "WINAPI",
"__stdcall", etc. Does anyone have an example of how to do what I am
looking for here? Thanks.
Doug G