0

为了更好地理解,我正在探索 HLA 教程的示例。我试图组装并运行它,但未能获得输出。在我组装之后,它向我显示了这个错误:

Error in file "001_HelloWorld.hla" at line 87 [errid:39120/hlaparse.bsn]
Parameter list is missing "raiseAdrs" found in fwd/extern definition.
Near: << ) >>

这是示例程序的完整代码:

program helloworld;
#linker( "comdlg32.lib" ) 
#linker( "comctl32.lib" )

?compileAll     := true;

?@NoDisplay     := true;
?@NoStackAlign  := true;

#includeOnce( "stdlib.hhf" )

#includeOnce( "howl.hhf" )


const
    applicationName := "Hello World";
    formX           := w.CW_USEDEFAULT; // Let Windows position this guy
    formY           := w.CW_USEDEFAULT;
    formW           := 600;
    formH           := 600;


static
    align( 4 );
    bkgBrush_g  :dword;
    bkgColor_g  :dword;



// Form declaration.
// We've got an empty form with no widgets, so this is fairly trivial:

wForm( mainAppWindow );
endwForm


// Must include the following macro invocation to emit the code that the
// wForm macro generated:

mainAppWindow_implementation();



// The following gets called immediately after the main application
// window is created. It must be provided, even if it does nothing.

method mainAppWindow_t.onCreate;
begin onCreate;
end onCreate;






/////////////////////////////////////////////////////////////////////////////    //
//
//
// The following is mostly boilerplate code for all apps (about the only thing
// you would change is the size of the main app's form)
//
//
/////////////////////////////////////////////////////////////////////////////    //
//  
// When the main application window closes, we need to terminate the 
// application. This overridden method handles that situation.  Notice the
// override declaration for onClose in the wForm declaration given earlier.
// Without that, mainAppWindow_t would default to using the wVisual_t.onClose
// method (which does nothing). 

method mainAppWindow_t.onClose;
begin onClose;

// Tell the winmain main program that it's time to terminate.
// Note that this message will (ultimately) cause the appTerminate
// procedure to be called.

w.PostQuitMessage( 0 );


end onClose;






// When the application begins execution, the following procedure
// is called.  This procedure must create the main
// application window in order to kick off the execution of the
// GUI application:

procedure appStart;
begin appStart;

push( esi );

// Create the main application window:

w.GetSysColor( w.COLOR_MENU );
mov( eax, bkgColor_g );
w.CreateSolidBrush( eax );
    mov( eax, bkgBrush_g );
    mainAppWindow.create_mainAppWindow
    (
        applicationName,        // Window title
        w.WS_EX_CONTROLPARENT,  // Need this to support TAB control selection
        w.WS_OVERLAPPEDWINDOW,  // Style 
        NULL,                   // No parent window                                     
        formX,                  // x-coordinate for window. 
        formY,                  // y-coordinate for window.
        formW,                  // Width
        formH,                  // Height
        bkgColor_g,             // Background color
        true                    // Make visible on creation 
    );
    mov( esi, pmainAppWindow ); // Save pointer to main window object.
    pop( esi );

end appStart;



// appTerminate-
//
//  Called when the application is quitting, giving the app a chance
// to clean up after itself.
//
// Note that this is called *after* the mainAppWindow_t.onClose method
// executes (indeed, mainAppWindow_t.onClose, by posting the quit message,
// is what actually causes the program to begin terminating, which leads
// to the execution of this procedure).

procedure appTerminate;
begin appTerminate;

// Clean up the main application's form.
// Note that this will recursively clean up all the widgets on the form.

mainAppWindow.destroy();
w.DeleteObject( bkgBrush_g );   

end appTerminate;


// appException-
//
//
// Gives the application the opportunity to clean up before
// aborting when an unhandled exception comes along:

procedure appException( theException:dword in eax );
begin appException;

    raise( eax );

end appException;



// The main program for a HOWL application must simply
// call the HowlMainApp procedure.

begin helloworld;

    HowlMainApp();          

end helloworld;

我尝试了我能解决的问题,但无法解决。

任何帮助将不胜感激,并提前感谢。

4

1 回答 1

1

嗨,我有同样的问题,然后我想出了这个,它工作正常。

(在我的情况下,第 152 行)转到这一行:

procedure appException( theException:dword in eax ); begin appException; raise( eax ); end appException;

使它成为

procedure appException; begin appException; raise( eax ); end appException;

于 2017-05-13T06:26:55.360 回答