Function Pointer + DLL Syntax Help

Started by
1 comment, last by kag1 19 years, 1 month ago
Hello, I'm wondering what the proper syntax is for the following: Base.h

extern BOOL (CALLBACK *Functor) (DWORD, DWORD);
code.cpp

BOOL (CALLBACK *Functor) (DWORD, DWORD);
If I were to do a __declspec (dllexport)..where would I put it? I seem to be putting it in the wrong spot? When I try to use the dll it says Functor is undefined thanks
Advertisement
#define DLL_SYMBOL_EXPORT extern "C" __declspec(dllexport)DLL_SYMBOL_EXPORT BOOL (CALLBACK *Functor) MyFunc(DWORD dwWord,DWORD dwWord2) {}


That should work; although I haven't exactly worked with an API callback via DLLs yet; but that's where the __declspec goes. As far as I know you also need the extern "C" because C++ symbol tables turn out to be jumbled.
-John "bKT" Bellone [homepage] [[email=j.bellone@flipsidesoftware.com]email[/email]]
So then I should just leave my declaration the same then? and export the actual definition?

This topic is closed to new replies.

Advertisement