Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Registering a dll programatically
Message
De
28/02/2008 20:55:40
 
 
À
28/02/2008 08:46:31
Stan Vaninger
Mitek Industries, Inc
Missouri, États-Unis
Information générale
Forum:
ASP.NET
Catégorie:
Controls activeX
Versions des environnements
Environment:
VB 8.0
OS:
Vista
Network:
Windows 2003 Server
Database:
MS SQL Server
Divers
Thread ID:
01297340
Message ID:
01297647
Vues:
25
Are you just talking about being able to load a DLL or instantiate a class via Reflection? If so, it's easy:
string DLLName = "MyDLL.dll";
string ClassName = "MyDll.MyClass";
System.Reflection.Assembly oDLL;
object oClass;

// This "loads" the .DLL
oDLL = System.Reflection.Assembly.LoadFrom(DLLName);

// This creates the class instance
oClass = oDLL.CreateInstance(ClassName, true);
And if you need to pass parameters
// Create an object array to pass your parameters
object [] args = new object[1];
args[0] = MyKey;
oForm = (Form)oDLL.CreateInstance(classname, true, System.Reflection.BindingFlags.CreateInstance, null, args, null, null);
~~Bonnie


>I am working on a dll written in VB.NET that calls another dll written in C++.NET. They are part of a large system comprised of several apps written in VFP, C++, C#, and VB that all must talk to each other.
>
>The C++ dll is registered in my VB.NET dll. When my VB.NET dll trys to call the C++ dll and can't find it, it crashes. I would like to be able to check for the existence of the C++ dll first and if found, then programatically register it in my VB.NET dll.
>
>How is this done? Any suggestions on how to deal with this situtation would be greatly appreciated.
>
>Thanks in advance
>Stan
Bonnie Berent DeWitt
NET/C# MVP since 2003

http://geek-goddess-bonnie.blogspot.com
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform