add-in shim won't register on Word 2002

D

David Thielen

Hi;

I am having a problem registering my Word 2002 version of my shim on Word
2002.

I have created a copy of my Word 2003 version of my shim, change the name,
and generated different GUIDs. I built it and I can run it fine on my
development system which has Word 2003 on it.

I can also install my 2002 version on a test system that has just Windows XP
and Office 2002 loaded on it fine. The dll self registers fine and the add-in
runs fine. So I think the add-in must be ok.

However, when I go to install it on a test system that only has Word 2002, I
get "AutoTagShim2002.dll failed to register. HRESULT -2147024770."

When I run "regsvr32 AutoTagShim2002.dll" I get
"LoadLibrary("AutoTagShim2002.dll")failed - The specified module could not be
found"

Any idea what is going on? Again, the only difference between registering ok
and failing is one system has Office 2003 installed and the other Office
2002. (This is a newly created test environment so it is Windows XP, Office
(Word & Excel only) - and that is it. All service packs and updates applied.)

thanks - dave
 
F

Fredrik Wahlgren

David Thielen said:
Hi;

I am having a problem registering my Word 2002 version of my shim on Word
2002.

I have created a copy of my Word 2003 version of my shim, change the name,
and generated different GUIDs. I built it and I can run it fine on my
development system which has Word 2003 on it.

I can also install my 2002 version on a test system that has just Windows XP
and Office 2002 loaded on it fine. The dll self registers fine and the add-in
runs fine. So I think the add-in must be ok.

However, when I go to install it on a test system that only has Word 2002, I
get "AutoTagShim2002.dll failed to register. HRESULT -2147024770."

When I run "regsvr32 AutoTagShim2002.dll" I get
"LoadLibrary("AutoTagShim2002.dll")failed - The specified module could not be
found"

Any idea what is going on? Again, the only difference between registering ok
and failing is one system has Office 2003 installed and the other Office
2002. (This is a newly created test environment so it is Windows XP, Office
(Word & Excel only) - and that is it. All service packs and updates applied.)

thanks - dave

Have you made any changes to the DllRegister function or the rgs file?
/ Fredrik
 
D

David Thielen

Hi;

In the rgs file I generated a different set of CLSIDs and the root key name
is different. No change in the file that has DllRegister in it.

But if that was the issue, wouldn't it fail to install on Office 2003 too?

thanks - dave


:

....
 
F

Fredrik Wahlgren

Hi Dave

Well, the problem seems to be that the dll somehow depends directly or
indirectly on something that comes with Office 2003. Another possibility is
registry corruption. I think it's quite possible that the dll did some - but
not all - entries in the registry at some point. I have noticed that this
partial registration may prevent future registrations to be successful. In a
dll that I made, I came up with the idea of calling DllUnregisterServer
before calling DllRegisterServer. You may want to try the /u switch with
regsvr32 and then try to register the shim dll again.

/ Fredrik
 
D

David Thielen

Hi;

I just tried that (good idea) but no luck. Same error on the unregister.

I have a multi-boot test machine so if I boot to my system with Office 2003
installed and go to the install shim dll, I can regsvr32 it fine (both
register and unregister).

If I boot to the system with Office 2002 installed - I get the error.

This is the exact same file on the disk. So it has to be something external
to the file. Both systems are just installed a week ago with nothing but
Windows XP professional and Office - all updates & service packs for each.

Any other ideas?

thanks - dave
 
D

David Thielen

I did a dumpbin /imports and the only dlls it wants (all of which are on my
system) are:
mscoree.dll
kernel32.dll
user32.dll
advapi32.dll
ole32.dll
oleaut32.dll
shlwapi.dll
msvcr71.dll

help!!!

thanks - dave
 
D

David Thielen

Hello;

Ok, I've found out why I have this problem. But still no idea how to fix it.

On my system that I installed Office 2003 on, msvcr71.dll is installed in
the following directories:
c:\windows\Microsoft.NET\Framework\v1.1.4322
c:\windows\system32
c:\windows\system32\URTTemp

On my systems that I installed Office XP and the system I installed Office
2000 on it is in just these directories:
c:\windows\Microsoft.NET\Framework\v1.1.4322
c:\windows\system32\URTTemp

It's missing from c:\windows\system32. When I copied msvcr71.dll to
c:\windows\system32 then regsvr32 works fine.

However, telling people to copy this file before running the install won't
cut it. So the question is - what's going on and why is this dll not in
c:\windows\system32?

thanks - dave
 
P

Peter Huang

Hi

I think that may be caused by that the office 2002 and office 2003 need
different dependent file.
e.g. office 2002 PIA and office 2003 PIA is different. The office 2002 com
dll(mso.dll) is different from the office 2003 one.
So I think it is better to rerun the shim wizard to produce a 2002 version
shim addin.

Thanks!

Best regards,

Peter Huang
Microsoft Online Partner Support

Get Secure! - www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no rights.
 
D

David Thielen

From the Microsoft web site:
An application should use and redistribute msvcr71.dll, and it should avoid
placing a copy or using an existing copy of msvcr71.dll in the system
directory. Instead, the application should keep a copy of msvcr71.dll in its
application directory with the program executable. Any application built with
Visual C++ .NET using the /MD switch will necessarily use msvcr71.dll.

So... Why does the shim article not tell you to redistribute this file? And
if it is not supposed to go in system32, why is Office installing it there?

And can I set the shim to static link to this library instead? And if so
how? I looked at the project properties and it is not explicitly linking to
msvcrt.lib so it must be pulled in automatically - but I can't find where to
set that as a static link.

thanks - dave
 
D

David Thielen

Hi;

There is no shim wizard. You are given a project that you add and edit.
Also, as you can see from my other posts, it appears to be an issue with the
CRT library.

??? - dave
 
F

Felix Wang

Hi Dave,

The file "msvcrt71.dll" is the latest version of C runtime. Generally the
library is needed for applications created with VC++ .Net 2003. Some latest
version of Microsoft products have included the file in their Setup
packages, including Office 2003.

I believe the problem can be solved by including the file "msvcr71.dll" in
your deployment package.

Regards,

Felix Wang
Microsoft Online Partner Support
Get Secure! - www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.
 
D

David Thielen

Hi;

1. Can I statically link to the file instead? If so, what project property
settings change (I couldn't find it)?

2. If not, do I install this file in system32 as Office 2003 does, but as
Microsoft says not to? Or do I install it in my add-in directory as Microsoft
says to, but as Office does not?

thanks - dave
 
F

Fredrik Wahlgren

Is there a list of functions implemented in this dll? Is it possible not to
include it at all?

/ Fredrik
 
D

David Thielen

Hi;

Found the solution - in the compiler (not linker) properties set it to use
the statically linked CRT instead of the dynamically linked one. Adds about
60K to the dll size and eliminates the dependency on msvcr71.dll.

Could someone at MS please tell the shim author about this and have them
update the KB article on it to either tell people to distribute msvcr71.dll
also or statically link the CRT.

thanks - dave
 
F

Fredrik Wahlgren

Nice catch.

/ Fredrik

David Thielen said:
Hi;

Found the solution - in the compiler (not linker) properties set it to use
the statically linked CRT instead of the dynamically linked one. Adds about
60K to the dll size and eliminates the dependency on msvcr71.dll.

Could someone at MS please tell the shim author about this and have them
update the KB article on it to either tell people to distribute msvcr71.dll
also or statically link the CRT.

thanks - dave
 
Top