Sorry for so many posting here, but on the off chance someone is curious and looks in to this:<br><br>There&#39;s two issues I&#39;ve found so far:<br><br><br><div class="gmail_quote">On Fri, Mar 14, 2008 at 2:44 PM, Kevin Patterson &lt;<a href="mailto:patter001@gmail.com">patter001@gmail.com</a>&gt; wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">Does anyone have a working example (excel, outlook, etc...) to try the win32com.client.Record function on ?<br>
<br>I tried the pythoncom test harness also, but no luck:<br><br>import win32com.client<br>myarray = win32com.client.DispatchEx(&quot;{F1A51873-24E9-47ED-AE71-925462C5FE3B}&quot;)<br>
myrecord = win32com.client.Record(&quot;tagTestStruct1&quot;,myarray)<br><br>the Record Creation fails with the following exception:<br><br>Traceback (most recent call last):<br>&nbsp; File &quot;&lt;stdin&gt;&quot;, line 1, in &lt;module&gt;<br>

&nbsp; File &quot;C:\Python25\lib\site-packages\win32com\client\__init__.py&quot;, line 405, in<br>&nbsp;Record<br>&nbsp;&nbsp;&nbsp; return pythoncom.GetRecordFromGuids(module.CLSID, module.MajorVersion, modul<br>e.MinorVersion, module.LCID, struct_guid)<br>

