<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<META content="IncrediMail 1.0" name=GENERATOR>
<!--IncrdiXMLRemarkStart>
<IncrdiX-Info>
<X-FID>CB5A11CC-B87B-40200B65F-A1197FF3408E</X-FID>
<X-FVER>4.0</X-FVER>
<X-FIT>Letter</X-FIT>
<X-FILE>Letter\style1.imf</X-FILE>
<X-FCOL>Aleksandar Cikota's Collection</X-FCOL>
<X-FCAT>Untitled</X-FCAT>
<X-FDIS>Style1</X-FDIS>
<X-Extensions>SU1CTDEsNDYsgUmBSTQwjSSFhTQ0TTDBnTBNiYGRgYEwmY04TSSFhcWdODiViYHBLEmBSYFJgSxJTUJMMiwwLCxJTUJMMywwLCw=</X-Extensions>
<X-BG></X-BG>
<X-BGT>no-repeat</X-BGT>
<X-BGC>#ffffff</X-BGC>
<X-BGPX>0px</X-BGPX>
<X-BGPY>0px</X-BGPY>
<X-ASN>BCEB29C0-42D3-11D4-BA3E-0050DAC68030</X-ASN>
<X-ASNF>0</X-ASNF>
<X-ASH>BCEB29C0-42D3-11D4-BA3E-0050DAC68030</X-ASH>
<X-ASHF>1</X-ASHF>
<X-AN>C958D3B0-2BF0-11D4-BA28-0050DAC68030</X-AN>
<X-ANF>0</X-ANF>
<X-AP>C958D3B0-2BF0-11D4-BA28-0050DAC68030</X-AP>
<X-APF>1</X-APF>
<X-AD>E3F15280-2BF7-11D4-BA28-0050DAC68030</X-AD>
<X-ADF>0</X-ADF>
<X-AUTO>X-ASN,X-ASH,X-AN,X-AP,X-AD</X-AUTO>
<X-CNT>;</X-CNT>
</IncrdiX-Info>
<IncrdiXMLRemarkEnd-->
</HEAD>
<BODY style="BACKGROUND-POSITION: 0px 0px; FONT-SIZE: 10pt; MARGIN: 0px 10px 10px; BACKGROUND-REPEAT: no-repeat; FONT-FAMILY: Verdana" bgProperties=fixed bgColor=#ffffff background="" scroll=yes SIGCOLOR="0" INCREDIFIXEDFORIMOL="true" ORGYPOS="0">
<TABLE id=INCREDIMAINTABLE cellSpacing=0 cellPadding=2 width="100%" border=0>
<TBODY>
<TR>
<TD id=INCREDITEXTREGION style="FONT-SIZE: 10pt; CURSOR: auto" vAlign=top width="100%">
<DIV> Hi all,</DIV>
<DIV> </DIV>
<DIV>I'm beginner in Python and need help. I'm writing software for a robotic telescope. For CCD camera control we use MaxIm DL (Diffraction Limited). I have a problem with CCDCamera.SaveImage.</DIV>
<DIV> </DIV>
<DIV>Error message:</DIV>
<DIV>> File "S:MaxImmaxim.py", line 19, in ?<BR>> CCDCamera.SaveImage('C:/1.fit')<BR>> File "C:ProgrammePython24Libsite-<BR>> packageswin32comclientdynamic.py", line 491, in __getattr__<BR>> raise pythoncom.com_error, details<BR>> com_error: (-2147352567, 'Ausnahmefehler aufgetreten.',<BR>> (65535, 'MaxIm DL 4', 'Invalid Input', None, 0, 0), None)</DIV>
<DIV> </DIV>
<DIV> </DIV>
<DIV>Here is the answer that we recieved from Diffraction Limited:</DIV>
<DIV>---------</DIV>
<DIV>For CCDCamera.SaveImage, 'Invalid Input' is reported only if the argument is<BR>not of an acceptable type. As you are probably aware from looking at the<BR>type library, the filename argument is declared as a variant. What the type<BR>library doesn't tell you is that the variant must be either a BSTR (unicode<BR>string with header) or a reference to a BSTR. Specifically, the 'vt' member<BR>of the VARIANT must be either VT_BSTR or VT_BSTR|VT_BYREF.</DIV>
<DIV> </DIV>
<DIV>Does python provide any way of influencing how arguments for COM methods are<BR>created? If so, you may be able to get this to work. It may be as simple<BR>as assigning the string to a variable name instead of passing it as a<BR>literal, or perhaps there's something equivalent to a C++ cast operator or a<BR>VB 'type' function (CInt, CStr, etc.).</DIV>
<DIV> </DIV>
<DIV>This problem is likely to affect any MaxIm DL automation method that takes a<BR>string as an argument.</DIV>
<DIV>---------</DIV>
<DIV> </DIV>
<DIV> </DIV>
<DIV>The question is, how to convert a String in a BSTR (unicodestring with header)?</DIV>
<DIV> </DIV>
<DIV> </DIV>
<DIV>
<P class=MsoNormal style="MARGIN: 0cm 0.9pt 0pt 0cm; rem_rem_rem_rem_rem_rem_rem_rem_rem_rem_rem_rem_rem_margin-left: 0in"><SPAN lang=EN-US style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: Arial; mso-ansi-language: EN-US"><FONT face=Verdana>For your prompt reply, I say thank you in advance.<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /><o:p></o:p></FONT></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: Arial; mso-ansi-language: EN-US"><o:p><FONT face=Verdana> </FONT></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: Arial; mso-ansi-language: EN-US"><FONT face=Verdana>Best regards,<o:p></o:p></FONT></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: Arial; mso-ansi-language: EN-US"><FONT face=Verdana>Aleksandar Cikota</FONT></SPAN></P></DIV>
<DIV><STRONG><FONT color=#004080></FONT></STRONG> </DIV>
<DIV><A href="http://www.neznamadresu.com/astronomija"><FONT size=2></FONT></A> </DIV></TD></TR>
<TR>
<TD id=INCREDIFOOTER width="100%">
<TABLE cellSpacing=0 cellPadding=0 width="100%">
<TBODY>
<TR>
<TD width="100%"></TD>
<TD id=INCREDISOUND vAlign=bottom align=middle></TD>
<TD id=INCREDIANIM vAlign=bottom align=middle></TD></TR></TBODY></TABLE></TD></TR></TBODY></TABLE></BODY></HTML>