About error MIDL2337 : unsatisfied forward declaration

Â

ÂËÉ«¾µ

in my idl file, i define a user-define data type as bollow:
typedef struct RasterFileHeader
{
DWORD dwVersion;
LONG nDataOffset;
LONG nBandCount;
LONG nWidth;
LONG nHeight;
enum PixelDataTypeEnum ePDType; // it's a enum type import from another
tlb by importlib(...)
enum ImageModeEnum eImageMode; // it's a enum type import from another
tlb by importlib(...)
LONG nTileWidth;
LONG nTileHeight;
double dResolutionX;
double dResolutionY;
double dOrgX;
double dOrgY;
double dDPIX;
double dDPIY;
double dInvalidValue;
LONG nReserve1;
LONG nReserve2;
LONG nReserve3;
} RasterFileHeader;

when complied, it comes to the error:"error MIDL2337 : unsatisfied forward
declaration".

i has found out that
 
Â

ÂËÉ«¾µ

i has found out that
when i comment the above two enum data type
// enum PixelDataTypeEnum ePDType;
// enum ImageModeEnum eImageMode;

then compile it again, it works without errors.

Is there anybody tell me why?

thanks!
colorfilter
 
A

Alex Buell

when i comment the above two enum data type
// enum PixelDataTypeEnum ePDType;
// enum ImageModeEnum eImageMode;

You need to give the values for the enumeration, i.e., enum
PixelDataTypeEnum { 8bit, 16bit, 24bit }, or include the definitions
for ePDType and eImageMode from elsewhere.
 
B

benben

ÂËÉ«¾µ said:
in my idl file, i define a user-define data type as bollow:
typedef struct RasterFileHeader
{
DWORD dwVersion;
LONG nDataOffset;
LONG nBandCount;
LONG nWidth;
LONG nHeight;
enum PixelDataTypeEnum ePDType; // it's a enum type import from another
tlb by importlib(...)
enum ImageModeEnum eImageMode; // it's a enum type import from another
tlb by importlib(...)
LONG nTileWidth;
LONG nTileHeight;
double dResolutionX;
double dResolutionY;
double dOrgX;
double dOrgY;
double dDPIX;
double dDPIY;
double dInvalidValue;
LONG nReserve1;
LONG nReserve2;
LONG nReserve3;
} RasterFileHeader;

when complied, it comes to the error:"error MIDL2337 : unsatisfied forward
declaration".

i has found out that

Judging the error name it seems that the above is MIDL code not C++, or
you are compiling with a wrong compiler. But, that is just my guess so I
can be wrong.

Ben
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,743
Messages
2,569,478
Members
44,898
Latest member
BlairH7607

Latest Threads

Top