communication with classmodules 
Author Message
 communication with classmodules

Hi there

Please help me out with a problem, I'm desperate and just can't find the
solution. I think I just do something wrong to communicate with the class
module, but see yourself.

First the code sniplet:

-----------------------------
[class module "TWS_CLASS"]
Public WithEvents myTWS as TWSLib.TWS     ' TWSLib.TWS is the class of an
activex-component (*.ocx)

Private Sub Class_Initialize()
Set myTWS = New TWSLib.TWS
End Sub

Private Sub myTWS_connectionClosed()
Debug.Print "conn close"
End Sub

[Module "TWS"]
Private TWS3 As TWS_Class

Sub TestingTWS()
Set TWS3 = New TWS_Class
TWS3.myTWS.Connect "", 7496, 1
TWS3.myTWS.disconnect
End Sub
---------------------------------------

Now, the problem is, if I start the Sub (TestingTWS), it does connect to the
com-component, but the events are not being handled.

I apreciate any help, as I really couldn't get any further and I think it
shouldn't be such a problem.

Viktor



Tue, 03 May 2005 04:08:42 GMT  
 communication with classmodules

purchase, read and love the VBA Developer's Handbook from Sybex at
Amazon.


like this:

Quote:
>Hi there

>Please help me out with a problem, I'm desperate and just can't find the
>solution. I think I just do something wrong to communicate with the class
>module, but see yourself.

>First the code sniplet:

>-----------------------------
>[class module "TWS_CLASS"]
>Public WithEvents myTWS as TWSLib.TWS     ' TWSLib.TWS is the class of an
>activex-component (*.ocx)

>Private Sub Class_Initialize()
>Set myTWS = New TWSLib.TWS
>End Sub

>Private Sub myTWS_connectionClosed()
>Debug.Print "conn close"
>End Sub

>[Module "TWS"]
>Private TWS3 As TWS_Class

>Sub TestingTWS()
>Set TWS3 = New TWS_Class
>TWS3.myTWS.Connect "", 7496, 1
>TWS3.myTWS.disconnect
>End Sub
>---------------------------------------

>Now, the problem is, if I start the Sub (TestingTWS), it does connect to the
>com-component, but the events are not being handled.

>I apreciate any help, as I really couldn't get any further and I think it
>shouldn't be such a problem.

>Viktor

Steve Hudson -- Word Heretic, Sydney, Australia
{*filter*} teacher, trainer, tutor, writer, developer

Word MVP FAQs: http://www.*-*-*.com/
You agree by writing to me personally that any material can be reused publicly unless you explicitly disclaim it. (For List and blog use.)


Wed, 18 May 2005 03:06:24 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Transfering classmodules into a code library.

2. Is it possible to create a classmodule from scratch with VBA

3. Problems to create a classmodule from an own addin

4. Just a little question VB and Classmodules

5. Calling a function in a Classmodule

6. ClassModule comparison operator

7. Question regarding multi-use classmodule.

8. calling function in one classmodule from another?

9. Winsock inside a classmodule

10. Just a little question VB and Classmodules

11. How to: Referens back to TextBox control placed on a ActiveX from a ClassModule - PLEASE HELP

12. Global Constants in ClassModule??

 

 
Powered by phpBB® Forum Software