Solved

How to Raise Event Using ActiveX Exe, DCOM

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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

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 …
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…
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 Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…

747 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

9 Experts available now in Live!

Get 1:1 Help Now