PDA

Click to See Complete Forum and Search --> : ActiveX Dll & Events & VB6


Balcica
Sep 18th, 2003, 03:28 PM
I tried to make an ActiveX DLL wraper about some ActiveX controls (yes I know it's strange - but I need only some basic functionality provided by those controls).

Question: What is the best way to expose some of the original events from my Active DLL (=in-process server) too?

I first tried the following:

clsClass.cls (clsClass is my wraper class)Public Event OutgoingEvent()frmMain.frm (contains dumyOCX that I want to wrap)
Private Sub dumyOCX_SomeEvent() // event from dumyOCX
RaisEvent OutgoingEvent // compiler error - Event not Found
End SubThe problem is that an event must be raised from within the scope where it is declared (thus from clsClass.cls in our case).

Now..if I declare the event in frmMainPublic Event OutgoingEvent()

Private Sub lanOCX_IncomingCall() // event from dumxOCX
RaisEvent OutgoingEvent // it works...but now the event isn't exposed
// through my wrapper class ... )
End SubWhat is the best way to solve this problem?
Is there maybe any other way to use an ActiveX control, than putting it onto a frame?
If I could write something like this in clsClass.cls:
Private WithEvents XX As dumyOCX
Set XX = New dumyOCXmy problem would probably be solved.

Thanks in advance for every comment and suggestion.