Click here to Skip to main content
Sign Up to vote bad
good
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:
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 5-Oct-12 5:10am
Edited 5-Oct-12 5:29am


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

  Print Answers RSS
Your Filters
Interested
Ignored
     
0 Christian Graus 478
1 Ron Beyer 306
2 Tadit Dash 253
3 samadhan_kshirsagar 229
4 OriginalGriff 198
0 Sergey Alexandrovich Kryukov 7,041
1 Prasad_Kulkarni 3,815
2 OriginalGriff 3,557
3 _Amy 3,372
4 CPallini 3,034


Advertise | Privacy | Mobile
Web01 | 2.6.130619.1 | Last Updated 5 Oct 2012
Copyright © CodeProject, 1999-2013
All Rights Reserved. Terms of Use
Layout: fixed | fluid