Fwd: [python-win32] Using a COM interface where the objects don't
have ProgIDs
John Clark
clajo04 at mac.com
Thu Mar 24 06:41:40 CET 2005
Okay - sorry for the interruption - banging at this for several more
minutes gave me the direction I needed. For anyone else out there
struggling, I found that if I call
win32com.client.dynamic.Dispatch('{70107C62-8ABB-11D5-961B
-0010A4F73DE4}')
and if I actually DO register the COM control, rather than just
assuming that it's registered because the DLL exists ("Of course it is
registered - the file is right there! No one would place the file on
the disk without actually registering the objects...") everything then
seems to work as advertised (imagine that :)).
Well, I guess sometimes it just helps to talk it out in email.....
-John
On Mar 23, 2005, at 10:21 PM, John Clark wrote:
> My apologies if this is something that should be obvious to me, but I
> cannot figure out how to use a typelib if that typelib does not
> establish ProgID values for the CoClasses.
>
> The class that was created by EnsureModule() is as follows:
>
> class CaWHarvest(CoClassBaseClass): # A CoClass
> # CaWHarvest Class
> CLSID = IID('{70107C62-8ABB-11D5-961B-0010A4F73DE4}')
> coclass_sources = [
> _ICaWHarvestEvents,
> ]
> default_source = _ICaWHarvestEvents
> coclass_interfaces = [
> ICaWHarvest,
> ]
> default_interface = ICaWHarvest
>
> I have tried calling½ win32com.client.Dispatch(None, resultCLSID =
> IID('{70107C62-8ABB-11D5-961B-0010A4F73DE4}')) but this returned a
> 'Class Not registered' error. I have searched the registry for the
> above CLSID and have found entries, so to the best of my knowledge
> this COM component is registered. Beyond that I am afraid I have
> exceeded my knowledge of COM & Python.
>
> My only experience with calling COM components from Python has been in
> situations where the class has a ProgID that I would pass into
> Dispatch() as the parameter... I suppose I could force a programmatic
> ID by creating something in the registry, but it seems there should be
> an answer without doing that.
>
> Could someone point me in the right direction? I am sure I am just
> missing something obvious.
>
> Thanks,
> -John_______________________________________________
> Python-win32 mailing list
> Python-win32 at python.org
> http://mail.python.org/mailman/listinfo/python-win32
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: text/enriched
Size: 2343 bytes
Desc: not available
Url : http://mail.python.org/pipermail/python-win32/attachments/20050324/78f510bc/attachment.bin
More information about the Python-win32
mailing list