What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Skype & Technology » Tech Talk » [VB] Runtime loading dll

[VB] Runtime loading dll
Author: Message:
J-Thread
Full Member
***

Avatar

Posts: 467
Reputation: 8
– / Male / –
Joined: Jul 2004
O.P. RE: [VB] Runtime loading dll
YEAH! I got it. Not with loadlibrary (that's only for unmanged dll's), but like this:
code:
Dim hDLL As System.Reflection.Assembly
Dim hTyp As Type
Dim hMod As System.Reflection.MethodInfo
Dim obj As Object

hDLL = System.Reflection.Assembly.LoadFrom("MyVB.dll")   ' dll in Application.StartupPath or use full path
hTyp = hDLL.GetType("MyVB.MyVB")    ' Full class name ;)
obj = Activator.CreateInstance(hTyp)

' The class is active ... now let's call its methods

hMod = hTyp.GetMethod("MyFunc")
Dim args(0) As Object     ' Matching number of parameters
args(0) = 1
Msgbox("Returned value : " & hMod.Invoke(obj, args))

Read the whole thread about it here

I'm wondering why it's so hard to find this...
08-19-2004 09:44 AM
Profile E-Mail PM Find Quote Report
« Next Oldest Return to Top Next Newest »

Messages In This Thread
[VB] Runtime loading dll - by J-Thread on 08-17-2004 at 01:03 PM
RE: [VB] Runtime loading dll - by RaceProUK on 08-17-2004 at 09:47 PM
RE: [VB] Runtime loading dll - by J-Thread on 08-18-2004 at 08:06 AM
RE: [VB] Runtime loading dll - by RaceProUK on 08-18-2004 at 08:48 AM
RE: [VB] Runtime loading dll - by J-Thread on 08-18-2004 at 08:53 AM
RE: [VB] Runtime loading dll - by RaceProUK on 08-18-2004 at 10:18 AM
RE: [VB] Runtime loading dll - by J-Thread on 08-18-2004 at 08:03 PM
RE: [VB] Runtime loading dll - by J-Thread on 08-19-2004 at 09:44 AM


Threaded Mode | Linear Mode
View a Printable Version
Send this Thread to a Friend
Subscribe | Add to Favorites
Rate This Thread:

Forum Jump:

Forum Rules:
You cannot post new threads
You cannot post replies
You cannot post attachments
You can edit your posts
HTML is Off
myCode is On
Smilies are On
[img] Code is On