Board index » cppbuilder » ActiveX accessed in design mode at runtime

ActiveX accessed in design mode at runtime

Why do ActiveX controls imported into a package get accessed in design mode
at runtime? This is the senario:
I TLibImp a control (SocketTools in this case) into a new package and use
this to build an application. Everything works fine on the development
machine but if I run the application on another machine (where the control
is only licensed for runtime) I get a message of the kind 'This control
cannot be used in design mode'. Why should the application access the
control in design mode? I feel its something to do with the workings of
C++Builder packages but I don't know enough about them. It doesn't make any
difference if I build the package as design time only or even build without
runtime packages.

If anyone has suggestions, or even better a solution :-)....

Graham Smith

PS. its BCB3

 

Re:ActiveX accessed in design mode at runtime


Graham, can you try the usual COM functions to create the control and
see if that works on the other machine ?

Alex

Quote
Graham Smith wrote:

[snip]
--
HotSend - portable documents technology
http://www.hotsend.com/
eFax - get your faxes via email - Free !
http://www.efax.com

Re:ActiveX accessed in design mode at runtime


Yes Alex, it fails the same which would imply a problem with the control's
license, other than if I construct a similar test app. in VB6 that works.
I'm waiting on Catalyst to explain how the licensing works.

Thanks, Graham

Alex Bakaev [TeamB] <al...@jetsuite.com> wrote in message
news:37E29074.F8D5D0E9@jetsuite.com...

Quote
> Graham, can you try the usual COM functions to create the control and
> see if that works on the other machine ?

> Alex

> Graham Smith wrote:
> [snip]
> --
> HotSend - portable documents technology
> http://www.hotsend.com/
> eFax - get your faxes via email - Free !
> http://www.efax.com

Re:ActiveX accessed in design mode at runtime


Quote
In article <7s0iku$mt...@forums.borland.com>,  <.> wrote:
>Yes Alex, it fails the same which would imply a problem with the control's
>license, other than if I construct a similar test app. in VB6 that works.
>I'm waiting on Catalyst to explain how the licensing works.

Interesting. What we _should_ be doing is simply calling IClassFactory2;
the control itself should handle the querying for licensing, etc.

It's possible that we're looking for a design-time license when
we shouldn't be. I'd take a look at atlcom.h (if you did import type
library) or activex.pas (if you did an import AX control) to see
what we're passing when we invoke the factory.

--
Caminante, son tus huellas el camino, y nada mas;
caminante, no hay camino, se hace camino al andar ...
Caminante, no hay camino, sino estelas en el mar.

Re:ActiveX accessed in design mode at runtime


Alex, I have the solution! Its TLibImp.exe. I have been using the command line version downloaded from Borland as recommended (V3.0 15/04/98) rather than the IDE version. This does produce cleaner header code but for the SocketTools controls misses out the the following:

class package TPing : public etc, etc.
...
...
// VCL Property Getters/Setters which delagate to OCX
//
// Static variables used by all instances of OCX Proxy
//
...
static WCHAR wLicenseKey[17];  <<<<<< This is missing in the command line version
...
...

Quote
};

Do you have any ideas why this is?
While on the subject of TLibImp do you know why it likes to preface some Property/Method names with _DControlName_  ?

Graham

P.S. I'm certainly not an expert on ActiveX but feel I should know more. Can anyone recommend a good techical book?

Alex Bakaev [TeamB] <al...@jetsuite.com> wrote in message news:37E29074.F8D5D0E9@jetsuite.com...

Quote
> Graham, can you try the usual COM functions to create the control and
> see if that works on the other machine ?

> Alex

> Graham Smith wrote:
> [snip]
> --
> HotSend - portable documents technology
> http://www.hotsend.com/
> eFax - get your faxes via email - Free !
> http://www.efax.com

Re:ActiveX accessed in design mode at runtime


Hi, Graham!

Please don't post in HTML. For people without HTML newsreaders, HTML
renders your post unreadable, and thus they will be unable to help you.
And, of course, the newsgroup guidelines specifically forbid HTML posts.

Thanks!

------
Mark Cashman (TeamB - C++ Builder), creator of The Temp{*word*203}Doorway at
http://www.temporaldoorway.com
- Original digital art, writing, music and more -
C++ Builder / JBuilder Tips and The C++ Builder Programmer's Webring
(Join us!)
http://www.temporaldoorway.com/programming/index.htm
------

Other Threads