Thanks Mark. I&#39;ll dig around the various windows typelilbs and see if one of them has a GUID structure.<br><br>If
I know the order of the structure myself (and know how to turn in to a
buffer) does anyone know how I could convert the buffer in to a com_record ?<br><br><div class="gmail_quote">On Feb 1, 2008 12:34 AM, Mark Hammond &lt;<a href="mailto:mhammond@skippinet.com.au">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 link="blue" vlink="purple" lang="EN-US">

<div>

<p><span style="font-size: 11pt; color: rgb(31, 73, 125);">The record will be defined in a typelib somewhere, and have
named elements.&nbsp; For example, the win32com test VB code:</span></p>

<p><span style="font-size: 11pt; color: rgb(31, 73, 125);">&nbsp;</span></p>

<p><span style="font-size: 11pt; color: rgb(31, 73, 125);">Public Type VBStruct</span></p>

<p><span style="font-size: 11pt; color: rgb(31, 73, 125);">&nbsp;&nbsp;&nbsp; int_val As Integer</span></p>

<p><span style="font-size: 11pt; color: rgb(31, 73, 125);">&nbsp;&nbsp;&nbsp; str_val As String</span></p>

<p><span style="font-size: 11pt; color: rgb(31, 73, 125);">&nbsp;&nbsp;&nbsp; ob_val As Object</span></p>

<p><span style="font-size: 11pt; color: rgb(31, 73, 125);">&nbsp;&nbsp;&nbsp; sub_val As SubStruct</span></p>

<p><span style="font-size: 11pt; color: rgb(31, 73, 125);">End Type</span></p>

<p><span style="font-size: 11pt; color: rgb(31, 73, 125);">&nbsp;</span></p>

<p><span style="font-size: 11pt; color: rgb(31, 73, 125);">And VB arranges for that to become a COM record.&nbsp; Python
code can then say:</span></p>

<p><span style="font-size: 11pt; color: rgb(31, 73, 125);">&nbsp;</span></p>

<p><span style="font-size: 11pt; color: rgb(31, 73, 125);">&nbsp;&nbsp;&nbsp; s =
win32com.client.Record(&quot;VBStruct&quot;, vbtest)</span></p>

<p><span style="font-size: 11pt; color: rgb(31, 73, 125);">&nbsp;&nbsp;&nbsp; s.int_val = -1</span></p>

<p><span style="font-size: 11pt; color: rgb(31, 73, 125);">&nbsp;</span></p>

<p><span style="font-size: 11pt; color: rgb(31, 73, 125);">(Where vbtest in the first line is a COM object that comes from
the same typelib which defines the struct).&nbsp; The object &#39;s&#39; can then be
passed as a param, where it will become VT_RECORD.&nbsp; Without knowing how
the struct is defined in your case I can&#39;t speculate how a GUID would be carried.&nbsp;
If it was a simply array of bytes, then using &#39;buffer(guid)&#39; will give you the
raw bytes.</span></p>

<p><span style="font-size: 11pt; color: rgb(31, 73, 125);">&nbsp;</span></p>

<p><span style="font-size: 11pt; color: rgb(31, 73, 125);">Cheers,</span></p>

<p><span style="font-size: 11pt; color: rgb(31, 73, 125);">&nbsp;</span></p>

<p><span style="font-size: 11pt; color: rgb(31, 73, 125);">Mark</span></p>

<p><span style="font-size: 11pt; color: rgb(31, 73, 125);">&nbsp;</span></p>

<div style="border-style: none none none solid; border-color: -moz-use-text-color -moz-use-text-color -moz-use-text-color blue; border-width: medium medium medium 1.5pt; padding: 0cm 0cm 0cm 4pt;">

<div>

<div style="border-style: solid none none; border-color: rgb(181, 196, 223) -moz-use-text-color -moz-use-text-color; border-width: 1pt medium medium; padding: 3pt 0cm 0cm;">

<p><b><span style="font-size: 10pt;">From:</span></b><span style="font-size: 10pt;"> <a href="mailto:python-win32-bounces@python.org" target="_blank">python-win32-bounces@python.org</a>
[mailto:<a href="mailto:python-win32-bounces@python.org" target="_blank">python-win32-bounces@python.org</a>] <b>On Behalf Of </b>Kevin Patterson<br>
<b>Sent:</b> Friday, 1 February 2008 2:34 PM<br>
<b>To:</b> <a href="mailto:python-win32@python.org" target="_blank">python-win32@python.org</a><br>
<b>Subject:</b> [python-win32] How to create a com_record?</span></p>

</div>

</div><div><div></div><div class="Wj3C7c">

<p>&nbsp;</p>

<p>I have a COM server that is expecting a GUID as an argument.
The generated makepy shows that the function is expecting a VT_RECORD. I cannot
seem to pass in the CLSID, I get the following:<br>
<br>
TypeError: Only com_record objects can be used as records<br>
<br>
I looked at the win32com.client.Record function, but it looks like it will
create another COM object if I give it the GUID.What I really need is to pass
the GUID in to this function as a sort of structure.&nbsp; I &quot;think&quot;
I have to build a struct (using the struct class?) turn it into a buffer and
then somehow convert this to a Record object....Trouble is I can&#39;t find any
documentation on com_record objects anywhere....Any ideas?<br>
<br>
Thanks,<br>
Kevin</p>

</div></div></div>

</div>

</div>


</blockquote></div><br>