Hello,

I'm having trouble about setting up a callback function in a DLL. I'm not
sure what I should do to store the pointer to the callback function of the
test application from the DLL, so that it will persist after the function
DefineCallback() has ended... Here I use extern to try to achieve it but
seems I have problems with pointers... This is the code of the DLL:

--dll.h
typedef int (PASCAL *GENERALCB)(UINT uMsg, DWORD dwSize, int *iStatus, char
*lpString1, char *lpString2);

extern GENERALCB *MyGeneralProc;

HANDLE PASCAL DefineCallback(HANDLE hHost, char *lpFilename, char *lpDest,
UINT uOffset, GENERALCB *GeneralProc);

--dll.cpp
:
:
HANDLE DefineCallback(HANDLE hHost, char *lpFilename, char *lpDest, UINT
uOffset, GENERALCB *GeneralProc)
{
MessageBox(0, "This is DefineCallback().", "dll.cpp", MB_ICONINFORMATION);
MyGeneralProc = GeneralProc;
return 0;
}

What's wrong in my code? How should I correct it so that I can have it
running?
I'll be glad if somebody can help me.

David