Board index » delphi » ActiveForm Initialize and IPersistPropertyBag

ActiveForm Initialize and IPersistPropertyBag


2003-07-28 08:46:08 PM
delphi23
I'm currently experiencing the same problem !
Neither "Initialize" nor "FormCreate" events are fired after the
"IPersistPropertyBag.load" call.
I try to add an event in load implementation to notify the end of the
process and the availability
of the data but i can not proceed here because IE container has not finished
yet to query interface(s)
to the object (especially if the object contains an other activeform !)
Quote
>>>I'm looking for the same synchronisation point ?????
(my current HTML implementation/solution is ... <BODY
onload="MyObject.DoInitialize()">
which is called after IPeristPropertyBag calls and other interfaces
initialization...)
Ben Hay solution breaks/omits the interface object model
(IPersistPropertyBag) but as soon as the object
is feeding by itself (via MSHTML/DOM) no problem should occur....
"Jim Mischel" <XXXX@XXXXX.COM>a écrit dans le message
de news: 3f201e2d$XXXX@XXXXX.COM...
Quote
The main question is: How do I know when all parameters have been
received?

I've created an ActiveForm for use on a Web page. It gets some parameters
from the HTML OBJECT tag. Several of those parameters are required--the
form cannot do its job without them.

Getting the parameters is no problem. But knowing when all parameters are
received--how do I do that? My current method is to have the property set
procedure call a function that checks to see if all parameters have been
received. For example:

procedure Set_Parameter1(const value: WideString);
begin
Parameter1 := value;
CheckAllParams;
end;

And the CheckAllParams procedure fires off a thread to do some processing
after all parameters have been received.

This is clunky, and makes it difficult to display an error if one or more
parameters is missing from the OBJECT tag. I need a way to hook into the
initialization process. I thought OnCreate would do it for me, but the
parameters aren't read by the time OnCreate occurs.

Any ideas?


 
 

Re:ActiveForm Initialize and IPersistPropertyBag

Quote
onload="MyObject.DoInitialize()"
It's not ideal, but it is better than what I have at the moment. I will have
to give this a little more t hought. I wonder if there's some way to
substitute (hook) the ActiveFormControl object at startup.
Jim