Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Initialize a Single ActiveForm in a Multiple ActiveForms OCX

6 views
Skip to first unread message

abir...@gmail.com

unread,
Aug 11, 2008, 11:49:57 AM8/11/08
to
Hi

I have 2 ActiveForms in a single OCX. they share the same typelib.
each one of them is implementing different behavior, but for easier
deployment and maintenance i want them to be stored in one file
(ocx) .
lets say one is accessing the database, the other one not.
i want to access only one of them at a time from within the IE html
object code, each time using a different classid.

the problem is that the delphi code generated by the wizard is placing
2 initialization blocks, one in each impl unit, which runs both when
the browser loads the OCX, no matter if i just use only one classid
and not the other.

i want to be able to use one OCX for both Active Forms, but when i use
it from the browser i want to be able to call or instantiate only one
of them, while the active form for the second should not be created.
so if i use the second (without the database) the first one (with the
database) wont try to access the database.
the html of course is displaying only the requested activeform, but
the ActiveFormFactory is run for both, thus creating both forms. that
what i want to avoid.

i guess this need some modification at the level of the initialization
block, but i don't know what is the best approach for that.

0 new messages