Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to show / showdialog form thru a string
Message
De
18/07/2004 10:45:26
 
 
À
18/07/2004 10:14:27
Information générale
Forum:
ASP.NET
Catégorie:
Autre
Divers
Thread ID:
00907643
Message ID:
00925571
Vues:
17
Winan,

>The above codes run correctly for showing a form via string, but it DOES NOT working If I want to show a form that located in the other DLL or not in the same solution / project file

Your project needs to have either a reference to the other project/DLL or the .DLL name needs to be fully qualified as to where the file is located. Your code that you've shown below, looks a bit different than the sample I posted, but I assume that your Activator object is created elsewhere and that is supposed to be the loaded .DLL, correct?

In other words, when I have Form2 in the same project, all I need is this:
string DLLName = "ClassLibrary1.dll";
string ClassName = "ClassLibrary1.Form2";
But, if it's in a different project and I don't want to add a reference to that project, then I can fully qualify the .DLL name to get the same results:
string DLLName = "C:\\DotNetApps\\TestIt\\ClassLibrary1\\bin\\Debug\\ClassLibrary1.dll";
string ClassName = "ClassLibrary1.Form2";
~~Bonnie

>Hi Bonnie,
>What I have done is to run below codes:
>
>Function GetFormByName(Byval pAppProd as String, ByVal pFormName As String) As Form
> Dim FullName As String = pAppProd & "." & pFormName
> Return Activator.CreateInstance(Type.GetType(FullName, True, True))
>End Function
>
>The above codes run correctly for showing a form via string, but it DOES NOT working If I want to show a form that located in the other DLL or not in the same solution / project file, I am facing with below error message:
>
>An unhandled exception of type 'System.TypeLoadException' occurred in NetAdmin.exe
>
>Additional information: Could not load type PlugIn2._1101001 from assembly NetAdmin, Version=1.0.1660.37972, Culture=neutral, PublicKeyToken=null.
>
>any idea? .. many thanks in advance ..
>
>Regards
>Winanjaya
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