Using Application framework, but having main form in another Library DLL

Our application we have now has it's main form in a library file (DLL) along with the majority of other forms in the app. It is like this because of the system we implemented for a plug-in loader and such, so we have the EXE used as kind of a bootloader that loads resources from the app's main DLL and executes those. However, the application framework seems to only let you specify a main form from the exe. It doesn't let you use the applicationstartup event at all to instanciate the main form. What can I do about this I'd really like to use the new app framework's events in the loader app along with the splash screen system.   

Answer this question

Using Application framework, but having main form in another Library DLL

  • asim.iqbal

    Would it be acceptable for you to create a new class in the executable's assembly that inherits from the form that you want to create and set that as the startup object



    Public
    Class Class1
       
    Inherits ClassLibrary2.Form1

    End Class

     


    Best regards,
    Johan Stenberg



  • OoLee

    I think you guys missed my point... we already do that to start with, we have a completed application that has splash, and all that other stuff. we are looking at how to convert it to .NET 2.0 when the time comes, and were trying to see if the application framework could be used instead of a sub main   
  • rr_dot_net

    however, that is not the problem I am refering too.. if you enable the application framework in the project settings window, you can no longer specify a sub main or another object other then a form to be the startup object, and it must be a local object, not one instanciated through a seperate library, which I would need. I'm not saying I cant do what I want without the framework, just would be nice to have the application framework   
  • Daniel Bertinshaw

    Ideaaaahhhh yes!!!  I understand your delima...

  • Shahid Mahmood

    Use "Sub Main" as your entry point for the exe and call the referenced forms from there:

    Module MyModule

    Public Sub Main
        Dim f as new MyDllForm
        Application.run(f)
    end Sub

    end module

  • dreadjr

       another sample:

        Dim f as new MyDllForm
        Dim MySPlash as new DLLSpalshForm
        MySplash.Show()
        f.showDialog

  • Insignia

    you know, that just might work
  • Mike Walker

    Blue:  When the time comes you can infact use the 05 upgrade wizard to upgrade your project...Then use the app framework to set which form is the splash screen as well as what object is the startup object....going that route though your startup object must be in your startup project...You can still set the startup object to Sub Main in 05 ...

    Hope that helps

  • Using Application framework, but having main form in another Library DLL