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)frmMain.frm (contains dumyOCX that I want to wrap)Code:Public Event OutgoingEvent()The problem is that an event must be raised from within the scope where it is declared (thus from clsClass.cls in our case).Code:Private Sub dumyOCX_SomeEvent() // event from dumyOCX RaisEvent OutgoingEvent // compiler error - Event not Found End Sub
Now..if I declare the event in frmMainWhat is the best way to solve this problem?Code:Public 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 Sub
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:my problem would probably be solved.Code:Private WithEvents XX As dumyOCX Set XX = New dumyOCX
Thanks in advance for every comment and suggestion.




Reply With Quote