1. EuCOM 2.08 + WinXP Pro SP3
- Posted by Rad Nov 27, 2009
- 4078 views
Hi,
Is anybody using Euphoria with WinXP PRO SP3... specifically SP3?
And worked with Eu v3.1 + win32lib v0.70.19 + EuCom 2.08 on it?
I have the following scenario at my place....
Till 3 weeks back, I had WinXP PRO SP2 + Eu v3.1 + Win32lib v.70.19 + EuCom v2.08 on my laptop working fine for last 4 years, when WinXP files got corrupt and I had to reinstall WinXP (with sony pre-install recovery cd) going back to year 2005 stage.
As I had to anyway get the latest updates for SP2, I decided to slipstream SP3 from my original i386 folder using RyanVM Integrator update packs and nLite. Everything went accordingly, and I could create an iso image which I installed on a VritualbOx instance/machine. I also installed all required Euphoria and other applications for my project.
Everything worked fine including IDE, untill I executed my main project which uses EuCom 2.08 for accessing third party ActiveX controls.
Now, the ActiveX control (present in c:\windows\system32 folder) Regiatration process fails with 0 (zero) as return code, which was working before the reinstall.
I tried using regsvr32 for registering same controls and they Displayed "DllRegiterServer in [control-name] succeeded" message. Also, my application setup installer program also deosn't generate any error while registering these controls.
Thinking that it could be SP3, I tried to execute same project on physical machine (with SP2), but getting the same result. I regenerated the wrapper using Tbrowse.exw, tried under both SP2 and SP3 environment, without any success.
But the sgrid.ocx provided with EuCom demo works just fine, I can register/unregister it using the same code in my program.
Also, the original demo program which was provided with third party ActiveX controls also works fine.
Following is the code -
atom RSVR32 -- add various ocx names and their corresponding ids from respective ew files -- to following 2 sequences ocxnm1 = {"OneWayX.ocx", "OneWaySerialX.ocx"} ocxnm2 = {OneWay_clsid_ix, OneWaySerial_clsid_ix} -- RSVR32 = 0 ------------------------------------------------------------------- -- Window SynInit -- Info Window global constant SynInit = createEx( Window, "Syndicate Setup", 0, 0, 0, 220, 64, {WS_BORDER, WS_CLIPSIBLINGS}, {WS_EX_DLGMODALFRAME} ), LTextInit = createEx( CText, "Setting up File....", SynInit, 4, 4, 204, 24, 0, 0 ) setVisible( SynInit, w32False ) ---------------------------------------------------------------------------- -- -- register and open ocx -- global function reg_ocx(sequence regnm, atom clsid_ix) RSVR32 = create_com_object( clsid_ix ) -- Try to register ocx if it didn't create properly if not RSVR32 then setText(SynInit, appName & " OCX Setup") setText(LTextInit, "Registering " & regnm & " ...") openWindow(SynInit, Normal) setVisible(SynInit, w32True) RSVR32 = open_dll( regnm ) RSVR32 = define_c_proc( RSVR32, "DllRegisterServer", {} ) c_proc( RSVR32, {} ) RSVR32 = create_com_object( clsid_ix ) sleep(2) setVisible(SynInit, w32False) closeWindow(SynInit) else -- void = message_box("Already Registered!", regnm & " Msg", MB_ICONINFORMATION) return RSVR32 end if if not RSVR32 then void = message_box(sprintf("Registration error : %d", {RSVR32}), regnm & " Msg", MB_ICONERROR) abort(1) else -- void = message_box("Registered successfully!", regnm & " Msg", MB_ICONINFORMATION) end if return RSVR32 end function -- -- unregister ocx -- global procedure unreg_ocx(sequence regnm, atom clsid_ix) RSVR32 = create_com_object( clsid_ix ) -- Try to unregister already registered ocx if RSVR32 then setText(SynInit, appName & " OCX Setup") setText(LTextInit, "Unregistering " & regnm & " ...") openWindow(SynInit, Normal) setVisible(SynInit, w32True) RSVR32 = open_dll( regnm ) RSVR32 = define_c_proc( RSVR32, "DllUnregisterServer", {} ) c_proc( RSVR32, {} ) RSVR32 = create_com_object( clsid_ix ) sleep(2) setVisible(SynInit, w32False) closeWindow(SynInit) else -- void = message_box("NOT Registered yet!", regnm & " Msg", MB_ICONINFORMATION) return end if if not RSVR32 then void = message_box(sprintf("Unregistration error : %d",{RSVR32}), regnm & " Msg", MB_ICONERROR) abort(1) else -- void = message_box("Unregistered successfully!", regnm & " Msg", MB_ICONINFORMATION) end if end procedure
Any help is appreciated.
Thanks & Regards,
Rad.
2. Re: EuCOM 2.08 + WinXP Pro SP3
- Posted by Rad Dec 14, 2009
- 3874 views
Hi,
Anybody with any suggestions?
Looks like some file is missing from Windows or Euphoria which is required for EuCom to run properly. I have re-installed Windows XP Pro SP2 with latest updates as well as entire Euphoria setup from backup, yet I am encountering registration error code 0 while registering my ocx control.
Thanks & Regards,
Rad.
4. Re: EuCOM 2.08 + WinXP Pro SP3
- Posted by mattlewis (admin) Dec 15, 2009
- 3813 views
Everything worked fine including IDE, untill I executed my main project which uses EuCom 2.08 for accessing third party ActiveX controls.
Now, the ActiveX control (present in c:\windows\system32 folder) Regiatration process fails with 0 (zero) as return code, which was working before the reinstall.
I tried using regsvr32 for registering same controls and they Displayed "DllRegiterServer in [control-name] succeeded" message. Also, my application setup installer program also deosn't generate any error while registering these controls.
Sorry, haven't had enough time lately for euphoria. I'm not sure why this would happen. Try adding com_err_out(1) to your program to see if there is some additional information output to the console when you try to create the object. I suspect that there's something this object is doing that SP3 has shut down.
Have you asked the source of the ActiveX object about potential SP3 issues?
Matt
5. Re: EuCOM 2.08 + WinXP Pro SP3
- Posted by Rad Dec 16, 2009
- 3756 views
Have you asked the source of the ActiveX object about potential SP3 issues?
Matt
Hi Matt,
The original test program provided with the activex control works fine with both
WinXP Pro SP2 and SP3 on my machine, and as expected the author confirmed the same.
At present I am back to WinXP Pro SP2 with latest updates (almost all).
I used com_err_out(1) and got the following display:
CoCreateInstance Error: 80040154
80040154: Unknown error
CoCreateInstance Error: 80040112
80040112: Unknown error
When I tried to register it again, I got:
CoCreateInstance Error: 80040112
80040112: Unknown error
CoCreateInstance Error: 80040112
80040112: Unknown error
I have this EMSA Register Dll Tool from the web, which displays the current
registration status (Yes/No) of specified Dll/Ocx file and allows to register/unregister
the same. I tried registering/unregistering my control with this utility and it
worked fine. Using this utility, I unregistered my ocx.
The registration status was set to "No".
And then executed my program.
My program got aborted with return code 0 (zero).
I went back to EMSA utility, and found that the ocx was in fact had got registered.
The registration status was "Yes".
But somehow the EuCOM return code is always coming back as zero.
Also, even after externally registering the ocx, the procedure mentioned
in the first post does not detect the existing registration and tries to register
the same ocx, giving the zero return code.
Because now I have a reinstalled WinXP, may be it is some missing windows
file which EuCOM requires? Can you please list the windows files that EuCOM
requires to run properly?
Thanks & Regards,
Rad.
6. Re: EuCOM 2.08 + WinXP Pro SP3
- Posted by mattlewis (admin) Dec 16, 2009
- 3780 views
I used com_err_out(1) and got the following display:
CoCreateInstance Error: 80040154 80040154: Unknown error CoCreateInstance Error: 80040112 80040112: Unknown error
When I tried to register it again, I got:
CoCreateInstance Error: 80040112 80040112: Unknown error CoCreateInstance Error: 80040112 80040112: Unknown errorBecause now I have a reinstalled WinXP, may be it is some missing windows
file which EuCOM requires? Can you please list the windows files that EuCOM
requires to run properly?
EuCOM doesn't use anything special itself. The 80040154 error is COM telling you that it's not registered. The 80040112 error is CLASS_E_NOTLICENSED. So I'd guess that it's looking for some license key in your registry, or possibly some license server. I don't know how it's doing the verification. Maybe reinstalling (however the vendor does it) will fix the licensing issue?
Matt
Matt
7. Re: EuCOM 2.08 + WinXP Pro SP3
- Posted by Rad Dec 21, 2009
- 3760 views
EuCOM doesn't use anything special itself. The 80040154 error is COM telling you that it's not registered. The 80040112 error is CLASS_E_NOTLICENSED. So I'd guess that it's looking for some license key in your registry, or possibly some license server. I don't know how it's doing the verification. Maybe reinstalling (however the vendor does it) will fix the licensing issue?
Matt
Hi Matt,
As I will be distributing only ocx file with my application, I hadn't installed the ocx application on my machine, as it won't be on my client's machine.
After installing the ocx application and including its base folder in the PATH, EuCOM started to recognize ocx as registered. (The ocx was registered by the ocx application while installing it in the base folder.)
The difference between the ocx base folder and the folder where I have copied ocx file for my application, is one .lic file with ocx name.
I unregistered the ocx externally, and keeping the path same as ocx base folder with .lic file, tried to register it through my application using EuCOM. But got the same error status 0.
Again, I registered the ocx externally, and this time EuCOM picked up the registration correctly.
I put up the same Q for the ocx developer and got the following answer:
-------------------
It seems like it can't find the .lic file. Normally you need to have the corresponding .lic file present in the same directory as the .ocx in order to use it in a design environment (but not in a runtime environment).
When ocx is installed, the .lic file is in the same directory where the .ocx file is, but if you move it and register it somewhere else, the .lic file must be copied there too.
Microsoft's idea is that it provides a simple license protection for ActiveX controls, because normally the .lic file won't be distributed along with the ocx, as it's not required in a runtime environment. That means users can't just use the copy of the control which is distributed with some other application in their own applications.
Looks like there is an issue with this .lic file as indicated by code 80040112.
I have the .lic file in the required folder, but still EuCOM comes back with 0 status code.
How does EuCOM handle .lic file?
Thanks & Regards,
Rad.
8. Re: EuCOM 2.08 + WinXP Pro SP3
- Posted by mattlewis (admin) Dec 30, 2009
- 3497 views
Looks like there is an issue with this .lic file as indicated by code 80040112.
I have the .lic file in the required folder, but still EuCOM comes back with 0 status code.
How does EuCOM handle .lic file?
I've never encountered something like this, but according to this:
After calling the CoGetClassObject function to get an IClassFactory interface pointer to the class object, call the CreateInstance method of this interface to create a new uninitialized object.
Following the links, it looks like rather than using the normal CoCreateInstance way of creating an instance of a COM object (which is how EuCOM works), you need to call the CoGetClassOjbect function to get the IClassFactory and IClassFactory2 interfaces to create the object using the appropriate license information.
Once you do that, you should use EuCOM's ref_com_object() function to use the control like a normal control. This seems like something that should be somehow included with EuCOM, but I'm not able to write the wrappers since I don't have a licensed ActiveX control.
Matt
9. Re: EuCOM 2.08 + WinXP Pro SP3
- Posted by Rad Jan 04, 2010
- 3281 views
Hi Matt,
I had put up a query with ocx developer regarding a dummy activex control for testing purpose and got the following reply:
I suggest that you rather use the trial version of the .ocx,
which you can download from my site. The only difference from the registered
version is that it has a random popup message every few function calls.
The activex control download site is http://www.atma-software.com
The application file name is 1Way and size is around 1 MB.
Thanks & Regards,
Rad.
10. Re: EuCOM 2.08 + WinXP Pro SP3
- Posted by Rad Jan 12, 2010
- 3068 views
Hi Matt,
Any progress on the issue?
Thanks & Regards, Rad.
11. Re: EuCOM 2.08 + WinXP Pro SP3
- Posted by mattlewis (admin) Jan 16, 2010
- 2928 views
Any progress on the issue?
No, sorry, haven't had much time for euphoria lately. Have you tried doing anything with those functions I mentioned before?
Matt
12. Re: EuCOM 2.08 + WinXP Pro SP3
- Posted by Rad Jan 20, 2010
- 2743 views
- Last edited Jan 23, 2010
Hi Matt,
Sorry but I am not much good at systems programming.
I had a look at eucom.ew, but couldn't make out of it much.
CoGetClassObject has already been defined but not used:
CoGetClassObject = define_c_func( ole32, "CoGetClassObject",\\ { C_POINTER, C_INT, C_POINTER, C_POINTER, C_POINTER }, C_LONG),
In function create_com_object:
mset = w32new_memset() ppv = w32acquire_mem( mset, 4 ) rclsid = w32acquire_mem( mset, clsid_table[CLSID_BYTES][clsid_ix] ) riid = w32acquire_mem( mset, iid_table[IID_BYTES][1] ) ok = c_func( CoCreateInstance, { rclsid, 0 , 5, riid, ppv } ) if not ok then obj_ix = ref_com_object( clsid_ix, peek4u(ppv) ) else err:print_com_error( sprintf( "CoCreateInstance Error: %x\n",ok)) err:com_error( ok ) obj_ix = 0 end if
I assume CoGetClassObject will be called before CoCreateInstance.
Now CoGetClassObject has the following parameters:
Syntax C
HRESULT CoGetClassObject(
_in REFCLSID rclsid,
_in DWORD dwClsContext,
_in_opt COSERVERINFO pServerInfo,
_in REFIID riid,
_out LPVOID *ppv
);
How to provide dwClsContext?
dwClsContext [in]
The context in which the executable code is to be run.
To enable a remote activation, include CLSCTX_REMOTE_SERVER.
For more information on the context values and their use,
see the CLSCTX enumeration.
How to provide riid which is supposed to be IID_IClassFactory2:
riid [in] Reference to the identifier of the interface, which will be supplied in
ppv on successful return. This interface will be used to communicate with
the class object. Typically this value is IID_IClassFactory,
although other values – such as IID_IClassFactory2 which supports
a form of licensing – are allowed.
All OLE-defined interface IIDs are defined in the OLE header files as
IID_interfacename, where interfacename is the name of the interface.
Then do I call CoCreateInstance with the *ppv value returned by CoGetClassObject?
And afterwords use ref_com_object function providing the same *ppv?
How to go about it?
Thanks & Regards,
Rad.
13. Re: EuCOM 2.08 + WinXP Pro SP3
- Posted by Rad Jan 24, 2010
- 2592 views
Hi,
Post edited to display entire text as double underscore was truncating the post midway.
Regards, Rad.
14. Re: EuCOM 2.08 + WinXP Pro SP3
- Posted by Rad Feb 01, 2010
- 2331 views
Hi,
Anybody with any suggestions?
Thanks & Regards, Rad.
15. Re: EuCOM 2.08 + WinXP Pro SP3
- Posted by Rad Feb 17, 2010
- 1842 views
Hi,
Please can anybody guide me regarding incorporating relevant EuCOM functions in the existing code?
Thanks & Regards, Rad.
16. Re: EuCOM 2.08 + WinXP Pro SP3
- Posted by mattlewis (admin) Feb 18, 2010
- 1824 views
Please can anybody guide me regarding incorporating relevant EuCOM functions in the existing code?
Sorry, I started to see if I could whip something up for you, but got stuck when I was trying to read typelib info using tbrowse (I don't really have a 3.1 environment anymore, and it's having fits working with 4.0 and my include path, apparently). Here's what I did so far, following what I mentioned previously:
constant CoGetClassObject = define_c_func( ole32, "CoGetClassObject", {C_POINTER, C_INT, C_POINTER, C_POINTER, C_POINTER }) global constant CLSCTX_INPROC_SERVER = #1, CLSCTX_INPROC_HANDLER = #2, CLSCTX_LOCAL_SERVER = #4, CLSCTX_INPROC_SERVER16 = #8, CLSCTX_REMOTE_SERVER = #10, CLSCTX_INPROC_HANDLER16 = #20, CLSCTX_RESERVED1 = #40, CLSCTX_RESERVED2 = #80, CLSCTX_RESERVED3 = #100, CLSCTX_RESERVED4 = #200, CLSCTX_NO_CODE_DOWNLOAD = #400, CLSCTX_RESERVED5 = #800, CLSCTX_NO_CUSTOM_MARSHAL = #1000, CLSCTX_ENABLE_CODE_DOWNLOAD = #2000, CLSCTX_NO_FAILURE_LOG = #4000, CLSCTX_DISABLE_AAA = #8000, CLSCTX_ENABLE_AAA = #10000, CLSCTX_FROM_DEFAULT_CONTEXT = #20000, CLSCTX_ACTIVATE_32_BIT_SERVER = #40000, CLSCTX_ACTIVATE_64_BIT_SERVER = #80000, CLSCTX_ENABLE_CLOAKING = #100000, CLSCTX_PS_DLL = #80000000 function get_class_object( integer clsid_ix, atom dwClsContext, atom pServerInfo, integer iid ) atom mset, ppv, rclsid, riid, ok atom pclass mset = w32new_memset() ppv = w32acquire_mem( mset, 4 ) rclsid = w32acquire_mem( mset, clsid_table[CLSID_BYTES][clsid_ix] ) riid = w32acquire_mem( mset, iid_table[IID_BYTES][iid] ) ok = c_func( CoGetClassObject, { rclsid, dwClsContext, pServerInfo, riid, ppv }) if ok then err:print_com_error( sprintf( "CoGetclassOjbect Error: %x\n",ok)) err:com_error( ok ) pclass = 0 else pclass = peek4u( ppv ) end if w32release_mem( mset ) return pclass end function
The get_class_object() function is obviously just a start. I needed to get the details on the IClassInfo and IClassInfo2 (or whatever they are...) interfaces before I could proceed with actually creating the object using the registration data.
Matt
17. Re: EuCOM 2.08 + WinXP Pro SP3
- Posted by mattlewis (admin) Feb 19, 2010
- 1789 views
Hi,
Please can anybody guide me regarding incorporating relevant EuCOM functions in the existing code?
OK, this code is completely untested, but I think it does what you need.
include std/dll.e include eucom.ew include w32support.e constant CoGetClassObject = define_c_func( ole32, "CoGetClassObject", {C_POINTER, C_INT, C_POINTER, C_POINTER, C_POINTER }) global constant CLSCTX_INPROC_SERVER = #1, CLSCTX_INPROC_HANDLER = #2, CLSCTX_LOCAL_SERVER = #4, CLSCTX_INPROC_SERVER16 = #8, CLSCTX_REMOTE_SERVER = #10, CLSCTX_INPROC_HANDLER16 = #20, CLSCTX_RESERVED1 = #40, CLSCTX_RESERVED2 = #80, CLSCTX_RESERVED3 = #100, CLSCTX_RESERVED4 = #200, CLSCTX_NO_CODE_DOWNLOAD = #400, CLSCTX_RESERVED5 = #800, CLSCTX_NO_CUSTOM_MARSHAL = #1000, CLSCTX_ENABLE_CODE_DOWNLOAD = #2000, CLSCTX_NO_FAILURE_LOG = #4000, CLSCTX_DISABLE_AAA = #8000, CLSCTX_ENABLE_AAA = #10000, CLSCTX_FROM_DEFAULT_CONTEXT = #20000, CLSCTX_ACTIVATE_32_BIT_SERVER = #40000, CLSCTX_ACTIVATE_64_BIT_SERVER = #80000, CLSCTX_ENABLE_CLOAKING = #100000, CLSCTX_PS_DLL = #80000000 constant IClassFactory_clsid = "00000001-0000-0000-C000-000000000046", IClassFactory_clsid_ix = add_clsid( IClassFactory ), IClassFactory_CreateInstance = 3, IClassFactory_LockServer = 4, IClassFactory2_clsid = "B196B28F-BAB4-101A-B69C-00AA00341D07", IClassFactory2_clsid_ix = add_clsid( IClassFactory2_clsid ), IClassFactory2_GetLicInfo = 5, IClassFactory2_RequestLicKey = 6, IClassFactory2_CreateInstanceLic = 7 function get_class_object( integer clsid_ix, atom dwClsContext, atom pServerInfo, integer iid ) atom mset, ppv, rclsid, riid, ok atom pclass mset = w32new_memset() ppv = w32acquire_mem( mset, 4 ) rclsid = w32acquire_mem( mset, clsid_table[CLSID_BYTES][clsid_ix] ) riid = w32acquire_mem( mset, iid_table[IID_BYTES][iid] ) ok = c_func( CoGetClassObject, { rclsid, dwClsContext, pServerInfo, riid, ppv }) if ok then err:print_com_error( sprintf( "CoGetclassOjbect Error: %x\n",ok)) err:com_error( ok ) pclass = 0 else pclass = peek4u( ppv ) end if w32release_mem( mset ) return pclass end function global function create_licensed_object( integer clsid_ix, atom dwClsContext, atom pServerInfo ) atom cf2, bstr_p, bstr, ok, riid integer id cf2 = get_class_object( clsid, dwClsContext, pServerInfo, IClassFactory2_clsid_ix ) if not cf2 then return 0 end if mset = w32new_memset() bstr_p = w32acquire_mem( mset, 4 ) ok = call_interface_ptr( cf2, peek4u( cf2), IClassFactory2_RequestLicKey, { 0, bstr_p }) if ok then err:com_error( ok ) w32release_mem( mset ) return 0 end if bstr = peek4u( bstr_p ) riid = w32acquire_mem( 16 ) poke( riid, IUnknown_bytes ) ppv = w32acquire_mem( 4 ) ok = call_interface_ptr( cf2, peek4u( cf2 ), IClassFactory2_CreateInstanceLic, {0, 0, riid, bstr, ppv}) ppv = peek4u( ppv ) free_bstr( bstr ) w32release_mem( mset ) if ok then id = 0 err:com_error( ok ) else id = ref_com_object( clsid_ix, ppv ) end if return id end function
Matt
18. Re: EuCOM 2.08 + WinXP Pro SP3
- Posted by Rad Feb 19, 2010
- 1799 views
Thanks Matt.
I will test it out and get back.
Regards,
Rad.