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!
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.
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.
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!