>Ed,
>
>Thanks for your reply. The class declaration is OLEPUBLIC and is straight out of an example which MSDN suggests we use to get a feel of COM functions in version 6.0, namely, ArrayCom.exe. I shall however delve deeper into the matter and let you know. If there's a bug out there, in ArrayCom.exe that is, it will out!
Did you compile the class into a .DLL or .EXE and invoke it by its ProgID? If so, then COMARRAY() works. If you instantiate the class from a .VCX or .PRG in your code rather than by ProgID, then there's no OLE interface, and COMARRAY() won't work. COMARRAY() only works on OLE Objects, not on VFP objects instantiated from class declarations in code or .VCX, even if they are declared OLEPUBLIC.
IOW, if I create a class, declare it OLEPUBLIC, compile it to a .DLL or .EXE and invoke it with CREATEOBJ() using the ProgID, COMARRAY() will function correctly. If I do a CREATEOBJ from the class declaration inside VFP, COMARRAY() won't work. I just tried this on one of my own COM objects here to confirm the behavior.