Create COM Variants

    My code knows of several GUID's that all derive from a common interface:
IMyInterface.  The code is as follows:

    var
        v        : Variant;
        iCnt   : Integer;
    begin
      v := CreateCOMObject(myGUID) as IMyInterface;      //create the COM
using the GUID
      iCnt := v.Count;
    end;

    myGUID is equal to a COM called IPlugIn1, which is derived from
IMyInterface.  The CreateCOMObject function fails on an "interface not
supported" error.

    The closest to working has been if I use the code:
    var
        v        : IMyInterface;
        iCnt   : Integer;
    begin
      v := CreateCOMObject(myGUID) as IPlugIn1;      file://create the COM
using the GUID
      iCnt := v.Count;
    end;

    But this defeats the whole purpose, but does seem to show that IPlugIn1
does definitely derive from IMyInterface.

    Anyway... Help!  What am I not doing right?

-----------------------------------------------------------
Alex McIntosh