Results 1 to 3 of 3

Thread: Show form that located in the other DLL

  1. #1

    Thread Starter
    Fanatic Member
    Join Date
    Nov 2003
    Posts
    784

    Show form that located in the other DLL

    Dear The Expert,

    How to show form that located in the other DLL? . eg. my application needs to show form named "invoice" from the other DLL? .. pls help .. many thanks in advance

    Regards
    Winanjaya

  2. #2
    Addicted Member
    Join Date
    Apr 2004
    Location
    Lagos, Nigeria
    Posts
    215
    Hello, I think all you need do is make reference to the dll, create object of type invoice, then display it. Something like:
    VB Code:
    1. Imports DLLNamespace
    2.  
    3. Private Sub ShowImportedForm()
    4.     Dim fInvoice As DLLNamespace.Invoice
    5.    
    6.     fInvoice = New DLLNamespace.Invoice()
    7.     fInvoice.Show()
    8.  
    9. End Sub

  3. #3

    Thread Starter
    Fanatic Member
    Join Date
    Nov 2003
    Posts
    784
    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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width