
Passing ActiveX control as a parrameter to ActiveX.dll
Hello Josef!
Thanks for your reply.
But I really need to pass ActiveX control as a parameter
to ActiveX.dll, so that my ActiveX.DLL could trap its
events. Actually I need to create universal ActiveX.dll
that could be used from anywhere by anybody. How do you
think is it possible?
Regards
Ilia Mamuakshvili
Tbilisi, Georgia
Quote:
>-----Original Message-----
>Hello,
>first, of all it is in general no good idea to pass gui-
>objects. Let the gui stay where it should be. On the form
>where it belongs too.
>second, VB adds an Extender-Object arround your control,
>to have a support for ".visible" and such things.
>Passing a control to another means, that the control
which
>is referenced inside with the EventSink (WithEvents) is
>different to the control you are passing.
>Regards
>Josef
>>-----Original Message-----
>>Hello everyone!
>>I have created ActiveX.dll project with multiuse class
>>named "CalClass". In Project/components menu I
>>added "Microsoft Calendar control 8.0" component to my
>>project. The code for "CalClass" looks like:
>>Dim WithEvents MyCal As Calendar
>>Public Sub InitMyClass(ByVal PassedMyCal As Object)
>> Set MyCal = PassedMyCal
>>End Sub
>>Private Sub MyCal_Click()
>> MsgBox "MyCal clicked"
>>End Sub
>>In VB IDE I created project group with this project and
>>another test project ( Standart .exe ). In my test
>project
>>on form1 I add same component ("Microsoft Calendar
>control
>>8.0")
>>Dim MyCal As New TestProject.CalClass
>>Private Sub Form_Load()
>> MyCal.InitMyClass Calender1
>>End Sub
>>where "Calender1" is MS Calendar object located on my
>>form. After running my test project my activeX.dll
>project
>>traps click event and this is great. But If I compile
>this
>>ActiveX.dll and add its reference to Excell's VBA IDE
and
>>do there same things calling MyCal.InitMyClass Calender1
>>method fires "Type mismatch" error. Any idea
>> Any help would be greatly appreciated.
>>Ilia Mamukashvili
>>Tbilsi, Georgia
>>.
>.