Passing ActiveX control as a parrameter to ActiveX.dll 
Author Message
 Passing ActiveX control as a parrameter to ActiveX.dll

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 Excells 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



Mon, 19 Jul 2004 16:23:27 GMT  
 Passing ActiveX control as a parrameter to ActiveX.dll
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

Quote:
>-----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

>.



Mon, 19 Jul 2004 19:51:57 GMT  
 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

>>.

>.



Tue, 20 Jul 2004 15:17:40 GMT  
 Passing ActiveX control as a parrameter to ActiveX.dll
Sorry, I don't see a possibility with VB.

Quote:
>-----Original Message-----
>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

>>-----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

>>>.

>>.

>.



Tue, 20 Jul 2004 17:20:06 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. ActiveX.exe or ActiveX DLL or ActiveX Control?????????????

2. ActiveX DLL, ActiveX EXE & ActiveX OCX version

3. ActiveX DLL, ActiveX EXE & ActiveX OCX version

4. Building ActiveX controls that will access activex.dll running on PWS

5. Passing Controls To ActiveX Dll's

6. ActiveX dll vs ActiveX control - Whats the difference

7. Can ActiveX DLL component contain ActiveX control?

8. .ASP - ActiveX Help, Cant pass ActiveX vairables

9. Passing a control object to ActiveX control?

10. ActiveX Control Container for VBCCE5 ActiveX Controls!?

11. Problem in VBA with ActiveX control that contains another ActiveX control

12. HOW TO: Pass Form/Control Objects to ActiveX Control

 

 
Powered by phpBB® Forum Software