Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Class module query

Status
Not open for further replies.

mogura

Programmer
Sep 6, 2003
22
GB
I have a client application named MyClientApp that contains a class module named MyClass. MyClass contains a callback method named MyCallback. On the corporate network, there is a COM component named MyServerCOM that contains a method named CallMyCallback.

MyServerCOM contains a method named MyInitializer. After Myintializer has been called by MyClientApp, CallMyCallback will be called Myinitializer. CallMyCallback will call the MyCallback method of MyClientApp that is running on the client computer.

To call Myinitializer in MyServerCOM, MyClientApp creates an object variable for MyServerCOM named oServerCOM. I want to add the procedure in MyClientApp application that calls MyServerCOM.Myinitializer. Should the code be as follows:

Public oMyClass As MyClass
Set oMyClass = New MyClass
oServerCOM.Myinitializer (oMyClass)

Or is that wrong?
 
Ok, no pointers are available in VB6, so you will need to point the MyServerCOM to the executing proces of MyClass to be able to supply the callback functionality.

You must use the adressOf operator, but somehow this only works with modules and not with the class that you referenced.

There is lot's of info available: take a look at


for a nice example

or


for an ok backgrounder

The gap between theory and practice is not as wide in theory as it is in practice.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top