Using secman.dll without registering it

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

Using secman.dll without registering it
 
Kristoffer Jansson




Posts: 5
Joined: 2011-09-06
I'm trying to use secman.dll by placing it alongside my .exe file but I get the following error when calling ConnectTo():

Value does not fall within the expected range.

Am I doing something wrong? If I register secman the code works. However, this is not possible as Outlook Security Manager is used within a plugin which the main application load at runtime. So there's no install that could register secman.dll.

Another requirement is that it all has to be done under user privileges, and registering secman.dll requires administrator rights.
Posted 06 Sep, 2011 12:42:13 Top
Kristoffer Jansson




Posts: 5
Joined: 2011-09-06
To clarify: The plugin (which is calling Outlook Security Manager) is just a simple DLL file which is placed in a specified folder by the user (no install package or anything).
Posted 06 Sep, 2011 12:44:40 Top
Renat Tlebaldziyeu


Guest


Hello Kristoffer,

What version (with build number and edition, please) of Outlook Security Manager do you use?
Posted 07 Sep, 2011 02:02:26 Top
Kristoffer Jansson




Posts: 5
Joined: 2011-09-06
Security Manager 2010 for Microsoft Outlook® .NET Edition

Version: 6.1
Build: 3016
Posted 07 Sep, 2011 04:08:51 Top
Renat Tlebaldziyeu


Guest


Thank you for the details, Kristoffer.

Does your application work as the MTA or STA thread?

To deploy your project without registering Security Manager dlls, please execute the following steps:
1. Include the SecurityManager.2005.dll assembly in your setup package. This assembly should be placed into a folder where all your deployed assemblies are located.
2. Include two redistributable libraries ?Â?Ð?ã secman.dll and secman64.dll ?Â?Ð?ã put them either into the shared folder of Windows, ?Â?Ð?ì[Common Files Folder]\Outlook Security Manager?Â?Ð?í or into your application folder.
3. That?Â?Ð?és all. You don?Â?Ð?ét need to register any dlls.

Does this work for you?
Posted 07 Sep, 2011 04:24:19 Top
Kristoffer Jansson




Posts: 5
Joined: 2011-09-06
It seems the problem occurs when I'm using OSM in a BackgroundWorker thread.
Posted 07 Sep, 2011 04:51:30 Top
Kristoffer Jansson




Posts: 5
Joined: 2011-09-06
I managed to work around the problem by spawning another thread in STA apartment state from within the BackgroundWorker. Thanks for the tip!
Posted 07 Sep, 2011 05:11:49 Top
Renat Tlebaldziyeu


Guest


Good news, Kristoffer!
Thank you for letting me know.
Posted 07 Sep, 2011 05:20:09 Top