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
Solved

How to Raise Event Using ActiveX Exe, DCOM

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

Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

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…
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…
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…

789 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