M
mosfet
Hi,
I have developped an MFC program that uses a fingerprint scanner.
To control the Bio scanner I use a library with the following function
these functions are used to get the status message from the scanner
T__STATUS SM_BSP_SetFingerStatus(T__STATUS i_nStatus, T__UCHAR *i_pImage,
T__ULONG i_nRow, T__ULONG i_nCol, T__BOOL *o_pContinue)
{
}
T__STATUS SM_BSP_SetMsgInfos(T__INT i_nMsgId, T__BOOL *o_pContinue)
{
}
T__STATUS SM_BSP_SetBSPStatus(T__UCHAR i_nStatusId, T__BOOL *o_pContinue)
{
}
l_GUICallbackFunctions.SM_BSP_SetFingerStatus=(PSM_BSP_SET_FINGER_STATUS)
&SM_BSP_SetFingerStatus;
l_GUICallbackFunctions.SM_BSP_SetMsgInfos = (PSM_BSP_SET_MSG_INFOS)
&SM_BSP_SetMsgInfos;
l_GUICallbackFunctions.SM_BSP_SetBSPStatus = (PSM_BSP_SET_BSP_STATUS)
&SM_BSP_SetBSPStatus;
ret = SM_BSP_SetGUICallback(l_GUICallbackFunctions);
SM_BSP_Capture(); //Capture fingerprint
SM_BSP_Process(); // Process fingerprint
My problem is I would like to create a C++ class like this
// CBio.hpp
class CBio
{
public:
CBio(); // constructor
~CBio(); // destructor
int InitBio();
int Capture();
private:
static T__STATUS SM_BSP_SetFingerStatus();
void EventDelay(DWORD dwMilliSec);
int m_nRet;
SM_BSP_GUI_CALLBACK l_GUICallbackFunctions;
};
//CBio.cpp
int CBio::InitBio()
{
// register CallBacks
l_GUICallbackFunctions.SM_BSP_SetFingerStatus=(PSM_BSP_SET_FINGER_STATUS)
&SM_BSP_SetFingerStatus;
}
return m_nRet;
}
T__STATUS CBio::SM_BSP_SetFingerStatus()
{
return 0;
}
The problem is
l_GUICallbackFunctions.SM_BSP_SetFingerStatus=(PSM_BSP_SET_FINGER_STATUS)
&SM_BSP_SetFingerStatus; doesn't
compile. I need to pass to the SM_BSP_SetFingerStatus function the adress of
another function. It works in C but not in C++.
How can I do this ?
I have developped an MFC program that uses a fingerprint scanner.
To control the Bio scanner I use a library with the following function
these functions are used to get the status message from the scanner
T__STATUS SM_BSP_SetFingerStatus(T__STATUS i_nStatus, T__UCHAR *i_pImage,
T__ULONG i_nRow, T__ULONG i_nCol, T__BOOL *o_pContinue)
{
}
T__STATUS SM_BSP_SetMsgInfos(T__INT i_nMsgId, T__BOOL *o_pContinue)
{
}
T__STATUS SM_BSP_SetBSPStatus(T__UCHAR i_nStatusId, T__BOOL *o_pContinue)
{
}
l_GUICallbackFunctions.SM_BSP_SetFingerStatus=(PSM_BSP_SET_FINGER_STATUS)
&SM_BSP_SetFingerStatus;
l_GUICallbackFunctions.SM_BSP_SetMsgInfos = (PSM_BSP_SET_MSG_INFOS)
&SM_BSP_SetMsgInfos;
l_GUICallbackFunctions.SM_BSP_SetBSPStatus = (PSM_BSP_SET_BSP_STATUS)
&SM_BSP_SetBSPStatus;
ret = SM_BSP_SetGUICallback(l_GUICallbackFunctions);
SM_BSP_Capture(); //Capture fingerprint
SM_BSP_Process(); // Process fingerprint
My problem is I would like to create a C++ class like this
// CBio.hpp
class CBio
{
public:
CBio(); // constructor
~CBio(); // destructor
int InitBio();
int Capture();
private:
static T__STATUS SM_BSP_SetFingerStatus();
void EventDelay(DWORD dwMilliSec);
int m_nRet;
SM_BSP_GUI_CALLBACK l_GUICallbackFunctions;
};
//CBio.cpp
int CBio::InitBio()
{
// register CallBacks
l_GUICallbackFunctions.SM_BSP_SetFingerStatus=(PSM_BSP_SET_FINGER_STATUS)
&SM_BSP_SetFingerStatus;
}
return m_nRet;
}
T__STATUS CBio::SM_BSP_SetFingerStatus()
{
return 0;
}
The problem is
l_GUICallbackFunctions.SM_BSP_SetFingerStatus=(PSM_BSP_SET_FINGER_STATUS)
&SM_BSP_SetFingerStatus; doesn't
compile. I need to pass to the SM_BSP_SetFingerStatus function the adress of
another function. It works in C but not in C++.
How can I do this ?