1 Attachment(s)
Callback method, WithEvents... I don't know ??
I'm using a dll and calling method, everything is fine except when I'm calling method that are returning result through an "Event Interface"
Here's my form code and The interface definition(attached file...)
Can you tell me how to declare and use a callback method. For example the :OnGetUnitInfoEvent method.
Thanks.
VB Code:
Dim WithEvents myc As INTELLEXAPILib.NTLXRemoteAx
Private Sub Command1_Click()
NtlxImage1.SaveImage "c:\"
End Sub
Private Sub Form_Load()
Dim test As Long
Dim mySID As Long
Set myc = New INTELLEXAPILib.NTLXRemoteAx
Dim someDateAndTime As Date
Dim myDate As Date
someDateAndTime = #8/13/2004 12:14:00 PM#
myDate = #7/19/2006 1:14:00 PM#
NtlxImage1.auth = "\10.1.1.108\Administrator\1234"
NtlxImage1.Camera = 1
NtlxImage1.Port = 5001
NtlxImage1.unit = "10.1.1.108"
NtlxImage1.Height = 480
NtlxImage1.Width = 640
NtlxImage1.resolution = NIR_AUTO
NtlxImage1.Display
mySID = myc.Connect("10.1.1.108", "5001", NtlxImage1.auth)
'myc.GetAlarmList mySID, 0, someDateAndTime, myDate, "c:\test.log"
'myc.GetUnitInfo mySID
myc.GetUnitInfo (mySID)
End Sub
Public Sub myc_OnGetUnitInfoEvent(ByVal lSessionID As Long, ByVal eReason As eStatusReason, ByVal pIUnitInfo As INTLXUnitInfo)
MsgBox lSessionID
End Sub
Private Sub Timer1_Timer()
NtlxImage1.Display
End Sub
And here's part of the IDL for the dll, only showing the OnGetUnitEvent....
Code:
[id(0x00000005), helpstring("Completion event for a GetUnitInfo method call. If the reason is anything except complete the info interface will be NULL.")]
HRESULT OnGetUnitInfoEvent(
[in] long lSessionID,
[in] eStatusReason eReason,
[in] INTLXUnitInfo* pIUnitInfo);
Re: Callback method, WithEvents... I don't know ??
Public Sub myc_OnGetUnitInfoEvent(ByVal lSessionID As Long, ByVal eReason As eStatusReason, ByVal pIUnitInfo As INTLXUnitInfo)
MsgBox lSessionID
Text1.Text = pIUnitInfo.XmlString
End Sub
NTLXRemote Act As Controll and this is the Event from GetSomething metod.
Write to my mail, please