Board index » delphi » Object does not support enumeration (IEnumVariant)

Object does not support enumeration (IEnumVariant)

Hi,

I have used the TEnumVariantCollection (provided by Binh Ly) and some of my
implementations work fine, others doesn't.  The faulty implementations gave
me : Object does not support enumeration (IEnumVariant).
Although, I checked all the code and compared the pieces that work with the
others and I couldn't find why it does not find the Get__NewEnum() function
in such situation.

Is there somebody with any suggestions or idea's ?

Thanks for your help,

Stefan.

 

Re:Object does not support enumeration (IEnumVariant)


What's about DISPID_NEWENUM (-4) ?

"Stefan De Grande" <s...@hemmis.be> a crit dans le message news:
3df49...@newsgroups.borland.com...

Quote
> Hi,

> I have used the TEnumVariantCollection (provided by Binh Ly) and some of
my
> implementations work fine, others doesn't.  The faulty implementations
gave
> me : Object does not support enumeration (IEnumVariant).
> Although, I checked all the code and compared the pieces that work with
the
> others and I couldn't find why it does not find the Get__NewEnum()
function
> in such situation.

> Is there somebody with any suggestions or idea's ?

> Thanks for your help,

> Stefan.

Re:Object does not support enumeration (IEnumVariant)


All the _NewEnum's have a dispID of -4.

The only difference of working code and non working code is the following
(my opinion, not stated yet)
One single object (item in the list) has the following construction :

  TCarItem = class(TAutoIntfObject, ICarItem, ICarItemIntern)
  private
    FCarItemIntern : ICarItemIntern;
  protected
    function  Get_Name: WideString; safecall;
  public
    property CarItemIntern : ICarItemIntern read FCarItemIntern implements
ICarItemIntern;
    constructor Create(ClassOwner : TCarItem);
    destructor Destroy; override;
  end;

The ICaritem is declared in my typelibrary, where the ICarItemIntern is not
declared in the typelibrary, but managed in the code as :

ICarItemIntern = interface
    ['{EC8C2DA2-462A-4431-9F84-C6EE86DB5AD8}']
   function GetClassOwner : TCarItem;
    property ClassOwner : TCarItem read GetClassOwner;
  end;

Stefan.

Other Threads