event sink isn't called?

S

sparkane

In an A2k db, I have two objects, a session object and a back end
connection manager object. A splash panel instantiates both. First it
instantiates the session object, then the cnn manager. An event sink in
the session object for a cnn mgr event does not run when the cnn mgr
event is raised during the cnn mgr's instantiation. Help?

1) session instantiation
The Session class declares a private cnn mgr object WithEvents, and sets
it to a global cnn mgr object:

Private WithEvents moCnnMgr as cCnnMgr

(In Session Class_Initialize)
Set moCnnMgr = ConnMgr
' ConnMgr: global cCnnMgr variable
' declared: "Public ConnMgr As cCnnMgr"
' at this point not instantiated

2) cnn mgr instantiation
The cnn manager gets settings for connecting to the back end from a
file:

Public Event SettingsReady(ByVal Settings As Variant)

When this succeeds, it raises the SettingsReady event. The settings are
passed in a parameter:

RaiseEvent SettingsReady(msConnSettings)


But this event sink in the session object, already instantiated, does
not run:

Private Sub moCnnMgr_SettingsReady( _
ByVal Settings As Variant)
''
''
On Error GoTo HandleError

MsgBox Settings

ExitProc:
Exit Sub

HandleError:
[error.dosomething]

Resume ExitProc
End Sub

STuff I've tried:
-) using a completely private cnn mgr object in the session rather than
setting its private cnn mgr to a global cnn mgr. Sub event sink still
didn't run.
-) does instantiation matter? Will an object not really raise events
until its instantiated? Will an uninstantiated object not run event
sink routines before it is fully instantiated?

could really use help on this one,
spark
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top