Thank you Tom.<div>I tried &#39;EnsureDispatch()&#39; following your advice.</div><div>This is it.</div><div><div>&gt;&gt;&gt; import win32com.client</div><div>&gt;&gt;&gt; sh = win32com.client.gencache.EnsureDispatch(&#39;Shell.Autoplay&#39;)</div>
<div>Traceback (most recent call last):</div><div>  File &quot;&lt;pyshell#4&gt;&quot;, line 1, in &lt;module&gt;</div><div>    sh = wcc.gencache.EnsureDispatch(&#39;Shell.Autoplay&#39;)</div><div>  File &quot;C:\Python32\lib\site-packages\win32com\client\gencache.py&quot;, line 529, in EnsureDispatch</div>
<div>    disp = win32com.client.Dispatch(prog_id)</div><div>  File &quot;C:\Python32\lib\site-packages\win32com\client\__init__.py&quot;, line 95, in Dispatch</div><div>    dispatch, userName = dynamic._GetGoodDispatchAndUserName(dispatch,userName,clsctx)</div>
<div>  File &quot;C:\Python32\lib\site-packages\win32com\client\dynamic.py&quot;, line 108, in _GetGoodDispatchAndUserName</div><div>    return (_GetGoodDispatch(IDispatch, clsctx), userName)</div><div>  File &quot;C:\Python32\lib\site-packages\win32com\client\dynamic.py&quot;, line 85, in _GetGoodDispatch</div>
<div>    IDispatch = pythoncom.CoCreateInstance(IDispatch, None, clsctx, pythoncom.IID_IDispatch)</div><div>pywintypes.com_error: (-2147467262, &#39;Inteface is not supported&#39;, None, None)</div><div><br></div><div>Same error occured on &#39;Shell.Autoplay&#39;. And so on my &#39;SMIEngine.SMIhost&#39;.</div>
<div><br></div><div>Then I went tolaunch  &#39;makepy.py&#39;</div>I was asked to &#39;Select library&#39;</div><div>But what is this &#39;library&#39; mean ?</div><div>Nothin like &#39;Shell.autoplay&#39; or &#39;SMIEngine&#39;.</div>
<div><br></div><div>Sorry I&#39;m not familiar with COM.</div><div><br></div><div>Regards</div><div>  ikeya</div><div><br><div class="gmail_quote">2012/4/10 Tim Roberts <span dir="ltr">&lt;<a href="mailto:timr@probo.com">timr@probo.com</a>&gt;</span><br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="im">takeshi ikeya wrote:<br>
&gt; Anyone help me ?<br>
&gt; I really appreciate  win32extension.<br>
&gt; I&#39;m trying to use some 3&#39;rd parties COM.<br>
&gt;<br>
&gt; First I tested win32extension installation.<br>
&gt;<br>
&gt; &gt;&gt;&gt; import win32com.client<br>
&gt; &gt;&gt;&gt; sh = win32com.client.Dispatch(&#39;Shell.Application&#39;)<br>
&gt; &gt;&gt;&gt; sh.SetTime()<br>
&gt;<br>
&gt; Goes OK.<br>
</div>&gt; ...<br>
<div class="im">&gt; Next step. I tried &#39;Shell.Autoplay&#39;.<br>
&gt; Simply because it&#39;s on the next apeerance.<br>
&gt;<br>
&gt; &gt;&gt;&gt; sa = win32com.client.Dispatch(&#39;Shell.Autoplay&#39;)<br>
</div>&gt; ...<br>
&gt; Traceback (most recent call last): ...<br>
<div class="im">&gt;   File &quot;D:\Python27\lib\site-packages\win32com\client\dynamic.py&quot;,<br>
&gt; line 85, in _GetGoodDispatch<br>
&gt;     IDispatch = pythoncom.CoCreateInstance(IDispatch, None, clsctx,<br>
&gt; pythoncom.IID_IDispatch)<br>
</div>&gt; com_error: <a href="tel:%28-2147467262" value="+12147467262">(-2147467262</a> &lt;tel:%28-2147467262&gt;,<br>
<div class="im">&gt; &#39;\x83C\x83\x93\x83^\x81[\x83t\x83F\x83C\x83X\x82\xaa\x83T\x83|\x81[\x83g\x82\xb3\x82\xea\x82\xc4\x82\xa2\x82\xdc\x82\xb9\x82\xf1&#39;,<br>
&gt; None, None)<br>
&gt; &gt;&gt;&gt;<br>
&gt;<br>
&gt; Dispatch() returns error<br>
<br>
</div>-<a href="tel:2147467262" value="+12147467262">2147467262</a> is 0x80004002, which is E_NOINTERFACE.<br>
<br>
There are two different ways of talking to a COM server: &quot;early binding&quot;<br>
and &quot;late binding&quot;.<br>
<br>
&quot;Early binding&quot; is what you use from C++.  It means the COM client knows<br>
the full layout of the COM object, including all of the methods it<br>
supports, and in what order they appear in the function table.  All COM<br>
objects support &quot;early binding&quot;.<br>
<br>
&quot;Late binding&quot; is what you use from, for example, Visual Basic.  With<br>
&quot;late binding&quot;, the object supports an interface called IDispatch.  I<br>
can use the IDispatch interface to ask the object about the methods it<br>
supports and the parameter types for each method.  An object with<br>
IDispatch can be used by more clients, but it is somewhat painful to<br>
add.  So, many objects only support &quot;early binding&quot;.<br>
<br>
win32com.client.Dispatch uses late binding.  Shell.Application supports<br>
IDispatch, but Shell.Autoplay does not, and apparently neither does<br>
SMIEngine.SMIHost.  You get the E_NOINTERFACE error because the object<br>
does not support IDispatch.<br>
<br>
You can use early binding from Python by creating a proxy wrapper.  You<br>
can do this by using the &quot;makepy&quot; command in the Python distribution, or<br>
by using win32com.client.gencache.EnsureDispatch instead of<br>
win32com.client.Dispatch.<br>
<span class="HOEnZb"><font color="#888888"><br>
--<br>
Tim Roberts, <a href="mailto:timr@probo.com">timr@probo.com</a><br>
Providenza &amp; Boekelheide, Inc.<br>
<br>
_______________________________________________<br>
python-win32 mailing list<br>
<a href="mailto:python-win32@python.org">python-win32@python.org</a><br>
<a href="http://mail.python.org/mailman/listinfo/python-win32" target="_blank">http://mail.python.org/mailman/listinfo/python-win32</a><br>
</font></span></blockquote></div><br></div>