Crash using an array of struct (.Net call)

Abder
Montreal,

Oct 5, 2009
7 Posts

0  |  0  

Re: 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, CA

Oct 5, 2009
368 Posts

0  |  0  

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

Yitzhak S.
Ramt Hasharon,

Jan 8, 2019
3 Posts

0  |  0  

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

DrATEasy (Ron Y.) wrote:
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


Hi,
I have number of .Net (dll) that dependency one on another,  when I  made variable of one them (just make a new object) i received Run time error "#420 Object method of property failed..." , if I cant change the return type of the object. there is any solution?

(I am use ATEasy 7.0)

Tanks



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]