pywintypes.com_error: (-2147024809, &#39;The parameter is incorrect.&#39;, None, None)<br><br>For refrence, help looks like the below. Only major difference is using Dispatch vs. DispatchEx<br><br>Record(name, object)<br>

&nbsp;&nbsp;&nbsp; Creates a new record object, given the name of the record,<br>&nbsp;&nbsp;&nbsp; and an object from the same type library.<br><br><br>Example usage from documentation is:<br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; app = win32com.client.Dispatch(&quot;Some.Application&quot;)<br>

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; point = win32com.client.Record(&quot;SomeAppPoint&quot;, app)<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; point.x = 0<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; point.y = 0<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; app.MoveTo(point)<div><div></div><div class="Wj3C7c"><br><br><br><div class="gmail_quote">On Thu, Mar 13, 2008 at 11:02 PM, Kevin Patterson &lt;<a href="mailto:patter001@gmail.com" target="_blank">patter001@gmail.com</a>&gt; wrote:<br>

<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">Ok, more digging, it looks like the OLE Automation TypeLib should have a GUID Record defined. I see this when using the Python Object Browser<br>

<br>However, when I generate the py file for the OLE Automation type library, I don&#39;t see GUID in the RecordMap (or any reference to the GUID Record)...Is there suppose to be something in the generated file, but maybe its not working ? How do I actually create one of these Records ?<div>

<div></div><div><br>
<br><div class="gmail_quote">On Tue, Mar 11, 2008 at 10:04 PM, Kevin Patterson &lt;<a href="mailto:patter001@gmail.com" target="_blank">patter001@gmail.com</a>&gt; wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">


I found the comtypes equivalent if that helps any. The generated comtypes file looks like this:<br><br>&nbsp;&nbsp; COMMETHOD([dispid(1610743812), helpstring(u&#39;GetInterface() method&#39;)], HRESULT, &#39;GetInterface&#39;,<br>

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ( [&#39;in&#39;], POINTER(GUID), &#39;riid&#39; ),<br>

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ( [&#39;retval&#39;, &#39;out&#39;], POINTER(POINTER(IUnknown)), &#39;ppUnknown&#39; )),<br><br>With the above, I&#39;m able to use the comtypes.GUID.GUID structure to pass the information over through the COM. Unfortunately I still can&#39;t find the win32com equivalent of passing my structure through the COM.<br>



<br>The win32com generated py file is saying that it expects a VT_RECORD, but from above, maybe it should really be expecting a POINTER ? or VT_POINTER ? I tried to modify the win32com generated file to take a VT_PTR but that didn&#39;t seem to help. I really don&#39;t want to redo my infastructure in comtypes, so if anyone knows the win32com equivalent, that would be awesome.<br>



<br>In the meantime, I&#39;ll keep digging, and will post if I find more.<div><div></div><div><br><br><br><div class="gmail_quote">On Tue, Mar 11, 2008 at 12:58 PM, Kevin Patterson &lt;<a href="mailto:patter001@gmail.com" target="_blank">patter001@gmail.com</a>&gt; wrote:<br>



<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">Old thread, but I got a little more data on the function. The function actually has a REFIID as the first parameter. This apparently is a standard structure for C COM code.&nbsp; I&#39;m not entirely sure why the win32com changes the REFIID to be a VT_RECORD. Does the following definition of the functions help at all (they are from the IDL file)<br>




<br><font color="navy" face="Arial" size="2"><span style="font-size: 10pt; color: navy; font-family: Arial;">HRESULT GetInterface( 
[in] REFIID riid, [out, retval, iid_is(riid)] IUnknown** 
ppUnknown);<br>should be same as:<br></span></font><font color="navy" face="Arial" size="2"><span style="font-size: 10pt; color: navy; font-family: Arial;">HRESULT GetInterface( 
[in] GUID* pGuid, [out, retval, iid_is(pGuid)] IUnknown** 
ppUnknown);</span></font><div><div></div><div><br><font color="navy" face="Arial" size="2"><span style="font-size: 10pt; color: navy; font-family: Arial;"><br></span></font><br><div class="gmail_quote">On Mon, Feb 4, 2008 at 6:44 PM, Mark Hammond &lt;<a href="mailto:mhammond@skippinet.com.au" target="_blank">mhammond@skippinet.com.au</a>&gt; wrote:<br>




<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><div>&gt; guid = win32com.client.Record(&quot;GUID&quot;, some_ob)<br>
<br>
&gt; I don&#39;t have the some_obj that allows me to build &quot;GUID&quot;.<br>
<br>
</div>It should be any object from the same typelib - almost certainly whatever<br>
object you intend passing this record to.<br>
<div><br>
&gt; <a href="http://VB.NET" target="_blank">VB.NET</a> (GetType) and C++ (__uuid) both already know that a GUID is a<br>
record.<br>
<br>
</div>C++ doesn&#39;t know it is a COM record. &nbsp;A COM record is something quite<br>
different to a C/C++ struct or from .NET types. &nbsp;A COM record is<br>
specifically designed to be cross-language.<br>
<div><br>
&gt; It seems the python CLSID is the same thing, but i don&#39;t know what to call<br>
<br>
&gt; to get a CLSID that is a com_record type.<br>
<br>
</div>As I&#39;ve explained, we are looking for the COM record definition you are<br>
trying to use. &nbsp;A C++ struct definition for a GUID is *not* what you are<br>
looking for - you are looking for the COM record definition of a GUID. &nbsp;I<br>
see now that you simply copied me a C++ struct you found, which is not at<br>
all useful in this context.<br>
<br>
To clarify: in a *typelib* you will find a struct definition that you are<br>
trying to use. &nbsp;Finding a struct definition of the same name somewhere else<br>
is not suitable.<br>
<div><br>
&gt; Am I understanding the win32com.client.Record call correctly? It needs<br>
GUID to be defined by the<br>
&gt; COM right?<br>
<br>
</div>Not &quot;defined by COM&quot;, but &quot;defined using COM&quot; - the author of a typelib must<br>
have defined it somewhere.<br>
<div><br>
&gt; Its odd b/c the GIUD (python&#39;s CLSID) is all over the COM definitions its<br>
just type<br>
&gt; VT_RECORD type that I&#39;m not understanding how to convert to.<br>
<br>
</div>Yes, I&#39;m afraid you are confused. &nbsp;All existing GUID or CLSID definitions<br>
you can find are useless - there is only 1 that is relevant, and that will<br>
be defined in a typelib.<br>
<br>
I think the confusion is such that you need to find basic docs for the<br>
object, so we can get back to square 1.<br>
<font color="#888888"><br>
Mark<br>
<br>
</font></blockquote></div><br>
</div></div></blockquote></div><br>
</div></div></blockquote></div><br>
</div></div></blockquote></div><br>
</div></div></blockquote></div><br>