🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: alt.comp.borland-delphi
1 messages
1 total messages Started by Rob Sun, 04 Apr 2004 14:17
create and show Forms with NMStrmServ component
#593
Author: Rob
Date: Sun, 04 Apr 2004 14:17
59 lines
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.
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads