by yan (1 Submission)
Category: Windows API Call/Explanation
Compatability: VB 6.0
Difficulty: Unknown Difficulty
Originally Published: Mon 28th January 2002
Date Added: Mon 8th February 2021
Rating: (1 Votes)
How to deal with callback function in MFC C++ ?
API Declarations
Declare Function A Lib "Sekure" Alias "_A@8" (ByVal iPort As Integer, vFunc As Variant) As Integer
//global declaration
typedef void (*FINGER_STATUS) (short);
FINGER_STATUS FingStatus = NULL;
SEKURE_API int __stdcall int A (int comport, void *fnc)
{
FingStatus = (FINGER_STATUS)pFS;
int nRet = GetInfo(comport);
if (nRet) {
if(FingStatus)
FingStatus( nRet );
}
return OK;
......
}
in VB =>
Public Sub Verify()
Msgbox "HI"
..........
End Sub
Private Sub A_Click()
ret= A(1, AddressOf Verify)
......
End Sub