display splash screen in c++/cli RRS feed

  • Question

  • In order to display a splash screen and then launching the main application I'd like to migrate following c# code to c++/cli code. Could someone help me?

    namespace MyFormSplashTEST
        static class Program
            static void Main()
                Thread splashThread = new Thread(newSplash);
                Application.Run(new Form1());
            static void newSplash()
                Application.Run(new MAFormSplash.My_SplashForm("param1"));

    It works as I want in C#. But in c++/cli I have some problems.

    Thank you.

    Wednesday, October 16, 2013 4:17 PM


  • It is not clear what problems occurred and why you need to switch this part to C++. Try adjusting the next sample:

    // in ‘main’:
    using namespace System::Threading;
    void newSplash();
    Thread ^ splash_thread = gcnew Thread(gcnew ThreadStart(&newSplash));
    Application::Run(gcnew Form1());
    // after ‘main’:
    void newSplash()
        Application::Run(gcnew SplashForm());

    • Edited by Viorel_MVP Wednesday, October 16, 2013 7:39 PM
    • Marked as answer by dave_MA Thursday, October 17, 2013 8:04 AM
    Wednesday, October 16, 2013 7:39 PM