Thank your your excellent help, Mark. I have gotten everything to compile properly, and can call IExtractImage::GetLocation and IExtractImage::Extract from python on the necessary files. Even the exceptions on unknown file types seem to be handled properly.
<br><br>The final problem is getting the image data into python (and using it in wxpython). The final return type is an HBITMAP, which I can see as an int in Python using PyLong_FromVoidPtr, or as a PyHANDLE in python using PyWinObject_FromHANDLE.
<br><br>I realize that a discussion on wxpython would be outside this group&#39;s topic, but if anyone could tell me where to start looking for a way to do this, I would greatly appreciate it. From what I can tell, wxpython/wxwindows uses the HBITMAP type internally to store images, and it appears to be a pointer to a DIB in memory. If so, it may be possible to use 
wx.BitmapFromBuffer, wx.BitmapFromBits, or some similar function, if I can somehow convert the HBITMAP data (instead of the handle) to a string.<br><br>Thanks,<br>Steven James<br><br><div><span class="gmail_quote">On 4/19/07, 
<b class="gmail_sendername">Mark Hammond</b> &lt;<a href="mailto:mhammond@skippinet.com.au">mhammond@skippinet.com.au</a>&gt; wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
&gt; I have been delving in to the process of adding support for IExtractImage<br>to<br>&gt; pythonwin. I have run makegw on the necessary files, added the resulting<br>.cpp<br>&gt; and .h files to com/win32comext/shell/src, added references in 
shell.cpp<br>and<br>&gt; setup.py, and now it seems all that is left to do is implement the proper<br>&gt; data types which makegw did not know how to handle. (Also, if it would<br>&gt; help anyone, I patched my makegw to run under Python 
2.5 with no regex<br>&gt; or regsub modules.)<br><br>Excellent - please feel free to send me the patches.&nbsp;&nbsp;makegw is *very* dumb<br>though.<br><br>&gt; I have a few questions about the next steps, for those who may have done
<br>this before:<br><br>&gt; I am left with a few lines of code in the PyIExtractImage.cpp file that<br>look like this:<br><br>&gt; if (bPythonIsHappy &amp;&amp; !PyObject_AsDWORD *( obpdwPriority, &amp;pdwPriority ))<br>
bPythonIsHappy = FALSE;<br><br>See above - makepy is dumb :)&nbsp;&nbsp;For now, PyInt_AsLong should work fine for a<br>DWORD.&nbsp;&nbsp;HBITMAP should just use PyLong_FromVoidPtr (or however that is<br>spelt), and a SIZE already has PyWinObject_FromSIZE.&nbsp;&nbsp;You will just need to
<br>correct the invalid indirections created by makegw - eg, your line above<br>would read as:<br><br>&gt; DWORD dwPriority;<br>&gt; if (bPythonIsHappy &amp;&amp; !PyInt_AsLong( obpdwPriority, (long *)&amp;dwPriority ))<br>
bPythonIsHappy = FALSE;<br><br>Also, please see the existing support for IExtractIcon - this new interface<br>should be almost identical - just one or 2 data types appear to be different<br>between the interfaces (HICON -&gt; HBITMAP being the most obvious one)
<br><br>Cheers,<br><br>Mark<br><br></blockquote></div><br>