Solved

How to Raise Event Using ActiveX Exe, DCOM

Posted on 2004-10-13
2
251 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
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
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…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

895 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now