I
Interop newbie
Hello,
The following code makes an interop call to a Com object
from C#:
//Create a Bom object
NewsBusObjsRCW.NewsBomObjClass myNewsBom = new
NewsBusObjsRCW.NewsBomObjClass();
//Get the parts array
NewsBusObjsRCW.NewsPartObjClass[] myNewsPartArray =
myNewsBom.theNewsLocObject.theNewsRevObject.theNewsPartObje
ctArray;
When I do a build I get the following error:
Property, indexer, or event 'theNewsPartObjectArray' is
not supported by the language; try directly calling
accessor
methods 'NewsBusObjsRCW._NewsRevObj.get_theNewsPartObjectAr
ray()'
or 'NewsBusObjsRCW._NewsRevObj.set_theNewsPartObjectArray
(ref NewsBusObjsRCW.NewsPartObj[])'
The interop calls work fine for other attributes of the
NewsRevObj (the following code works fine):
string myName =
myNewsBom.theNewsLocObject.mtheNewsRevObject.theName
There is a problem with returning an array of objects.
Can anyone help me out with this?
Thanks,
Dave
The following code makes an interop call to a Com object
from C#:
//Create a Bom object
NewsBusObjsRCW.NewsBomObjClass myNewsBom = new
NewsBusObjsRCW.NewsBomObjClass();
//Get the parts array
NewsBusObjsRCW.NewsPartObjClass[] myNewsPartArray =
myNewsBom.theNewsLocObject.theNewsRevObject.theNewsPartObje
ctArray;
When I do a build I get the following error:
Property, indexer, or event 'theNewsPartObjectArray' is
not supported by the language; try directly calling
accessor
methods 'NewsBusObjsRCW._NewsRevObj.get_theNewsPartObjectAr
ray()'
or 'NewsBusObjsRCW._NewsRevObj.set_theNewsPartObjectArray
(ref NewsBusObjsRCW.NewsPartObj[])'
The interop calls work fine for other attributes of the
NewsRevObj (the following code works fine):
string myName =
myNewsBom.theNewsLocObject.mtheNewsRevObject.theName
There is a problem with returning an array of objects.
Can anyone help me out with this?
Thanks,
Dave