Crash Using an Array Of Struct (.Net Call)
Abder
Montreal,

Oct 5, 2009
7 Posts

Crash using an array of struct (.Net call)

I'm trying to retreive an array of struct from a .Net call. I'm using the following example
public  myClass
{  

      public DuWord[] Processing ()
        {
           DuWord[] buffer = new DuWord[10];

       buffer[0].Data =1;    
       buffer[1].Data =2;    
       buffer[2].Data =3;    
      
           return buffer;
        }
        public struct DuWord
        {
            public UInt32 Data;
            public UInt32 Label;
            public UInt32 Ident;
            public UInt32 TimeStamp;
        }
}

ATEasy

cls1= new myClass()

cls1.Processing ()  
I have a crash with error Code #420 "Object method or property failed: the parameter is incorrect.
Could you please help me.

DrATEasy (Ron Y.)
Mission Viejo,

Oct 5, 2009
235 Posts

Re: Crash using an array of struct (.Net call)

The problem is with the return type converted by .NET to a variant with VT_ARRAY or VT_RECORD - which is not standard variant type for return. Try to change the struct to class, I think it will work.

Ronnie



Please Note
You need to have a M@GIC account to participate in the Forums.
Not yet registered on our website? Click here to register today!

All content, information and opinions presented on the Marvin Test Solutions User Forums are those of the authors of the posts and messages and not Marvin Test Solutions'. All attachments and files are downloaded at your own risk. [Read More]