Solved

How to Raise Event Using ActiveX Exe, DCOM

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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering 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

Title # Comments Views Activity
Put text in a picture ASP.NET C# 2 68
Adding to a VBA? 6 85
MsgBox 4 71
VBA: Insert New column with specific format type 12 55
Article by: Martin
Here are a few simple, working, games that you can use as-is or as the basis for your own games. Tic-Tac-Toe This is one of the simplest of all games.   The game allows for a choice of who goes first and keeps track of the number of wins for…
Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
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…

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