|
-
Jun 26th, 2007, 08:07 AM
#1
Thread Starter
Hyperactive Member
[2005] Loading Pluggins/DLL files, DirectCast
I want to make a pluggable architecture for my media player, and Im not sure about how to load the DLL files...
How do I load a dll and assign it to a variable I have heard of something like "LoadAssembly"????
I know that once I load all the DLL files in my plugin directory I can use DirectCast in a try catch to check if the DLL file is of the type I want. Is it ok to use DirectCast like this (After I figure out loading the DLLs)...
Code:
Sub LoadDLLs
Dim lstDLL as list of player 'Player is an interface that the DLL file I want should implement, Can I use an interface like this too?
For each DLL file in pluggin directory 'Sudo code
dim obj as object= loadplugin(DLL.path) '"LoadPlugin? How do i do this
try
Dim playa as new player = DirectCast(obj, player)
lstDLL.add(playa)
catch e as exception
'No need to do nothing for a dLL that isnt what I want
end try
End Sub
Any help would be appreciated heaps, I can only find one source of info for this and although it is simple it just isnt up to begginer introduction standards (well in the descriptive meaning) It just doesnt explain enough, So I thaught I would try and build my understanding from the ground up starting with loading the assemblies...
Please help, there just isnt enough info on this...
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|