Delete a MAPI folder on Uninstall

  • Thread starter Thread starter zen
  • Start date Start date
Z

zen

Hi

I'd like to delete a MAPI folder (that is one my plugin created in outlook)
when I uninstall my plugin... but I can't create an instance of
Outlook.Application in my DllUnregisterServer function to get outlook to
delete it ( it returns Module not found ).
It works in a normal .exe, but not from my own dll

STDAPI DllUnregisterServer(void)
{
CLSID clsid;
HRESULT hr = ::CLSIDFromProgID(L"Outlook.Application", &clsid);
//returns happy

CComPtr <Outlook::Application> outlookApplication;
hr = outlookApplication.CoCreateInstance(clsid);
// returns "The specified module could not be found"
}

Anyone know the secret?

Peace
~Zen
 
hah! Found it!

You need to set your own LoadBehavior to 0 in the registry first
(HKCU\\Software\\Microsoft\\Office\\Outlook\\Addins\\MyAddin\\LoadBehavior)
or Outlook tries to load you while you're trying to load it... violating
some law of molecular physics or something

Peace
~Zen
 
Back
Top