Hello All Experts !!

I want to register my VB function as a CallBack function in a DLL function.

viz. :

Declare Function lineInitialize Lib "tapi32.lib" (byref lphLineApp as Long, byval hInstance as Long, byval lpfnCallback as Long, byref lpszAppName as string, byref lpdwNumDevs as Double) as Long

Rem: The 3rd Parameter is the Name of CALLBACK Function. Below is how i tried to call it -
lineInitialize lphLineApp, App.hInstance, MyTapiCallback, App.EXEName, lpdwNumDevs




This function is defined in "Tapi32.Lib" and is fairely easy to do it in Visual C++ to register a function as
CALLBACK. but how can i register my one VB function as CALLBACK in the lineInitialze() function.

Below is the entire code, have a look -



Dim OriginalWidth as Integer, OriginalHeight as Integer
Dim lphLineApp as Long, lpdwNumDevs

private Sub cmdShutdown_Click()
Unload me
End Sub

private Sub Form_Load()
OriginalWidth = me.Width
OriginalHeight = me.Height
me.optCallType(0).Value = true ' 0=Voice, 1=Data, 2=Fax
lphLineApp = 0
lpdwNumDevs = 0
lineInitialize lphLineApp, App.hInstance, MyTapiCallback, App.EXEName, lpdwNumDevs
End Sub

private Sub Form_Resize()
If me.WindowState <> vbMinimized then
me.Width = OriginalWidth
me.Height = OriginalHeight
End If
End Sub

public Function MyTapiCallback(byval hDevice as Long, byval dwMessage as Long, byval dwInstance as Long, byval Param1 as Long, byval Param2 as Long, byval Param3 as Long)
Rem: This should be the CALLBACK function
MsgBox "Hello Callback Event", vbOKOnly, "TAPI 1.4"
End Function




CAN SOMEONE HELP ??

Thanks in Advance !!





I am new to Windows Programming. I have Win32 API Programming in my studies at this Semester.
So If I ask too much or Non-Sense, Please Ignore !

-Vipul Pathak.
Indore, (MP) INDIA.
ICQ# 102045224