Re: Exporting functions in a DLL without the = _FunctionName
"Bruce" <Bruce@nospam.com> wrote in message
news:O5bHuyNRHHA.1200@TK2MSFTNGP02.phx.gbl...
I need to write a DLL for a Domino server. It is currently not working and
I believe the problem might be related to how the DLL was compiled. I did a
Dumpbin of a sample DLL that came from Notes.
The dump looks like this:
ordinal hint RVA name
1 0 00001014 FilterInit
2 1 00001005 HttpFilterProc
3 2 0000100F TerminateFilter
When I do a DumpBin of my DLL, it looks like this:
ordinal hint RVA name
1 0 00001000 FilterInit = _FilterInit
2 1 00001070 HttpFilterProc = _HttpFilterProc
3 2 00001050 TerminateFilter = _TerminateFilter
Notice the equals and the underscore character.
I am using VC8.
I am declaring the function with extern "C" __declspec(dllexport)
MyFunction()
I tried a DEF file as suggested in a post I found on a search but that did
not work.
How do I compile the DLL without the = _FunctionName ?
I just tried building a DLL of mine which is required to export a function
with a given name. I tried building it twice, both times in a .cpp source
file defining the function once as
extern "C" void CALLBACK MyFunc(...)
and once as
void CALLBACK MyFunc(...)
I used a module definition file
LIBRARY MyDLL
EXPORTS
MyFunc
and both times the function is exported without the leading underscore.
There are two differences between what I did and what you did. I used a
module definition file while you tagged the definition with
__declspec(dllexport). And I built it with VS2003 where you are using VS2005
(IIUC).
I'm no linker expert, but the dump seems to imply that the function has been
aliased with _both_ names. I would have expected that to work, but that's a
guess.
Is there any chance that it doesn't work for some other reason? If for
example, your DLL is dependent on another which is not on the Domino
server's path Domino might fail to load it. Or could there be a security
context issue where some resource is not available to Domino?
Regards,
Will
www.ivrforbeginners.com