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>

Comments

Cyde Weys said…
Thanks for the post, this successfully resolved my error, and in far less time than if I had tried to figure out this seemingly random order on my own.
griffin said…
thx1e+6 for this
Alex said…
Thank you, I west a lot of time....

Popular posts from this blog

Clearcase check in/uncheck out all the checked out files script

MSSQL GROUP_CONCAT

Duplicating a local copy of project from TFS and making web software client factory to work