Compile error with GetMessageA

24 views
Skip to first unread message

Ryan

unread,
May 25, 2016, 2:53:18 PM5/25/16
to PDFTron PDFNet SDK
Question:

When I write such code:

catch(pdftron::Common::Exception& ex)
{
    std
::cout << ex.GetMessage() << std::endl;
}


I get compilation error:

error C2039
: 'GetMessageA': is not a member of 'pdftron::Common::Exception'

Answer:

GetMessage is a windows macro, either


#define GetMessage GetMessageA

or
#define GetMessage GetMessageW

depending on unicode setting.

Before including the PDFNet headers, add the following

#undef GetMessage

If you need to also use the windows version, be explicit, for example 
::GetMessageA


Reply all
Reply to author
Forward
0 new messages