<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<META NAME="Generator" CONTENT="MS Exchange Server version 6.5.7651.59">
<TITLE>SIP Question (Not PyQT/PyKDE related)</TITLE>
</HEAD>
<BODY>
<!-- Converted from text/rtf format -->
<P><FONT SIZE=2 FACE="Arial">Hello,</FONT>
</P>
<P><FONT SIZE=2 FACE="Arial">I've been using SIP to wrap a closed source binary SDK for Linux I have, with quite a bit of success considering I don't know much of C++ (Kudos to the SIP team!).</FONT></P>
<P><FONT SIZE=2 FACE="Arial">Now I have a slight problem that I'm not sure to address so I'm wondring if someone could point me in the right direction.</FONT></P>
<P><FONT SIZE=2 FACE="Arial">I have the following signature:</FONT>
</P>
<P><FONT SIZE=2 FACE="Arial">LT_STATUS getDataByIndex(lt_uint32 index, const LTIMetadataRecord*& record) const;</FONT>
</P>
<P><FONT SIZE=2 FACE="Arial">Everything here is fine, except for that *& notation which I haven't come across before.</FONT>
</P>
<P><FONT SIZE=2 FACE="Arial">The example C++ code does something like this to use this method:</FONT>
</P>
<P><FONT SIZE=2 FACE="Arial"> for (i=0; i<numRecs; i++)</FONT>
<BR><FONT SIZE=2 FACE="Arial"> {</FONT>
<BR><FONT SIZE=2 FACE="Arial"> const LTIMetadataRecord* rec = NULL;</FONT>
<BR><FONT SIZE=2 FACE="Arial"> sts = db.getDataByIndex(i, rec);</FONT>
<BR><FONT SIZE=2 FACE="Arial"> ASSERT(LT_SUCCESS(sts));</FONT>
<BR><FONT SIZE=2 FACE="Arial"> </FONT>
<BR><FONT SIZE=2 FACE="Arial"> dumpRecord(*rec);</FONT>
<BR><FONT SIZE=2 FACE="Arial"> }</FONT>
</P>
<P><FONT SIZE=2 FACE="Arial">The problem for me is that LTIMetadataRecord does NOT have constructors. So I'm not sure what to pass getDataByIndex() for the second parameter.</FONT></P>
<P><FONT SIZE=2 FACE="Arial">I tried something like:</FONT>
</P>
<P><FONT SIZE=2 FACE="Arial">record = None</FONT>
<BR><FONT SIZE=2 FACE="Arial">db.getDataByIndex(index, record)</FONT>
<BR><FONT SIZE=2 FACE="Arial">print record</FONT>
</P>
<P><FONT SIZE=2 FACE="Arial">But "record" remains unchanged. Of course, I can't create an instance of LTIMetadataRecord, so I'm not sure how else to go about this.</FONT></P>
<P><FONT SIZE=2 FACE="Arial">Any have an idea, or ideally, a recipe? (Or maybe there's an example of something like this in PyQT/PyKDE?)</FONT>
</P>
<P><FONT SIZE=2 FACE="Arial">Any help would be much appreciated!</FONT>
</P>
<P><FONT SIZE=2 FACE="Arial">Thanks in advance,</FONT>
</P>
<P><FONT SIZE=2 FACE="Arial">Jean-François Doyon</FONT>
<BR><FONT SIZE=2 FACE="Arial">Data Dissemination Division | Division de la diffusion des données</FONT>
<BR><FONT SIZE=2 FACE="Arial">Data Management and Dissemination Branch | Direction de la gestion et de la diffusion des données</FONT>
<BR><FONT SIZE=2 FACE="Arial">Earth Sciences Sector | Secteur des sciences de la Terre</FONT>
<BR><FONT SIZE=2 FACE="Arial">Natural Resources Canada | Ressources naturelles Canada</FONT>
<BR><FONT SIZE=2 FACE="Arial">Ottawa, Canada K1A 0E9</FONT>
<BR><FONT SIZE=2 FACE="Arial">jdoyon@nrcan-rncan.gc.ca</FONT>
<BR><FONT SIZE=2 FACE="Arial">Telephone | Téléphone 613-992-4902</FONT>
<BR><FONT SIZE=2 FACE="Arial">Facsimile | Télécopieur 613-947-2410</FONT>
<BR><FONT SIZE=2 FACE="Arial">Teletypewriter | Téléimprimeur 613-996-4397</FONT>
<BR><FONT SIZE=2 FACE="Arial">Government of Canada | Gouvernement du Canada</FONT>
</P>
</BODY>
</HTML>