Hi All
Thanks
However, I want to create the vbproject . One vb project (type is windows
application .exe) dynamic call another vbproject (class libary .dll) . while
windows application project do not need add reference "class libary ".
I use VB6 as example:
I create standard exe name "myApp" with the form "frmtest" . In this
frmtest. I create the button name "cmdBtn"
Meanwhile I create activex dll name "classLibs" with the class Name
"myClass". In this myClass. I create the method "HelloWorld".
In Vb6 syntax. I just do the follow :
Private Sub Command1_Click()
Dim O as object
set O = createobject("classLibs.myClass")
O.HelloWorld
End Sub
Now , Both myApp and classLibs is a .net component . I don't need convert
them into activex com. Just want to dynamic call.
How you help me above this ?
Thanks and many thanks
"Herfried K. Wagner [MVP]" <hirf-spam-me-(E-Mail Removed)> ¦b¶l¥ó
news:(E-Mail Removed) ¤¤¼¶¼g...
> "Tom" <(E-Mail Removed)> schrieb:
> > now mypbject.test is create vb.net . How can I dynamic call
> > without use reference method.
>
> \\\
> Private Function CreateClassByName( _
> ByVal PartialAssemblyName As String, _
> ByVal QualifiedClassName As String _
> ) As Object
> Return _
> Activator.CreateInstance( _
> [Assembly].LoadWithPartialName( _
> PartialAssemblyName _
> ).GetType(QualifiedClassName) _
> )
> End Function
> ///
>
> Usage:
>
> \\\
> Dim c As Control = _
> DirectCast( _
> CreateClassByName( _
> "System.Windows.Forms", _
> "System.Windows.Forms.Button" _
> ), _
> Control _
> )
> With c
> .Location = New Point(10, 10)
> .Size = New Size(80, 26)
> .Text = "Hello World"
> End With
> Me.Controls.Add(c)
> ///
>
> --
> Herfried K. Wagner [MVP]
> <URL:http://dotnet.mvps.org/>
>
>
|