Ticket #40 (new defect)

Opened 6 months ago

Last modified 6 months ago

ECapeErrorDummy

Reported by: jasper Owned by: michelpons
Priority: minor Milestone:
Component: IDL files Version: 1.1
Keywords: Cc:

Description

Our 1.0 type lib contains an undocument interface: ECapeErrorDummy (IID = {678C0B07-7D66-11D2-A67D-00105A42887F})

This does not appear in the error common interface specification.

I noticed this interface appearing in the log between a property package and a PME - so at least one PME is querying for this interface.

More interestingly, it has only one member:

[
      odl,
      uuid(E076C784-9065-42B8-A0E2-47A7110235DA),
      helpstring("ECapeErrorDummy110 Interface"),
      dual,
      oleautomation
    ]
    interface ECapeErrorDummy110 : IDispatch {
        [id(0x00000001), propget, helpstring("property Name")]
        HRESULT dummy([out, retval] CapeErrorInterface110HR* name);
    };

This is defined as

    [
      odl,
      uuid(E076C784-9065-42B8-A0E2-47A7110235DA),
      helpstring("ECapeErrorDummy110 Interface"),
      dual,
      oleautomation
    ]
    interface ECapeErrorDummy110 : IDispatch {
        [id(0x00000001), propget, helpstring("property Name")]
        HRESULT dummy([out, retval] CapeErrorInterface110HR* name);
    };

    typedef [uuid(4B57A4DD-22F9-42B5-A896-44BFA1689074), version(1.0), public]
    eCapeErrorInterface110HR_tag CapeErrorInterface110HR;

    typedef [version(1.0)]
    enum {
        ECapeThrmPropertyNotAvailableHR = 0x8004051a
    } eCapeErrorInterface110HR_tag;

So it looks like this was introduced to 'extend' the error codes with a 1.1 error code ECapeThrmPropertyNotAvailableHR, which is subsequently incorrectly used (E&C therefore says: do not use it).

Error.IDL in the 1.1 thermo folder gives a short explanation:

// The ECapeErrorDummy110 interface is not intended to be used. It is only here to ensure that 
// the MIDL compiler exports the CapeErrorInterfaceHR enumeration. The compiler only exports 
// an enumeration if it is used in a method of an exported interface. 

It is puzzling to me why a PME would QI for this interface.

Change History

comment:1 Changed 6 months ago by jasper

Correction - this construct existed already in 1.0 - see Error.idl in the 1.0 folder. Same construct, a dummy interface that introduces an artificial reference to the error code enumeration.

comment:2 Changed 6 months ago by jasper

I do not think we should register these interfaces for interop.

Note: See TracTickets for help on using tickets.