pobwest
asked on
dialogs
I have written this program in Borland TPW 1.5, and i keep getting application errors. please help, the file is stock.res is available by emailing me(i don't think you can upload files).
program Stock_exchange;
{$R STOCK.res}
uses WinTypes, WinProcs, WObjects, wincrt;
type
PTestDialog = ^TTestDialog;
TTestDialog = object(TDialog)
procedure butt(var Msg: TMessage); virtual id_First + 159 ;
end;
type
PMyWindow=^TMyWindow;
TMyWindow=object(TWindow)
constructor Init(AParent: PWindowsObject; Atitle: PChar);
procedure players(var msg:tmessage); virtual cm_first + 51;
end;
TMyApplication = object(TApplication)
procedure InitMainWindow;virtual;
end;
var MyApp:TMyApplication;
constructor TMyWindow.Init(AParent: PWindowsObject; Atitle: PChar);
begin
TWindow.Init(AParent, Atitle);
attr.menu :=loadmenu(hinstance, pchar(100));
end;
procedure ttestdialog.butt(var msg: tmessage);
var TextItem: PChar;
begin
getdlgitemtext(getdlgitem( hwindow,15 1),151,tex titem,20);
end;
procedure TMyWindow.Players(var Msg: tmessage);
begin
Application^.ExecDialog(Ne w(PTestDia log, Init(@Self, 'DIALOG_1')));
end;
procedure TMyApplication.InitMainWin dow;
begin
MainWindow:=New(PMyWindow, Init(nil,'Menus'));
end;
begin
myapp.init('Video');
myapp.run;
myapp.done;
end.
please help!
Please use POBWEST@YAHOO.COM (as i can't read mail from the stated one in the profile for the next week)
program Stock_exchange;
{$R STOCK.res}
uses WinTypes, WinProcs, WObjects, wincrt;
type
PTestDialog = ^TTestDialog;
TTestDialog = object(TDialog)
procedure butt(var Msg: TMessage); virtual id_First + 159 ;
end;
type
PMyWindow=^TMyWindow;
TMyWindow=object(TWindow)
constructor Init(AParent: PWindowsObject; Atitle: PChar);
procedure players(var msg:tmessage); virtual cm_first + 51;
end;
TMyApplication = object(TApplication)
procedure InitMainWindow;virtual;
end;
var MyApp:TMyApplication;
constructor TMyWindow.Init(AParent: PWindowsObject; Atitle: PChar);
begin
TWindow.Init(AParent, Atitle);
attr.menu :=loadmenu(hinstance, pchar(100));
end;
procedure ttestdialog.butt(var msg: tmessage);
var TextItem: PChar;
begin
getdlgitemtext(getdlgitem(
end;
procedure TMyWindow.Players(var Msg: tmessage);
begin
Application^.ExecDialog(Ne
end;
procedure TMyApplication.InitMainWin
begin
MainWindow:=New(PMyWindow,
end;
begin
myapp.init('Video');
myapp.run;
myapp.done;
end.
please help!
Please use POBWEST@YAHOO.COM (as i can't read mail from the stated one in the profile for the next week)
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
That the one!
I changed the procedure to this
procedure ttestdialog.butt(var msg: tmessage);
var TextItem:array[0..20] of char;
a:integer;
begin
getdlgitemtext(hwindow,201 ,textitem, 20);
writeln('Returned Value :',a);
writeln('Text recived :',textitem);
end;
and it seems to have done the trick
I changed the procedure to this
procedure ttestdialog.butt(var msg: tmessage);
var TextItem:array[0..20] of char;
a:integer;
begin
getdlgitemtext(hwindow,201
writeln('Returned Value :',a);
writeln('Text recived :',textitem);
end;
and it seems to have done the trick
joe@hw.cz