Callback functions to a C++ DLL in VB

I have the following situation:

On my C++ Dll I have the folowing protocol:

extern "C" __declspec(dllexport) void Op(LPCSTR IP_Adress, BYTE Serial_Port, void (FAR WINAPI *epf)(DWORD,HANDLE), void (FAR WINAPI *drf)(DWORD,HANDLE), LPSTR Buffer, DWORD BufLen, HANDLE* Identifier)

So the third and fourth parameters are callback functions to the DLL function. I've tried to use like this on VB project:

Op("129.214.68.250", "A", AddressOf Error_Function, AddressOf Reception_Function, b, 512, handle)

below are the function protocols used in Vb project :

Private Declare Function Op Lib "Trans.dll" (ip As String, PORT As String, ByVal Error_Func As Long, ByVal Reception_Func As Long, ByVal Buffer As String, Size As Integer, ByVal handle As Long) As Variant

Function Error_Function(buffer_length As Double, handle As Long)

End Function

Function Reception_Function(buffer_length As Double, handle As Long)

End Function

But I am having the message "Invalid use of AddressOF operator" . Can anybody image what should I do?

Thank you...
[1144 byte] By [barrosjl] at [2007-11-17 17:07:43]
# 1 Re: Callback functions to a C++ DLL in VB
Put your Error_Function and Reception_Function in a public module, addressOf won't work with functions in class modules or form modules.
DSJ at 2007-11-10 0:22:42 >
# 2 Re: Callback functions to a C++ DLL in VB
Thanks for your help... It works...
barrosjl at 2007-11-10 0:23:42 >