Results 1 to 2 of 2

Thread: Callback method, WithEvents... I don't know ??

Threaded View

  1. #1

    Thread Starter
    New Member
    Join Date
    Jul 2006
    Posts
    6

    Exclamation 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:
    1. Dim WithEvents myc As INTELLEXAPILib.NTLXRemoteAx
    2. Private Sub Command1_Click()
    3. NtlxImage1.SaveImage "c:\"
    4. End Sub
    5.  
    6. Private Sub Form_Load()
    7. Dim test As Long
    8. Dim mySID As Long
    9. Set myc = New INTELLEXAPILib.NTLXRemoteAx
    10. Dim someDateAndTime As Date
    11. Dim myDate As Date
    12. someDateAndTime = #8/13/2004 12:14:00 PM#
    13. myDate = #7/19/2006 1:14:00 PM#
    14. NtlxImage1.auth = "\10.1.1.108\Administrator\1234"
    15. NtlxImage1.Camera = 1
    16. NtlxImage1.Port = 5001
    17. NtlxImage1.unit = "10.1.1.108"
    18. NtlxImage1.Height = 480
    19. NtlxImage1.Width = 640
    20. NtlxImage1.resolution = NIR_AUTO
    21. NtlxImage1.Display
    22. mySID = myc.Connect("10.1.1.108", "5001", NtlxImage1.auth)
    23. 'myc.GetAlarmList mySID, 0, someDateAndTime, myDate, "c:\test.log"
    24. 'myc.GetUnitInfo mySID
    25. myc.GetUnitInfo (mySID)
    26. End Sub
    27. Public Sub myc_OnGetUnitInfoEvent(ByVal lSessionID As Long, ByVal eReason As eStatusReason, ByVal pIUnitInfo As INTLXUnitInfo)
    28.    MsgBox lSessionID
    29. End Sub
    30.  
    31. Private Sub Timer1_Timer()
    32. NtlxImage1.Display
    33. 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);
    Attached Files Attached Files

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width