1. ActiveX Controls (ocx) in win32lib
- Posted by Rad <radhx at rediffm??l.com> Aug 21, 2007
- 558 views
Aren't ActiveX controls supported in win32lib? There is very little help on it. I was using a third party software for Software Registration which was previously distributed as dll. Now the latest version has been released as ActiveX Control .ocx file. Is there any way I can accommodate ActiveX with win32lib? I have to register/unregister the ocx file and access functions/properties in my application. Regards, Rad.
2. Re: ActiveX Controls (ocx) in win32lib
- Posted by Bernie Ryan <xotron at bluefr?g.?om> Aug 21, 2007
- 532 views
Rad wrote: > > Aren't ActiveX controls supported in win32lib? > There is very little help on it. > > I was using a third party software for Software Registration which was > previously > distributed as dll. > Now the latest version has been released as ActiveX Control .ocx file. > > Is there any way I can accommodate ActiveX with win32lib? > I have to register/unregister the ocx file and access functions/properties in > my application. > > Regards, > Rad. Rad: Have you looked at Matt's EUCOM ? Bernie My files in archive: WMOTOR, XMOTOR, W32ENGIN, MIXEDLIB, EU_ENGIN, WIN32ERU, WIN32API Can be downloaded here: http://www.rapideuphoria.com/cgi-bin/asearch.exu?dos=on&win=on&lnx=on&gen=on&keywords=bernie+ryan
3. Re: ActiveX Controls (ocx) in win32lib
- Posted by Rad <radhx at rediffm?i?.com> Aug 22, 2007
- 584 views
Hi Bernie / Matt, Thanks Bernie, for suggesting EuCOM. Downloaded EuCom version 2.07. I am having difficulties calling a function from ocx with a "string" input parameter and boolean return value. This is a non-visible control. I used TBrowse utility to get Eu Wrapper for this ocx which defines the method:
global constant OneWay_clsid = "2BF78C6C-FB88-4F6C-87AB-C6E7F4CE6575", OneWay_clsid_ix = add_clsid( OneWay_clsid) , OneWay_disp = add_iid( OneWay_clsid_ix, IDispatch), OneWay_IQuickActivate_ix = add_iid( OneWay_clsid_ix, IQuickActivate ), OneWay_IPersistStreamInit_ix = add_iid( OneWay_clsid_ix, IPersistStreamInit ), OneWay_IConnectionPointContainer_ix = add_iid( OneWay_clsid_ix, IConnectionPointContainer ) --methods -- disp methods for OneWay global constant OneWay_m_GetData = 213 -- Returns: VT_BOOL -- AppID VT_BSTR [IN] --properties -- disp properties for OneWay global constant OneWay_p_AppDaysLeft = 202, -- Property: VT_I4 OneWay_p_AppStatus = 201, -- Property: TxAppStatus OneWay_p_HardWareID = 203 -- Property: VT_BSTR
I assume that GetData method accepts an input parameter of type string. (The ocx documentation says it should be a string of length greater than or equal to 15, it will return True or False and set up some other properties accordingly) I an trying to call this method as follows:
atom OW6, pBstr object void, OW6Result sequence OW6AppId -- 123456789|12345 OW6AppId = "TestRegistrationUtility" OW6 = create_com_object( OneWay_clsid_ix ) if not OW6 then void = open_dll("OneWayX.ocx") void = define_c_proc( void, "DllRegisterServer", {}) c_proc( void, {}) OW6 = create_com_object( OneWay_clsid_ix ) end if if not OW6 then void = message_box("Create Error for OneWayX.ocx!", "msg", MB_ICONINFORMATION) return end if temp_seq = query_interface( OW6, OneWay_disp ) void = message_box("Query GetData = " & iff(temp_seq[1]=0, "Success", "Failure"), "msg", MB_ICONINFORMATION) -- I get "Success" here pBstr = alloc_bstr(OW6AppId) OW6Result = invoke( OW6, {OneWay_m_GetData}, {pBstr}, {VT_BSTR}, DISPATCH_METHOD ) free_bstr(pBstr)
The display with peek_bstr() shows the correct value set for the string, but the value returned in OW6Result is always 65535. Using w32TextToNumber(w32peek_string(OW6Result)) that value is converted to 0 (zero). Am I missing some initialization procedure? Regards, Rad.
4. Re: ActiveX Controls (ocx) in win32lib
- Posted by Rad <radhx at redif?ma?l.com> Aug 23, 2007
- 570 views
Rad wrote: > > I am having difficulties calling a function from ocx with a "string" input > parameter and boolean return value. > This is the feedback I got from the author of ActiveX Control: ====================================== I'm not sure which language you are using, but 1Way uses a VARIANT_BOOL data type which is compatible with the .NET system.boolean data type. This is a 4-byte boolean value. The internal representation is hex 00000000 = False any non-zero value is considered to be True. Usually True is set as hex FFFFFFFF (or -1 decimal). You are getting a value of 65535 which is hex FFFF considered as an unsigned integer. So it looks like your program is only looking at 2 bytes, rather than 4, and it is taking it to be an unsigned integer rather than a boolean value. =============================================== Regards, Rad.