How does the 'real' developers manage this ?
Hello,
I have an automation server and a client.
In my server, I start my client application and loads a file for that client
as follows :
Procedure Server.StartClient(filename_arg : string);
var
clientobject : IDispatch;
begin
clientobject := CreateComObject(CLASS_Client) as IClient;
clientobject.open(filename_arg);
end;
So far so good.
When the software starts the CreateComObject, it starts the client
application and processes the FormCreate. While this process is starting
up, the server receives a value for the clientobject and starts the second
statement clientobject.open(...).
When the software starts the open(...) method, the previous FormCreate of
the client is in my case not yet finished (e.g. on a slow PC) and has
therefore no Application.MainForm.Handle.
What happens is : because you have no MainForm.Handle, everything you do in
the open(...) method, riscs not to be displayed on the clients MainForm.
My question is : do I have to put a 'wait' between the CreateComObject and
the clientobject.open() or is there another way to fix this ? I suppose
other developers have already encountered such a behaviour...
Thanx for your help,
--
Stefan De Grande
sdg<noSpam>@hemmis.be