COM API: Events

steve clark
steve clark Member Posts: 3,591 ✭✭✭
edited November 2024 in English Forum

Has anyone used the events:  PanelOpened(Panel : Object)  and  PanelClosed(Panel : Object) ?

i'm getting an error (which usually indicated different number/type of parameters

QLinks, Bibl2, LLR, Macros
Dell Insp 17-5748, i5, 1.7 GHz, 8G RAM, win 8.1

Comments

  • JimTowler
    JimTowler Member Posts: 1,383 ✭✭✭

    Has anyone used the events

    YES. (Works fine in Microsoft Visual Basic 2010 Express)

    Somewhere you need to "connect" your sub routine to the actual event in question. In VB 2010 and related, you say that it handles something.

    So, the key lines in VB are something like:

    Private launcher As LogosLauncher
    Private WithEvents app As LogosApplication

    launcher = New LogosLauncher
    app = launcher.Application

    Private Sub app_PanelClosed(ByVal rawPanel As Object) Handles app.PanelClosed
       Dim panel As LogosPanel = CType(rawPanel, LogosPanel)
       ' *** BACKGROUND THREAD EVENT PROCESSING **
       ' ... Do SOMETHING USEFUL HERE ...
    End Sub

  • steve clark
    steve clark Member Posts: 3,591 ✭✭✭

    JimT said:

    Private Sub app_PanelClosed(ByVal rawPanel As Object)

    ahhh, thanks Jim! it was the ByVal, knew it had to do with the parameters. Got several of the API item figured out, still a few to go.

    image

     

    Thanks a bunch !

    QLinks, Bibl2, LLR, Macros
    Dell Insp 17-5748, i5, 1.7 GHz, 8G RAM, win 8.1