Board index » delphi » ActiveX without registering

ActiveX without registering


2006-11-22 11:41:31 PM
delphi198
Is there a way I can use an ActiveX ocx file that I have imported without
having to have it registered?
The users of my program have a need to run my program and will not have the
ability to install anything.
I was using MSDE but switched to Firebird and successfully replaced the
database stuff, but I have one last piece to resolve. My app will use
TWebBrowser to display a file that requires an activex plugin. (happens to
be iPix image).
I could probably use the ActiveX directly and skip the browser bit if I
could just make calls into it without having to have it registered.
Anybody have any suggestions? Thanks.
 
 

Re:ActiveX without registering

Quote
Anybody have any suggestions? Thanks.
Find a VCL component that does the same as the ActiveX and use that.
Oliver Townshend
 

Re:ActiveX without registering

Quote
Is there a way I can use an ActiveX ocx file that I have imported without
having to have it registered?
You can't
 

Re:ActiveX without registering

mtiede writes:
Quote
Is there a way I can use an ActiveX ocx file that I have imported without
having to have it registered?

The users of my program have a need to run my program and will not have the
ability to install anything.

I was using MSDE but switched to Firebird and successfully replaced the
database stuff, but I have one last piece to resolve. My app will use
TWebBrowser to display a file that requires an activex plugin. (happens to
be iPix image).

I could probably use the ActiveX directly and skip the browser bit if I
could just make calls into it without having to have it registered.

Anybody have any suggestions? Thanks.
I am not sure if this will work, but you could try a very ugly trick and
call DllGetClassObject for the ocx directly after loading it. The MSDN
documentation says you shouldn't, but theoretically it could work.
HTH,
Patrick
 

Re:ActiveX without registering

Of course - registry free COM
(msdn.microsoft.com/msdnmag/issues/05/04/RegFreeCOM/default.aspx).
You just need to modify your app's manifest file appropriately (this has
nothing to do with .Net) to tell COM where you want some particular COM
objects to come from.
Or you can just directly call DllGetClassObject etc COM functions exported
by the COM dll the way COM system itself does it.
Dmitry Streblechenko (MVP)
www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool
"mtiede" <XXXX@XXXXX.COM>writes
Quote
Is there a way I can use an ActiveX ocx file that I have imported without
having to have it registered?

The users of my program have a need to run my program and will not have
the ability to install anything.

I was using MSDE but switched to Firebird and successfully replaced the
database stuff, but I have one last piece to resolve. My app will use
TWebBrowser to display a file that requires an activex plugin. (happens
to be iPix image).

I could probably use the ActiveX directly and skip the browser bit if I
could just make calls into it without having to have it registered.

Anybody have any suggestions? Thanks.

 

Re:ActiveX without registering

The ActiveX does not have anything else that will do what it does. (happens
to be iPix images activex control)
"Oliver Townshend" <oliveratzipdotcomdotau>writes
Quote
>Anybody have any suggestions? Thanks.

Find a VCL component that does the same as the ActiveX and use that.

Oliver Townshend

 

Re:ActiveX without registering

Dmitry,
Thanks, that sounds very promising. I will take a look.
"Dmitry Streblechenko" <XXXX@XXXXX.COM>writes
Quote
Of course - registry free COM
(msdn.microsoft.com/msdnmag/issues/05/04/RegFreeCOM/default.aspx).
You just need to modify your app's manifest file appropriately (this has
nothing to do with .Net) to tell COM where you want some particular COM
objects to come from.
Or you can just directly call DllGetClassObject etc COM functions exported
by the COM dll the way COM system itself does it.

Dmitry Streblechenko (MVP)
www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool

"mtiede" <XXXX@XXXXX.COM>writes
news:45646f9e$XXXX@XXXXX.COM...
>Is there a way I can use an ActiveX ocx file that I have imported without
>having to have it registered?
>
>The users of my program have a need to run my program and will not have
>the ability to install anything.
>
>I was using MSDE but switched to Firebird and successfully replaced the
>database stuff, but I have one last piece to resolve. My app will use
>TWebBrowser to display a file that requires an activex plugin. (happens
>to be iPix image).
>
>I could probably use the ActiveX directly and skip the browser bit if I
>could just make calls into it without having to have it registered.
>
>Anybody have any suggestions? Thanks.
>


 

Re:ActiveX without registering

I was successfully able to create a manifest for my program and dynamically
call my activex (TOleControl) without it being registered. All was fine
until I closed the application. Then it goes through Tapplication.Destroy
that does this:
if FPopupControlWnd <>0 then
Classes.DeallocateHWnd(FPopupControlWnd);
This causes an access violation.
I'm guessing the handle is invalid, but don't know why or what to do about
it.
I tried a few things. I tried to just put the instance of the object on the
form at design time. I tried to create the instance at runtime. I tried to
do a CreateParented. I tried creating it with no owner. Nothing I have tried
so far has been successful.
Here is the manifest file:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
<file name="ipixx.ocx">
<comClass description="IpixX ActiveX Control module"
clsid="{11260943-421B-11D0-8EAC-0000C07D88CF}"
progid="IPIXXLib.IpixX"
threadingModel="apartment" />
</file></assembly>
What am I missing?
Delphi version: Delphi 2005
 

Re:ActiveX without registering

Quote
The ActiveX does not have anything else that will do what it does.
(happens to be iPix images activex control)
Ah I see. An ActiveX control which is licensed, and only sold by one group.
So there isn't a VCL Control for it.
Oliver Townshend
 

Re:ActiveX without registering

Okay, 2 more odd points.
1. If I just add a webbrowser object to the form, it doesn't blow up on exit
anymore.
I thought it might be the units that were sucked in, but if I delete the
webbrowser object, the error reoccurs. (perhaps the smart linker is linking
out whatever it was bringing in from those units anyway)
2. If I run it on anyone else's machine, it doesn't blow up.
I am worried that if I give it to customers, it WILL blow up for them
like it did for me because I don't know what is causing the blowup on my
machine.
I suspect that Delphi 2005 has put its debugger into the system and
perhaps that is causing it to catch some sort of error that isn't normally
caught, but I don't really believe that since others using Delphi 7 and its
debugger don't have problems running the program.
Any ideas anyone?
 

Re:ActiveX without registering

mtiede writes:
Quote
"Dmitry Streblechenko" <XXXX@XXXXX.COM>writes
news:XXXX@XXXXX.COM...
>Of course - registry free COM
>(msdn.microsoft.com/msdnmag/issues/05/04/RegFreeCOM/default.aspx).
Dmitry,

Thanks, that sounds very promising. I will take a look.


Quoted:
"Windows XP introduces a new COM activation model called registration-free
COM, or Reg-Free COM for short. "
So, no XP, no fun with this solution.
HTH,
Patrick
 

Re:ActiveX without registering

If you need to use the COM object in question directly in your code, nothing
prevents you from doing what COM itself does - call DllGetClassObject
function exported by the COM dll, etc.
Dmitry Streblechenko (MVP)
www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool
"Patrick Kursawe" <XXXX@XXXXX.COM>writes
Quote
mtiede writes:
>"Dmitry Streblechenko" <XXXX@XXXXX.COM>writes
>news:XXXX@XXXXX.COM...
>>Of course - registry free COM
>>(msdn.microsoft.com/msdnmag/issues/05/04/RegFreeCOM/default.aspx).

>Dmitry,
>
>Thanks, that sounds very promising. I will take a look.
>
>

Quoted:
"Windows XP introduces a new COM activation model called registration-free
COM, or Reg-Free COM for short. "

So, no XP, no fun with this solution.

HTH,

Patrick