create and show Forms with NMStrmServ component
Posted on 2004-04-05
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);
If sFrom='Person' then frmSelectForm.ShowForm;
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..)
If MyForm=NIL Then
//Also not work..
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. Maybe the server component is in a Thread.
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.