Click here to Skip to main content
15,891,529 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Greetings,

I am writing a WFA that will communicate / control software from another manufacturer. The mfg. software includes an "ClientEvent.ocx" and documentation that indicates you can use it to connect to their software in order to send commands and receive events. The interface variable in vb can set the mfg. software to either local or remote. The local setting keeps all the events local (mfg. software errors, task completed, etc...), whereas the remote setting should send all events back to the interface (my interface variable in the software).

The ocx resource is added as reference in my project's property (..\Interop.ClientEvent.dll). My program can use all the functions in the library, but it is not receiving the fired events from the mfg.'s software. I am concerned that I do not have my interface variable setup correctly. The mfg s/w reports an error after completing a task in remote mode. It is complaining that it did not receive any response from the client (my program). However, my program does not register an event.

Code snippet:
VB
Option Explicit On

Imports MfgLib

Public Class myProgram

    Public WithEvents m_Interface As New MfgLib.ClientEvent

    Private Sub myProgram_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        Try
           ' mycode
        Catch ex As Exception
            MsgBox(ex.Message, MsgBoxStyle.Critical, "Critical Error")
        End Try

    End Sub

    Private Sub m_Interface_TaskComplete(ByVal status As Integer) Handles m_Interface.TaskComplete
        Try
            ' my code
        Catch ex As Exception
            update_Log(ex.Message, MsgBoxStyle.Critical)
        End Try

    End Sub
end class


Am I declaring 'm_Interface' properly? Are there any tools out there that can watch for events from an ocx?
Posted
Updated 5-Oct-12 5:29am
v4

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900