Dialog box

Dialog box

Post by Rob C » Fri, 24 Oct 2003 03:04:40



Application
win32

Here is code I copied out of the book, entitled sing a dialog
box as your main window.Everything compiles and links fine,
but when I run it, I get . . .

hread stopped
c:\BC5\Robcpp\step04.exe (my path and exe name)
Fault access violation at 0x45546d: read of address 0xffffffff
First off let me say that I am a beginner at win32 applications,
and dialog boxes especially. The whole problem may be that there
is not a resource file in this project, (I don know how to add
one after I delete the original).

-------------------------------------------------------------
#includ<
#includ<
#includ<

class TMyApp : public TApplication
{
public:
TMyApp( char *title ) : TApplication( title ) {}
void InitMainWindow();
};


void
TMyApp::InitMainWindow()
{
SetMainWindow( new TFrameWindow( 0, "My App",
new TDialog( 0, "DIALOG1"), true ));
}

int
OwlMain( int argc, char *argv[] )
{
return TMyApp( "My App" ).Run();
}
 
 
 

Dialog box

Post by Bruce Salz » Fri, 24 Oct 2003 03:27:02

The TDialog constructor you are using expects to find the dialog definition
in your RC file. To add the file, you can right-click in the project window
and choose 'Add node' (or just press the Ins key). Then just type in your RC
file name.

Regards,
Bruce

 
 
 

Dialog box

Post by Ed Mulroy » Fri, 24 Oct 2003 03:44:56

You are missing one or more files from your project.

Select Project|Open and select the examples\owl\tutorial\steps.ide project
file. It has the correct set of files listed for the project.

. Ed