Thomas Heller wrote:
> Larry Bates schrieb:
>> I've spent all morning searching and I just can't seem to find the 
>> TypeLibrary 
>> name for this COM interface.  I've searched the registry, scanned COM 
>> browser 
>> list at least a dozen times, etc.  Some information about this COM object is 
>> located here:
>>
>> http://www.com.it-berater.org/COM/windows_shell/interfaces/IProgressDialog%20.htm
>>
>> It appears to be located in browseui.dll, but that didn't help either.
>>
>> I also tried using pythoncom.CoCreateInstance, but it reports:
>>
>>  >>> 
>> pdlg=pythoncom.CoCreateInstance('{F8383852-FCD3-11d1-A6B9-006097DF5BD4}', No
>> ne, 1, '{EBBC7C04-315E-11d2-B62F-006097DF5BD4}')
>> Traceback (most recent call last):
>>    File "<stdin>", line 1, in <module>
>> TypeError: There is no interface object registered that supports this IID
>>
>> I'm hoping that someone out there can assist?
> 
> Quite some com objects do not have a type library; probably those that are 
> only
> supposed (by MS) to be used by C++ code.
> 
> Sometimes an .idl file can be found somewhere in the SDKs which you can
> compile into a .tlb file, sometimes not.
> 
> Sometimes someone who wants to use the object from VB writes an idl file
> and compiles a typelib (but you could also try it yourself, maybe).
> With a little googling I found a zip-file containing such a library:
> 
> http://www.msjogren.net/dotnet/eng/samples/vb6_progdlg.asp
> 
> However, this typelib would not help if you are using pywin32; comtypes
> would probably be able to use it - I haven't tried it myself.
> 
> Thomas

Ok, I downloaded that project, and stripped out the TLB.  I then got comtypes 
and was able to use comtypes.client.GetModule to generate the typelib wrapper 
module for it:

 >>> GetModule("progdlg.tlb")
<module 'comtypes.gen.VBProgressDialog' from 
'C:\Python25\lib\site-packages\comtypes\gen\_2F2719A2_83CC_11D3_A08C_0040F6A4BFEC_0_1_1.pyc'>
 >>> import comtypes.gen.VBProgressDialog

Now I can't seem to figure out what to do.  There are three classes generated:

class IOleWindow(comtypes.IUnknown)
class IProgressDialog(comtypes.IUnknown)
class ProgressDialog(comtypes.CoClass)

Instantiating IProgressDialog() seems to give me an instance that has the 
methods that I'm looking for (at least they show up in Idle as callable 
methods), but when I try to call one I get the following message:

Traceback (most recent call last):
   File "<pyshell#20>", line 1, in <module>
     b.SetTitle('test')
TypeError: Expected a COM this pointer as first argument

Sorry to be so dense, I'm still learning the COM stuff.

Thanks in advance.
Larry

Test program:

import comtypes.client.GetModule
GetModule('progdlg.tlb')
import comtypes.gen.VBProgressDialog
ci=comtypes.gen.VBProgressDialog
a=ci.ProgressDialog()
a.SetTitle('test')



_______________________________________________
python-win32 mailing list
python-win32@python.org
http://mail.python.org/mailman/listinfo/python-win32

Reply via email to