Article View: alt.comp.borland-delphi
Article #593create and show Forms with NMStrmServ component
From: Rob
Date: Sun, 04 Apr 2004 14:17
Date: Sun, 04 Apr 2004 14:17
59 lines
3235 bytes
3235 bytes
Hello,
Quite stuck with the following...
I try to create a form after a message is delivered by the NMStrmServ
component. like :
procedure TfrmServer.NMStrmServ1MSG(Sender: TComponent;
const sFrom: String; strm: TStream);
begin
If sFrom='newsgroup' then CreateForm;
end;
procedure TfrmServer.CreateForm;
Begin
frmSelectForm.ShowForm;
End;
frmSelectForm is a form with a Tlist and every item in a list has an Object
with a Form.
(I don't put the code to select the proper Object from the list etc..)
procedure TfrmSelectForm.ShowForm(ItemIndex: Integer);
Begin
If MyForm=NIL Then
Begin
Application.CreateForm(TFormClass(TfrmCardImage), MyForm);
MyForm.Show;
//Also not work..
//MyForm:=TfrmCardImage.Create(FOwner);
//MyForm.Parent:=Application.MainForm;
MyForm.Show;
End;
The form is not shown on the screen and when I leave the application it
gives me a win32 error.
It has something to do that the application is not creating the form in the
right way. Don't bother with the list, object in the list, etc, because this
works fine.
If a Visual component on the frmSelectForm, like a button, is doing the job,
the MyForm is OK and shown on screen when an user clicks on the button.
I can do this also with the NMStrmServ and calling a procedure that doing a
postmessage to the button like : PostMessage(btnPostButton.Handle,
cn_Command, bn_Clicked, 0);
In the buttonclick event of btnPostButton I create the form and everything
is OK again.
So, only when the event of the NMStrmServ is calling the create/show form
procedure the form will not show on screen. I'v tried to set the Parent,
Owner and things, but can not find the right way.
HELP!!!!!!!!
Greets,
Rob.
Technical Details
Message-ID:
<QNUbc.57100$s9.51414@amsnews02.chello.com>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!news.glorb.com!ecngs!feeder.ecngs.de!newsfeed.kabelfoon.nl!news2.euro.net!amsnews01.chello.com!amsnews04.chello.com!amsnews02.chello.com.POSTED!53ab2750!not-for-mailShow Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 1114ad,9fc11cb88bd7b4a0,start X-Google-Attributes: gid1114ad,public X-Google-Thread: fd817,9fc11cb88bd7b4a0,start X-Google-Attributes: gidfd817,public X-Google-Thread: f894d,9fc11cb88bd7b4a0,start X-Google-Attributes: gidf894d,public X-Google-Thread: 10545b,9fc11cb88bd7b4a0,start X-Google-Attributes: gid10545b,public X-Google-Thread: 105ac8,9fc11cb88bd7b4a0,start X-Google-Attributes: gid105ac8,public X-Google-ArrivalTime: 2004-04-04 07:18:11 PST Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!news.glorb.com!ecngs!feeder.ecngs.de!newsfeed.kabelfoon.nl!news2.euro.net!amsnews01.chello.com!amsnews04.chello.com!amsnews02.chello.com.POSTED!53ab2750!not-for-mail From: "Rob" <iemand@microsoft.com> Newsgroups: alt.comp.borland-delphi,alt.comp.lang.borland-delphi,borland.public.delphi,borland.public.delphi.ide,borland.public.delphi.vcl Subject: create and show Forms with NMStrmServ component Lines: 61 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2800.1158 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165 Message-ID: <QNUbc.57100$s9.51414@amsnews02.chello.com> Date: Sun, 04 Apr 2004 14:17:20 GMT NNTP-Posting-Host: 80.57.207.74 X-Complaints-To: abuse@chello.nl X-Trace: amsnews02.chello.com 1081088240 80.57.207.74 (Sun, 04 Apr 2004 15:17:20 WEST) NNTP-Posting-Date: Sun, 04 Apr 2004 15:17:20 WEST Organization: chello broadband