What is the diff between ?Foo@Class and ?FooA@Class in DLL export?
-
Hi everyone, I have a DLL with some classes in it. Header file have dllexport feature on class. This class has some methods, several of them are virtual. So, the problem is that my test app looking for Foo method in DLL, but can't find it because in DLL it's defined as FooA, but not Foo. Can somebody tell me what's wrong? In this [post^] I describe situation in detailes with some code examples. Thanks in advance, va'Lery.
-
Hi everyone, I have a DLL with some classes in it. Header file have dllexport feature on class. This class has some methods, several of them are virtual. So, the problem is that my test app looking for Foo method in DLL, but can't find it because in DLL it's defined as FooA, but not Foo. Can somebody tell me what's wrong? In this [post^] I describe situation in detailes with some code examples. Thanks in advance, va'Lery.
I'm not positive on this, but I believe the A specifies that the function is cdecl. I'd double-check the calling conventions. -- Joel Lucsy
-
I'm not positive on this, but I believe the A specifies that the function is cdecl. I'd double-check the calling conventions. -- Joel Lucsy
-
Hi everyone, I have a DLL with some classes in it. Header file have dllexport feature on class. This class has some methods, several of them are virtual. So, the problem is that my test app looking for Foo method in DLL, but can't find it because in DLL it's defined as FooA, but not Foo. Can somebody tell me what's wrong? In this [post^] I describe situation in detailes with some code examples. Thanks in advance, va'Lery.
I suspect that in the DLL, the function has the same name as a Windows function whose header you have included, while you haven't included the same header in the application. Example: the Windows header WinBase.h defines the functions
DeleteFileA
andDeleteFileW
. It also maps the nameDeleteFile
via a macro toDeleteFileA
orDeleteFileW
depending on whether theUNICODE
symbol is defined. This allows you to switch between using the ANSI and Unicode versions of the functions simply by defining or undefiningUNICODE
. Unfortunately the macro processor has no idea of scope and doesn't realise that you actually wanted to refer to a class member function rather than to refer to the Windows function, so it replaces your Foo with FooA. Solutions: either rename the function, or #undef the macro. If you #undef the macro, consider using#pragma push_macro
and#pragma pop_macro
to store and retrieve the macro value (supported in VC 6.0, even though undocumented). Using #undef in this way is a real hassle, though, so I'd simply rename the offending function. -
I suspect that in the DLL, the function has the same name as a Windows function whose header you have included, while you haven't included the same header in the application. Example: the Windows header WinBase.h defines the functions
DeleteFileA
andDeleteFileW
. It also maps the nameDeleteFile
via a macro toDeleteFileA
orDeleteFileW
depending on whether theUNICODE
symbol is defined. This allows you to switch between using the ANSI and Unicode versions of the functions simply by defining or undefiningUNICODE
. Unfortunately the macro processor has no idea of scope and doesn't realise that you actually wanted to refer to a class member function rather than to refer to the Windows function, so it replaces your Foo with FooA. Solutions: either rename the function, or #undef the macro. If you #undef the macro, consider using#pragma push_macro
and#pragma pop_macro
to store and retrieve the macro value (supported in VC 6.0, even though undocumented). Using #undef in this way is a real hassle, though, so I'd simply rename the offending function. -
Hi everyone, I have a DLL with some classes in it. Header file have dllexport feature on class. This class has some methods, several of them are virtual. So, the problem is that my test app looking for Foo method in DLL, but can't find it because in DLL it's defined as FooA, but not Foo. Can somebody tell me what's wrong? In this [post^] I describe situation in detailes with some code examples. Thanks in advance, va'Lery.