header file
class MainClass
{
public:
MainClass(void);
~MainClass(void);
public:
void RegCallBack();
static void __stdcall CB_CardEncode2(unsigned int nChannel,ISIL_ENCODE_DATA *pEncData,void *pContext);
};
Cpp file
extern "C"
{
void MainClass:: CB_CardEncode2(unsigned int nCh,ISIL_ENCODE_DATA *pEncData,void *pContext)
{
FILE *P=fopen("c:/Record/TP5.txt","w");
fprintf(P, "i am card encode2!!!");
fclose(P);
}
void RegCallBack()
{
ISIL_Card_RegEncode2Callback(CB_CardEncode2,NULL);
}
Hi,
i am creating a dll,my problem is that i am passing as a parameter a static member function CB_CardEncode2 in ISIL_Card_RegEncode2Callback(CB_CardEncode2,NULL);
but CB_CardEncode2 member function is not calling.
i dont have idea how to pass a static member function as a parameter in other function and how to call CB_CardEncode2 static member function.
Thanks....
Hi,
I have to make entry point of the RegcallBack()
like
int __stdcall RegCallBack();
__declspec(dllexport) int __stdcall RegCallBack()
{
ISIL_Card_RegEncode2Callback1(MainClass::CB_CardEncode2,NULL);
return TRUE;
}
but when the compile then gives error,
please help me.give me any example.
Thanks
when i am using classscope ISIL_Card_RegEncode2Callback1(MainClass::CB_CardEncode2,NULL);
then give this error
Error 1 error C2664:
and when using
ISIL_Card_RegEncode2Callback1((CALL)MainClass::CB_CardEncode2,NULL);
then succesful
CB_CardEncode2 function not read.
where am i going wrong .please help me......
thanks