| TIP: Click on subject to list as thread! | ANSI |
| echo: | |
|---|---|
| to: | |
| from: | |
| date: | |
| subject: | Why does this code not create an ob |
Hello !
Why does the following code (tdbObjOrigThread.Run is called from
StartThread, that is started by tread 1 using DosStartThread) not start an
object window?
All that happens is the return of PMERR_NO_MSG_QUEUE, but MessageQ is not
null (which it should be, when no message queue is started up..)
Can anyone shed some light onto this (to me) dark matter, please? (Ok, it
is pascal, but it is an almost-direct translation of page 610 of "The
art of OS/2 programming by Panov/Salomon/Panov)
procedure StartThread(p: PThread);
begin
p^.running := true;
p^.run;
p^.running := false;
end;
FUNCTION ObjWinProc(Win:HWND;Msg:LONGWORD;
para1,para2:POINTER):LONGWORD;CDECL;
begin
case Msg of
WM_CREATE:
BEGIN
END;
END;
ObjWinProc := false;
end;
procedure TDBObjOrigThread.Run;
var
aHabanchor: HAB;
MessageQ: HMQ;
Msg: QMSG;
HWindow: HWND;
u: ulong;
begin
aHabanchor := WinInitialize(0);
MessageQ := WinCreateMsgQueue(aHabanchor,0);
if WinRegisterClass(ahabanchor,'MyObjWin',{at}ObjWinProc,0,4) then
begin
HWindow := WinCreateWindow(HWND_OBJECT,'MyObjWin','',
0,0,0,0,0,0,HWND_TOP,0,nil,nil);
u := wingetlasterror(ahabanchor); <--- returned value = PMERR_NO_MSG_QUEUE
while WinGetMsg(ahabanchor,Msg,0,0,0) do
WinDispatchMsg(ahabanchor,Msg);
end;
WinDestroyMsgQueue(MessageQ);
WinTerminate(aHabanchor);
end;
Bye, Erik!
[TeamOS/2 NL]
preferred personal reactions through e-mail
[internet: ErikH{at}hcc-gron.idn.nl]
--- FleetStreet 1.14 NR
* Origin: ORIGINal messages, I like them (2:500/19.1929)SEEN-BY: 50/99 78/0 270/101 620/243 711/401 409 410 413 430 808 809 934 955 SEEN-BY: 712/407 515 517 628 713/888 800/1 7877/2809 @PATH: 500/19 9 28/777 2/777 396/1 270/101 712/515 711/808 809 934 |
|
| SOURCE: echomail via fidonet.ozzmosis.com | |
Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.