Tuesday, May 20, 2008

POOM: 'unresolved external symbol' or 'already defined'

Often when we use POOM api's we get those errors by compiler.
We have two methods to fix it:

solution a
- include only where you need;
- include into only one .cpp file:
#define INITGUID
#include <initguid.h>
#include <pimstore.h>
#pragma comment(lib, "pimstore.lib") //don't forget to link library ;)


solution b
- include where you need:
#include <pimstore.h>
#pragma comment(lib, "pimstore.lib") //don't forget to link library ;)

- replace the IID_* and CLSID_* with the __uuidof([interface]) sentence
so:
CLSID_Application ==> __uuidof(Application)
IID_IItem ==> __uuidof(IItem)
IID_IPOutlookApp ==> __uuidof(IPOutlookApp)
and so on...



I hope this help you

1 comment:

sangza said...

Thank you so much. This post help me solve my problem.