error LNK2001: unresolved external symbol _IID_IMessage
Often time, I encounter unresolved external symbol _IID_IMessage problem when I am trying to use IID_IMessage in my codes.
This is my solution to the problem, include and define in such sequence.
#define INITGUID
#define USES_IID_IMessage
#define USES_IID_IMAPIPropData
#define USES_IID_IMAPITable
#include <initguid.h> //this is needed,
#include <mapiguid.h> //then this
#include <mapiform.h>
#include <objbase.h>
#include <mapix.h>
#include <mapitags.h>
#include <mapidefs.h>
#include <mapiutil.h>
#include <imessage.h>
This is my solution to the problem, include and define in such sequence.
#define INITGUID
#define USES_IID_IMessage
#define USES_IID_IMAPIPropData
#define USES_IID_IMAPITable
#include <initguid.h> //this is needed,
#include <mapiguid.h> //then this
#include <mapiform.h>
#include <objbase.h>
#include <mapix.h>
#include <mapitags.h>
#include <mapidefs.h>
#include <mapiutil.h>
#include <imessage.h>
Comments