Solved

How to Raise Event Using ActiveX Exe, DCOM

Posted on 2004-10-13
2
261 Views
Last Modified: 2013-12-26
This is my client code that connects to an ActiveX exe. How do I catch an event the Server Active EXE raises? If I register the server at development time I can do the line Private WithEvents MyServer as RSComServer.clsComserver, but I connect to the server at run time. I used Clireg32 and I can talk to the server when I have both dev env up I can step through and see my client connect to the server, but it won't raise the event.

Any Ideas???

'************************************CODE**********************
Option Explicit

'**Private WithEvents MyServer As RSComServer.clsComServer
'**Private MyObj As RSComServer.clsComConnect
Private Const ServerName = "Computer2"
Dim MyVal As String
Dim SendToId As Integer
Dim MyObj As Object
'Dim MyServer As Object
Private WithEvents MyServer As ????

Private Sub cmdSend_Click()
SendToId = MyServer.GetProcessID("Client1")     'Get The Process ID
Call MyServer.TxData(SendToId, txtSend.Text)
End Sub

Private Sub Form_Load()
Set MyObj = CreateObject("RSComServer.clsComConnect", ServerName)
Set MyServer = CreateObject("RSComServer.clsComServer", ServerName)

'Set MyObj = New RSComServer.clsComConnect
Set MyServer = MyObj.RegProgName("Client2")
End Sub

Private Sub MyServer_RxData()
MyVal = MyServer.RxData
txtRxMsg.Text = MyVal
End Sub

0
Comment
Question by:really24
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 26

Accepted Solution

by:
EDDYKT earned 250 total points
ID: 12310226
0
 
LVL 14

Assisted Solution

by:Shiju Sasidharan
Shiju Sasidharan earned 250 total points
ID: 12366552
Hi

R u sure ? in the class RSComServer.clsComServer u have called
         RaiseEvent Rx_Data
  if so check whether this statement lacks control
Why dont u try to raise event from RSComServer.clsComServer repeatedly to transfer data from the class clsComServer to Client application.


;-)
Shiju

0

Featured Post

Enroll in June's Course of the Month

June's Course of the Month is now available! Every 10 seconds, a consumer gets hit with ransomware. Refresh your knowledge of ransomware best practices by enrolling in this month's complimentary course for Premium Members, Team Accounts, and Qualified Experts.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction While answering a recent question (http://www.experts-exchange.com/Q_27402310.html) in the VB classic zone, I wrote some VB code in the (Office) VBA environment, rather than fire up my older PC.  I didn't post completely correct code o…
You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…

726 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question