PlanetSquires Forums

Support Forums => Other Software and Code => Topic started by: Pat Dooley on June 10, 2010, 07:40:34 AM

Title: Using non-visual ActiveX without registration
Post by: Pat Dooley on June 10, 2010, 07:40:34 AM
Now that I can use my non-visual ActiveX DLL's on a machine where they are registered with Windows,
I would like to use them on a system without registration.
So, basically, how do I do that?

Using Jose's API files and TypeLib output the following sets up everything for the registered version:

FF_AppStart
#INCLUDE "..\modules\ActiveAddress.inc"
Global AA As ActiveAddressParse
'------------------------------
FORM1_WM_CREATE
' Get a reference
AA = newcom $PROGID_ActiveAddressParse
'Set License info
AA.License_key=UCODE$("blah blah")
'------------------------------------
Thanks!
Title: Re: Using non-visual ActiveX without registration
Post by: Pat Dooley on June 10, 2010, 10:43:49 AM
Browsed Jose's site and found his INet example. So I added ole2utils.inc to FF_AppStart and changed
AA = newcom $PROGID_ActiveAddressParse
to
AA = CreateInstanceFromDll(app.path & "ActiveAddress.dll", $CLSID_ActiveAddressParse, $IID__ActiveAddressParse)
and it worked.
In my second attempt I discovered that the first compile was not using Jose's WinAPI files as I thought, but was using his TypeLib generated include.
No wonder it GPF'd!
So it seems to me that CreatInstanceFromDLL is the key to using non-visual, non-registered ActiveX DLL's.
Title: Re: Using non-visual ActiveX without registration
Post by: José Roca on June 10, 2010, 11:57:04 AM
If your non-visual ActiveX doesn't need a license key, you can also use:


AA = NEWCOM CLSID $CLSID_ActiveAddressParse LIB "app.path & "ActiveAddress.dll""


I did write the CreateInstanceFromDll before PB9 added the ability to use unregistered servers and later I kept it because it also allows to create instances of unregistered licensed servers, something not supported by PB9. It is also used by my OLE container to allow to create instances of unregistered visual ActiveX, licensed or not.
Title: Re: Using non-visual ActiveX without registration
Post by: Pat Dooley on June 10, 2010, 03:16:34 PM
Thank you very much Jose. Yes, that works also. It will now be possible to throw everything in one folder and the uninstall could not get any easier.
Fantastic!