Board index » cppbuilder » Dialog box

Dialog box


2003-10-23 02:04:40 AM
cppbuilder109
Application
win32
Here is code I copied out of the book, entitled “using a dialog
box as your main window.?Everything compiles and links fine,
but when I run it, I get . . .
“Thread 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’t know how to add
one after I delete the original).
-------------------------------------------------------------
#include <owl\applicat.h>
#include <owl\framewin.h>
#include <owl\dialog.h>
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();
}
 
 

Re:Dialog box

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
 

Re:Dialog box

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
Quote
Rob C wrote in message
news:3f96c6b8$ XXXX@XXXXX.COM ...
 

{smallsort}