Alex-Gamper/VisualAda

WinMain is never called

Lucretia opened this issue · 0 comments

You should create the solution with the -n passed to the binder and the following source.

--------------------------------------------------------------------------------
with WindowsApp1;

package body WinMainStartup is

    ----------------------------------------------------------------------------
    function  WinMain (hInstance : System.Address; hPrevInstance : System.Address; lpCmdLine : System.Address; nCmdShow : Integer ) return Integer is
        procedure adainit;
        pragma Import (C, adainit, "adainit");

        procedure adafinal;
        pragma Import (C, adafinal, "adafinal");

        -- procedure main;
        -- pragma Import(Ada, main, "WindowsApp1");
    begin
        adainit;
        -- main;
        WindowsApp1;
        adafinal;
        return 0;
    end;

end;

Ideally gnat should generate a [w]WinMain on windows.