Outlook Security Manager with Cpp

Add-in Express™ Support Service
That's what is more important than anything else

Outlook Security Manager with Cpp
 
Lucas Sanches




Posts: 18
Joined: 2010-12-30
How I can use OSM with C++?

I'm developing a COM Addin.


Thank you.
Posted 30 Dec, 2010 07:24:15 Top
Eugene Astafiev


Add-in Express team


Posts: 8540
Joined: 2007-07-25
Hi Lucas,

I suppose you have downloaded the ActiveX edition of the Outlook Security Manager component. Please use the following declaration in the beginning of the file (most probably you will have to correct the path for the import statement):

#import "c:\Program Files\Add-in Express\Security Manager for Microsoft Outlook, ActiveX\Redistributables\osmax.ocx" no_namespace

Then in the code you can use the following statements:

IOutlookSecurityManagerPtr mSecurityManager;

mSecurityManager.CreateInstance("AddInExpress.OutlookSecurityManager");
mSecurityManager->PutDisableOOMWarnings(TRUE);

.....................

mSecurityManager->PutDisableOOMWarnings(FALSE);
mSecurityManager.Release();


Please let me know whether it works for you.
.NET, Extended MAPI, Windows Phone & RT
Posted 03 Jan, 2011 10:07:05 Top
Lucas Sanches




Posts: 18
Joined: 2010-12-30
Its works on develop. machine with Outlook 2007.

I tried run under Outlook XP (2002)
But no success. Outlook crash with this error:
http://img607.imageshack.us/i/asdads.png/

My code is this:

	this->mSecurityManager.CreateInstance("AddInExpress.OutlookSecurityManager"); 
	this->mSecurityManager->ConnectTo(this->spApplication);
Posted 17 Jan, 2011 11:46:08 Top
Renat Tlebaldziyeu


Add-in Express team


Posts: 132
Joined: 2010-02-15
Hi Lucas,

If you develop an addin project you don't need to use the ConnectTo method of Outlook Security Manager. You need to use this method when you create a new Outlook application instance.
Please try to comment out the line with the ConnectTo method in your code. Did it help?
Posted 18 Jan, 2011 04:22:44 Top
Lucas Sanches




Posts: 18
Joined: 2010-12-30
OK.

Yeah, this works.

But now, I get an error at this line

this->mSecurityManager->PutDisableOOMWarnings(TRUE);


This is error:
http://img841.imageshack.us/i/erro.gif/
Posted 18 Jan, 2011 05:11:32 Top
Renat Tlebaldziyeu


Add-in Express team


Posts: 132
Joined: 2010-02-15
Hi Lucas,

Could you please send me a sample project that reproduces the issue (please see readme.txt for the e-mail address and make sure your e-mail contains a link to this topic)?
Posted 18 Jan, 2011 06:44:44 Top
Lucas Sanches




Posts: 18
Joined: 2010-12-30
Yes.

I've already send.

I'll wait for your contact.

Thank you.
Posted 18 Jan, 2011 06:53:40 Top
Renat Tlebaldziyeu


Add-in Express team


Posts: 132
Joined: 2010-02-15
Hi Lucas,

Thanks, but I can't build your project on my PC.
I have just tested another project on my virtual PC with Outlook 2002 and it works without any errors.

Please note that you need to have both secman.dll and osmax.ocx registered on the target PC.
Do you have both dlls registered?
Posted 18 Jan, 2011 08:00:58 Top
Lucas Sanches




Posts: 18
Joined: 2010-12-30
Yeah...
I had not secman.dll. I thought what only .ocx is necessary.

This work, but not completely.

I receive warning of outlook about contacts.

The plugin I used, is same I sent early to you.


The version of outlook is: 10.2627.2625



Thank you!
Posted 18 Jan, 2011 09:31:19 Top
Renat Tlebaldziyeu


Add-in Express team


Posts: 132
Joined: 2010-02-15
Hi Lucas,

If this worked for you on your developer PC with the ConnectTo method before, please try to use this method again and let me know about the results.
Posted 18 Jan, 2011 09:56:58 Top