<?xml version="1.0" encoding="windows-1252"?>
<node id="935790" title="Re: Getting mixed real and integer data out of Win32::OLE Safearray" created="2011-11-03 18:30:06" updated="2011-11-03 18:30:06">
<type id="11">
note</type>
<author id="863652">
patcat88</author>
<data>
<field name="doctext">
Hmmmm. Not an Perl OLE expert, but, it seems GetPrecursorInfoFromScanNum returns a Variant array of C structs, not an variant array of integers according to the manual. Every example in the manual is C/C++, zero VB. Is your &lt;code&gt;
"Output:

$VAR1 = [
          '414.005279541016',
          '1.83302424514875e-307',
          '3.50253979763967e-310',
          '1.36817960845299e-312',
          '2.68156223007842e+154',
&lt;/code&gt;
even valid compared to Thermo's official viewer for the file?
&lt;br&gt;&lt;br&gt;
I think you need to try to get perl OLE to return an array of string, the strings will be binary garbage but should be 8+8+4+4 bytes long, then do an "unpack('FFll',$arr[[$i]]);" on it to decode the C struct. Try looking for Visual Basic code for your control and see how its done there.
&lt;code&gt;
typedef struct tagMS_PrecursorInfo {
        
double dMonoIsoMZ;
        
double dIsolationMZ;
        
long nChargeState;
        
long nScanNumber;
} MS_PrecursorInfo;
&lt;/code&gt;
I pulled that from the IDL inside your control. Its described the same way in manual page for GetPrecursorInfoFromScanNum. Can you point me to a sample raw file for this control?
&lt;br&gt;&lt;br&gt;
Edit, try changing "my $arr = Variant( VT_VARIANT | VT_BYREF);" to 
" my $arr = Variant( VT_ARRAY | VT_BYREF);"</field>
<field name="root_node">
935769</field>
<field name="parent_node">
935769</field>
</data>
</node>
