Compilerwarnung (Stufe 1) C4929

'Datei': Die Typbibliothek enthält eine Union. Der 'embedded_idl'-Qualifizierer wird ignoriert.

Das embedded_idl-Attribut von #import konnte nicht auf die Typbibliothek angewendet werden, da sich in ihr eine Union befindet. Verwenden Sie embedded_idl nicht, um diese Warnung zu umgehen.

Beispiel

Das folgende Beispiel legt eine Komponente fest.

// C4929a.cpp
// compile with: /LD /link /TLBOUT:C4929a.tlb
#include <objbase.h>
[module(name="Test")];
[public, switch_type(short)] typedef union _TD_UNION_TYPE   {
   [case(24)]
      float fM;
   [case(25)]
      double dMN;
   [default]
      int x;
} TD_UNION_TYPE;

[export, public] typedef struct _TDW_TYPE {
   [switch_is(sU)] TD_UNION_TYPE w;
      short sU;
} TD_TYPE;

[object, uuid("00000000-0000-0000-0000-000000000001")]
__interface I {
   HRESULT f(TD_TYPE*);
};

[coclass, uuid("00000000-0000-0000-0000-000000000002")]
struct C : I {
   HRESULT f(TD_TYPE*) { return 0; }
};

Im folgenden Beispiel wird C4929 generiert.

// C4929b.cpp
// compile with: /c /W1
#import "C4929a.tlb" embedded_idl   // C4929