Hello All, especially Thomas,

I'm running into a fairly serious snag calling a method that is supposed to
take a SAFEARRAY** as input.  The class generated from GetModule is

IIviSpecAnTrace._methods_ = [
    COMMETHOD([helpstring(u'This function returns the trace the spectrum
analyzer aquires.')], HRESULT, 'FetchY',
              ( ['in', 'out'], POINTER(_midlSAFEARRAY(c_double)),
'Amplitude' )),

<other methods omitted>

]


>From the header file its:

   public:
        virtual /* [helpcontext][helpstring] */ HRESULT STDMETHODCALLTYPE
FetchY(
            /* [out][in] */ SAFEARRAY __RPC_FAR * __RPC_FAR *Amplitude) = 0;



Everything was going swimmingly until I tried to use this function.  Here's
what I do:

In [305]: safe2 = (c_double*401)()

In [306]: safe2
Out[306]: <__main__.c_double_Array_401 object at 0x0292A670>

I tried manually creating the SAFEARRAY and passing it to the FetchY method,
but I got bounced because it looked like the underlying Python code was
constructing it for me.

However, the array, when returned, is filled with 0.0.  In fact, whatever I
fill the array with, it remains unchanged after the call.

I've verified things work correctly at the C++ level, and I've verified the
instrument is communicating and sending back the right values.  I'm
obviously buggering something up, but after a day and a half of
investigation, I have to admit I'm stumped.  I don't know enough about the
internals of comtypes to debug this, so I'm hoping Thomas can help me out.

Matt
-------------------------------------------------------------------------
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference 
Don't miss this year's exciting event. There's still time to save $100. 
Use priority code J8TL2D2. 
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
_______________________________________________
comtypes-users mailing list
comtypes-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/comtypes-users

Reply via email to