Error: ocx file unable to register

P

pranav.js

Hi,
I am working on an Outlook AddIn which is developed for Outlook 2003
on VS 2005. The problem with this AddIn is - it is not working in some
systems. So, now I am trying to debug it in VS 2008.
This project has a module developed in VB, which contains code related
to creation of registries and all that. It is MyPluginControl.ocx.
converter this to Interop.MyPluginControl.dll using tlbimp and added
it to my project.
When I try to execute this, it is giving error that
"MyPluginControl.ocx is not registered".

Please enlighten me what is going on and suggest possible work
arounds.

Thanks in advance!
 
K

Ken Slovak - [MVP - Outlook]

Is the OCX still being used? Did you register it using regsvr32 or by some
other method?

What is this MyPluginControl.dll doing? Does it call to the OCX or what?
 
P

pranav.js

Yes. Interop.MyPluginControl.dll will use the ocx file in runtime.
I have added this ocx file as a reference to my project.
I also gave Full Trust to this dll file using caspol security policy.
Still, its giving error stating that unable to register cdo.dll and
myplugincontrol.ocx

I have installed the plug-in in client`s system and tried to register
these files using regsvr32 manually.
But, they are not registering. I got the following error numbers for
the two files.
CDO.dll - 0x80040200
MyPluginControl.ocx - 0x80004005

Please suggest an approach to solve this problem!


Thanks and Regards,
Pranav
 
K

Ken Slovak - [MVP - Outlook]

CDO is not supported for use with managed code. So don't use it. Re-do your
OCX to be a managed code form or control instead of an OCX.

It is also illegal to distribute CDO.DLL, which is matched to the version of
Outlook. It should only be installed from the Office CD or from the MS
download, depending on version.

Any OCX should be able to be registered using regsvr32, although on Vista
you run into UAC and permissions issues. In that case an admin logon would
be needed to register the OCX using regsvr32 or a script or whatever.
 
P

pranav.js

Thanks for enlightening me!

I have downloaded the ExchangeCdo.exe from microsoft site and tried to
install it in client system. But, it gave an error saying - "Microsoft
Office 2007" should be installed to install CDO 1.2.1" and exited. I
have developed Add-In for Outlook 2003.

When registered in Elevated Command Prompt, MyPluginControl.ocx has
registered.
But, my add-ins are not displayed in outlook.

The plug-in is unchecked in the COM AddIns list in outlook. I tried to
check it. No luck. It is showing the same error.

Location : "c:\Program Files\Common Files\Microsoft Shared\VSTO
\8.0\AddIn.dll"
Load Behavior : "Not Loaded. Error occured while loading a COM
Plugin."

I have created a user with restricted permissions in the same
(problematic) system and installed my plugin in that. While
installation, it gave the same error about plugincontrol.ocx
registration. To my surprise, the plugin is loaded when I opened the
outlook. Not only this, all the other functionality in it is also
working fine. It is also working in administrator account.
The user which have problem is listed in administrator group and have
admin privileges. Still, it is getting problem with loading of
AddInLoader.

Will the user privileges effect the functionality of plugin? If so,
how can a normal(restricted) user is able to run it without any
errors?
What might be the reason for the abnormal behaviour of this AddIn?

I am tired and stressed in finding a solution for this... :(

Please educate me on whats happening!


Thanks and Regards,
Pranav
 
K

Ken Slovak - [MVP - Outlook]

As I said before, CDO is matched to the Outlook version it's intended for.
You cannot mix and match versions. For Outlook 2003 CDO must come from the
version on the Office CD, for 2007 it must come from that MS download. In
neither case are you legally allowed to deploy CDO yourself.

In addition to not being supported for use with managed code (if you have
problems no one will help you), CDO is also very strict as to Outlook
security. I would very strongly recommend not using CDO with managed code,
but that's your decision. Just don't complain when it breaks in the field at
a customer site.

I posted a number of suggestions about debugging load errors for managed
code, as well as some suggestions about dependencies for that OCX in the
thread you started in the installation group, which by the way has nothing
to do with creating installation packages.
 
P

pranav.js

Thanks for the suggestions Mr. Ken.
I have stopped that thread.

I have started working with VSTO since 20 days. And have learned many
things and from forums and learning...
More over, this project has been developed an year back! I am just
trying to debug it and solve problems in it!

As you suggested, I have removed cdo.dll from my project. How to know
that CDO.DLL is installed with office or not?

I have downloaded Dependency Walker. In that, it is showing an error
with a missing function DwmExtendFrameIntoClientArea in DWMAPI.dll.
I have searched for this in msdn forums. The easiest solution given in
that is uninstalling IE7. :)
Is there any other solution for this?

I am going through the fusion logs now.
This is my last trial for solving this! If this didn't work, I will
opt for converting my code to managed one, as you have suggested.

Thanks
Pranav
 
P

pranav.js

Thanks for the suggestions Mr. Ken.
I have stopped that thread.

I have started working with VSTO since 20 days. And have learned many
things and from forums and learning...
More over, this project has been developed an year back! I am just
trying to debug it and solve problems in it!

As you suggested, I have removed cdo.dll from my project. How to know
that CDO.DLL is installed with office or not?

I have downloaded Dependency Walker. In that, it is showing an error
with a missing function DwmExtendFrameIntoClientArea in DWMAPI.dll.
I have searched for this in msdn forums. The easiest solution given in
that is uninstalling IE7. :)
Is there any other solution for this?

I am going through the fusion logs now.
This is my last trial for solving this! If this didn't work, I will
opt for converting my code to managed one, as you have suggested.

Thanks
Pranav
 
K

Ken Slovak - [MVP - Outlook]

First of all, a VSTO addin is managed code, that's why I said not to use CDO
at all, as CDO is not supported for managed code. If you aren't using CDO
then it really doesn't matter if it's installed or not, does it?

I have no idea about that missing function or even why your code is using it
or for what. You can try to recode using some other method, but again I have
no idea why that's being called.

You also will have to look at why CDO is being used at all, and what you can
do to do whatever is being done using CDO some other way. Most of use
Redemption (www.dimastr.com/redemption) as a managed code safe substitute
for using CDO, but that's a 3rd party library.
 
P

pranav.js

Thanks Again, for your suggestions.
I will try to search the substitute and convert the total project to
managed one.

Get back to you if I get any errors again!

Regards,
Pranav
 
P

pranav.js

Hello sir, I have generated fusion log when running outlook after
installing my add-in. From this log, all the operations are successful
except mscorwks.dll
The detailed log of this file ( msosec, Version=7.0.5000.0,
Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a.HTM ) is as follows.
Please go through it and suggest a remedy!

*** Assembly Binder Log Entry (3/20/2009 @ 4:18:40 PM) ***

The operation failed.
Bind result: hr = 0x80070002. The system cannot find the file
specified.

Assembly manager loaded from: C:\WINDOWS\Microsoft.NET\Framework
\v2.0.50727\mscorwks.dll
Running under executable C:\PROGRA~1\MICROS~2\OFFICE11\OUTLOOK.EXE
--- A detailed error log follows.

=== Pre-bind state information ===
LOG: User = CRP19\Administrator
LOG: DisplayName = msosec, Version=7.0.5000.0, Culture=neutral,
PublicKeyToken=b03f5f7f11d50a3a
(Fully-specified)
LOG: Appbase = file:///C:/Program Files/Microsoft Office/OFFICE11/
LOG: Initial PrivatePath = NULL
LOG: Dynamic Base = NULL
LOG: Cache Base = NULL
LOG: AppName = OUTLOOK.EXE
Calling assembly : Microsoft.Office.Tools.Common, Version=8.0.0.0,
Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a.
===
LOG: This bind starts in default load context.
LOG: No application configuration file found.
LOG: Using machine configuration file from C:\WINDOWS\Microsoft.NET
\Framework\v2.0.50727\config\machine.config.
LOG: Post-policy reference: msosec, Version=7.0.5000.0,
Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
LOG: GAC Lookup was unsuccessful.
LOG: Attempting download of new URL file:///C:/Program Files/Microsoft
Office/OFFICE11/msosec.DLL.
LOG: Attempting download of new URL file:///C:/Program Files/Microsoft
Office/OFFICE11/msosec/msosec.DLL.
LOG: Attempting download of new URL file:///C:/Program Files/Microsoft
Office/OFFICE11/msosec.EXE.
LOG: Attempting download of new URL file:///C:/Program Files/Microsoft
Office/OFFICE11/msosec/msosec.EXE.
LOG: All probing URLs attempted and failed.
 
K

Ken Slovak - [MVP - Outlook]

The answer is right in front of you. Just google for "msosec" and read the
links that brings up.
 

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