I have been updating some FORTRAN code that used Automation Objects (an in process server written in VB)- and had significant difficulty access routines using SafeArrays.
My first attempts used CVF 6.1 and failed. I finally attributed that failure to the lack of the INTENT(INOUT) attribute and updated to 6.6. I still had problems. The SafeArray of Unsigned Integers was defined as CHARACTER, DIMENSION(:), INTENT(INOUT)with the usual !DEC$ ATTRIBUTES REFERENCE in the function of the module the wizard generated. I could not get the compiler to even produce code as it complained of type mismatch.
After consulting some other users of similar ActiveX COM Objects, I convinced the author of this COM Object to make this function return a Variant rather than a SafeArray. Lo and behold, it worked. I have never liked imprecise declarations (yes I always use IMPLICIT NONE) - but have concluded (yet again)that you need to let the system do what the designers intended. Variants seem to let you "get by" with somewhat loose or ill-defined interfaces.
Is this a reasonable conclusion and is there any reason to not use Variants as the preferred type for COM or Automation Work?
Anyone have any samples of accessing COM or Automation Objects from CVF?