Igor,
You could use /EXPORT linker option, either specified in your
project or introduced in the source code via #pragma comment.
Ah, this is interesting.
So i tried:
STDAPI DllCanUnloadNow()
{
return 0;
}
#pragma comment(linker, "/EXPORT:DllCanUnloadNow")
since the documentation to /EXPORTS says:
Do not specify the decorated form of C identifiers that are declared
__cdecl or __stdcall.
But this results in:
dll2.obj : warning LNK4104: export of symbol 'DllCanUnloadNow' should
be PRIVATE
Creating library dll2.lib and object dll2.exp
dll2.exp : error LNK2001: unresolved external symbol DllCanUnloadNow
dll2.dll : fatal error LNK1120: 1 unresolved externals
mh?
then i tried the decorated form:
#pragma comment(linker, "/EXPORT:_DllCanUnloadNow@0")
and now i looks as it is ok.
comments?