Delete a MAPI folder on Uninstall

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
 
Z

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top