Setting ActiveX properties at development time

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Setting ActiveX properties at development time

drtau-4
In Dolphin, is it possible, at *development* time,  to instantiate an ActiveX (OCX) object,
set some properties for that object, and store it in a class variable.  Then, deploy
an executable that uses that ActiveX object at runtime?  I tried this, but got an error
at runtime.  I assume that there is some connection established between the
Dolphin object and the ActiveX object that is broken when the image is stripped
and deployed.  If this is the problem, is there a way to re-establish that connection
when the executable is started?  Thanks.


Reply | Threaded
Open this post in threaded view
|

Re: Setting ActiveX properties at development time

Blair McGlashan
"drtau" <[hidden email]> wrote in message
news:[hidden email]...
> In Dolphin, is it possible, at *development* time,  to instantiate an
ActiveX (OCX) object,
> set some properties for that object, and store it in a class variable.
Then, deploy
> an executable that uses that ActiveX object at runtime?  I tried this, but
got an error
> at runtime.  I assume that there is some connection established between
the
> Dolphin object and the ActiveX object that is broken when the image is
stripped
> and deployed.  If this is the problem, is there a way to re-establish that
connection
> when the executable is started?  Thanks.

You'll probably need to serialize the control's state so that it is
restored. If it is a visual object, you can use the AXControlSite to do this
automatically. If it isn't you can use the controls implementation of
IPersistStream to write and restore its state to an IStream.

Regards

Blair


Reply | Threaded
Open this post in threaded view
|

Re: Setting ActiveX properties at development time

drtau-4
Blair, your suggestion worked!!  You are amazing!! :-)  Thanks again.

Blair McGlashan wrote:

> "drtau" <[hidden email]> wrote in message
> news:[hidden email]...
> > In Dolphin, is it possible, at *development* time,  to instantiate an
> ActiveX (OCX) object,
> > set some properties for that object, and store it in a class variable.
> Then, deploy
> > an executable that uses that ActiveX object at runtime?  I tried this, but
> got an error
> > at runtime.  I assume that there is some connection established between
> the
> > Dolphin object and the ActiveX object that is broken when the image is
> stripped
> > and deployed.  If this is the problem, is there a way to re-establish that
> connection
> > when the executable is started?  Thanks.
>
> You'll probably need to serialize the control's state so that it is
> restored. If it is a visual object, you can use the AXControlSite to do this
> automatically. If it isn't you can use the controls implementation of
> IPersistStream to write and restore its state to an IStream.
>
> Regards
>
> Blair