Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Export (0) Print
Expand All
Expand Minimize
Important This document may not represent best practices for current development, links to downloads and other resources may no longer be valid. Current recommended version can be found here.

Compiler Warning (level 1) C4929

Error Message

'file': typelibrary contains a union; ignoring the 'embedded_idl' qualifier

The embedded_idl attribute of #import could not be applied to the type library because a union is present in the type library. To resolve this warning, don't use embedded_idl.

Example

The following sample defines a component.

// 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; }
};

The following sample generates C4929.

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

Community Additions

ADD
Show:
© 2015 Microsoft