[pywin32-bugs] [ pywin32-Bugs-3566266 ] Python Object Browser - Unable to view ActiveX CoClass
OLD project page for the Python extensions for Windows
Brought to you by:
mhammond
From: SourceForge.net <no...@so...> - 2012-09-11 09:55:38
|
Bugs item #3566266, was opened at 2012-09-10 03:41 Message generated for change (Comment added) made by omega_weapon You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=551954&aid=3566266&group_id=78018 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: None Group: None >Status: Open Resolution: None Priority: 5 Private: No Submitted By: Omega Weapon (omega_weapon) Assigned to: Nobody/Anonymous (nobody) Summary: Python Object Browser - Unable to view ActiveX CoClass Initial Comment: Full title: Python Object Browser - Unable to view ActiveX CoClass type library information I am currently looking into the possiblity of using Python to control some VB6 ActiveX objects used at work. In order to see what COM objects were accessible, I used the combrowse script - however any attempts to browse the CoClass directory of the objects (as compared to the Dispatch directory) fail with the following error: ======================================================== (null) Traceback (most recent call last): File "C:\Python27\lib\site-packages\Pythonwin\pywin\tools\hierlist.py", line 39, in OnTreeItemExpanding self.AddSubList(itemHandle, self.GetSubList(item)) File "C:\Python27\lib\site-packages\Pythonwin\pywin\tools\hierlist.py", line 86, in GetSubList return self.DelegateCall(item.GetSubList) File "C:\Python27\lib\site-packages\Pythonwin\pywin\tools\hierlist.py", line 73, in DelegateCall return fn() File "C:\Python27\Lib\site-packages\win32com\client\combrowse.py", line 239, n GetSubList refType = typeinfo.GetRefTypeInfo(typeinfo.GetRefTypeOfImplType(j)) pywintypes.com_error: (-2147312566, 'Error loading type library/DLL.', None, No e) ======================================================== This is after running the makepy script for the object. The objects are usable from Microsoft Visual basic 6 Studio (etc) - are there further steps needed to get them useable here? Unfortunately I have no experience with this detail as it basically Just Works with normal VB6 development. Thanks ---------------------------------------------------------------------- >Comment By: Omega Weapon (omega_weapon) Date: 2012-09-11 02:55 Message: Right, I have found a colleague with COM/ActiveX experience - this dll implements two interfaces, IManager and ITEventStatus. Every method on the actual class is marked Private, even those implementing the interfaces. So presumably the interface methods are the only public methods available on the object. The two interfaces are registered via type libraries (have both the tlb and the idl), but importantly I don't have the source code to the original VB6 projects that implemented the interfaces. In the idl header, the source library for IManager is quoted as spIManager, and a UUID is given that does not exist in the registry of any of our machines. So presumably the failure happens when the missing dll is looked up? Here is the idl of one of the interfaces as an example: ====================================================== // TypeLib : IManager.idl // TargetFile : IManager.TLB // // Version 1.0 // Author : // UUID Usage: // ae40bf60-dd04-11d6-a558-000347d25793 : library spIManager // bc185b30-dd04-11d6-a558-000347d25793 : interface IManager [ uuid(ae40bf60-dd04-11d6-a558-000347d25793), version(1.0), helpstring("sp Manager Interface") ] library tsIManager { // TLib : // TLib : OLE Automation : {00020430-0000-0000-C000-000000000046} importlib("Stdole2.tlb"); // Forward declare all types defined in this typelib interface IManager; [ uuid(bc185b30-dd04-11d6-a558-000347d25793), version(1.0), nonextensible, oleautomation ] interface IManager : IUnKnown { [id(0x60030000)] HRESULT Start([out, retval] VARIANT_BOOL* ); [id(0x60030001)] HRESULT Halt( [in, optional, defaultvalue(0)] VARIANT_BOOL vbSoftStop, [out, retval] VARIANT_BOOL* ); }; }; ====================================================== ---------------------------------------------------------------------- Comment By: Mark Hammond (mhammond) Date: 2012-09-10 16:41 Message: I doubt there is much pywin32 can do to resolve this, especially without more details about the objects in question. ---------------------------------------------------------------------- Comment By: Omega Weapon (omega_weapon) Date: 2012-09-10 09:25 Message: Some more detail - using OleView to view the relevant type library, when I try to look at the CoClass, I get the following error: --------------------------- OLEViewer 2.0 Interface Viewers --------------------------- Could not decompile selected item Error loading type library/DLL. TYPE_E_CANTLOADLIBRARY ($80029C4A) --------------------------- OK --------------------------- So presumably VB6 is doing something bad, but I dont know what or why it isnt an issue for VB6 :/ ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=551954&aid=3566266&group_id=78018 |