Link to home
Start Free TrialLog in
Avatar of Stephan Bourgeois
Stephan BourgeoisFlag for Canada

asked on

Strange problem

I have a stange problem. We have a batch of computer able to compile a code without any problem and a new batch rebuild with similar software at the exeption that Office 2010 has been installed, then uninstalled and replace by Office 2003.

The problem is related to a com typelib not loading properly, but I don't know how or where to check.

This is code for a DLL and we are using Visual C++ 6 Enterprise
The OS is Windows XP SP3 with the latest patch.

The following are the errors shown while I build the project

FieldContainer.cpp
c:\temp\irsparser\irsparserengine\debug\vbe6ext.tlh(212) : error C2146: syntax error : missing ';' before identifier 'CommandBars'
c:\temp\irsparser\irsparserengine\debug\vbe6ext.tlh(212) : error C2501: '__missing_type__' : missing storage-class or type specifiers
c:\temp\irsparser\irsparserengine\debug\vbe6ext.tlh(212) : error C2208: 'struct Office2003::CommandBars' : no members defined using this type
c:\temp\irsparser\irsparserengine\debug\vbe6ext.tlh(233) : error C2146: syntax error : missing ';' before identifier 'GetCommandBars'
c:\temp\irsparser\irsparserengine\debug\vbe6ext.tlh(233) : error C2501: '__missing_type__' : missing storage-class or type specifiers
c:\temp\irsparser\irsparserengine\debug\vbe6ext.tlh(255) : error C2061: syntax error : identifier '__missing_type__'
c:\temp\irsparser\irsparserengine\debug\vbe6ext.tli(32) : error C2143: syntax error : missing ';' before 'tag::id'
c:\temp\irsparser\irsparserengine\debug\vbe6ext.tli(32) : error C2433: '__missing_type__' : 'inline' not permitted on data declarations
c:\temp\irsparser\irsparserengine\debug\vbe6ext.tli(32) : error C2501: '__missing_type__' : missing storage-class or type specifiers
c:\temp\irsparser\irsparserengine\debug\vbe6ext.tli(32) : fatal error C1004: unexpected end of file found


Of course, the CommandBar is not recognized and all the following code are screw up.
Line 212 is thie first line of those following lines:
   __missing_type__ CommandBars;
    __declspec(property(get=GetCodePanes))
    _CodePanesPtr CodePanes;
    __declspec(property(get=GetWindows))
    _WindowsPtr Windows;
 
In VS 6 Enterprise, there is a tools to view the OLE/COM object.When I double click on Microsoft Visual Basic 6.0 Extensibility (Ver 5.3), I am getting an error as follow: Could not decompile selected ite. Error loading type library/DLL. TYPE_E_CANTLOADLIBRARY ($80029C4A)

On the computers where the build work fine, the OLEViewer open the typelib correctly.

I compare the files location and the registry and I can't find anything evident. I also use regtlib and reregister VBE6EXT.OLB, VBE6.DLLand MSO.DLL.

The import statements are:
#import "C:\\Program Files\\Common Files\\Microsoft Shared\\OFFICE11\\mso.dll" rename_namespace("Office2003")
using namespace Office2003;

#import "C:\\Program Files\\Common Files\\Microsoft Shared\\VBA\\VBA6\\VBE6EXT.olb" rename_namespace("VBE6")
using namespace VBE6;

#import "C:\\Program Files\\Microsoft Office\\Office11\\MSWORD.olb" \
rename("ExitWindows","MyExitWindows"),named_guids, rename_namespace("Word")
using namespace Word;

#import "C:\\Program Files\\Microsoft Office\\Office11\\XL5EN32.olb" \
rename("DialogBox","DialogBox2"),named_guids, rename_namespace("Excel")
using namespace Excel;

Really need help on that one.

Thanks
Avatar of Norm Dickinson
Norm Dickinson

When you installed the later version of Office, many files may have been replaced, registry settings changed, system files updated, etc. When you uninstall, it may not remove all of them. It is not necessarily the same computer as before you installed it and still has some remnants of Office 2010 behind.


One possibility: Look in the C:\Program Files\Microsoft Office folder to see if there is a subfolder named "Office 14" and perhaps you will find some of the missing files there. Make the appropriate change from Office 11 to Office 14 in your code to find the missing files.

Another possibility: Reinstall Office 2010 as an additional program, leaving Office 2003 intact. (If you never launch it you will not have to activate it.)
Avatar of Stephan Bourgeois

ASKER

I am pretty sure that the problem is the OLE/COM VBE6EXT that is not loading properly.

[HKEY_CLASSES_ROOT\TypeLib\{0002E157-0000-0000-C000-000000000046}\5.3]
"PrimaryInteropAssemblyName"="Microsoft.Vbe.Interop, Version=11.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c"
@="Microsoft Visual Basic for Applications Extensibility 5.3"

[HKEY_CLASSES_ROOT\TypeLib\{0002E157-0000-0000-C000-000000000046}\5.3\0]

[HKEY_CLASSES_ROOT\TypeLib\{0002E157-0000-0000-C000-000000000046}\5.3\0\win32]
@="C:\\Program Files\\Common Files\\Microsoft Shared\\VBA\\VBA6\\VBE6EXT.OLB"


Any trick to repair broken OLE/COM module?
I can't find much helpful information on that topic other than various levels of advice to reinstall products or perform in-place upgrades. On that note I'll again say that reinstalling Office 2010 may be a viable option that is worth a try. Do a good backup first so you can roll back the changes if necessary. On that I like to use a hard drive cloning tool or duplicator to make an exact sector by sector copy of a hard drive, and then use the destination copy for experimentation. That keeps my hard drive intact and on the shelf to quickly drop back into the machine should things turn out wrong.
This morning, I uninstalled all Office 2003 apps and Microsoft Visual Studio 6 Enterprise.
I cleanup the disk and the registry of all reference to any VBA6 or OFFICEXX.

I restarted the system, I am assuming that the hard drive is clean from any VB6 typelib or Office 2003 typelib.

Office 2010 has never been installed on the working PC at the exception of the Compatibilty pack.

The working PC has often freezes for a couple of minutes, thats why we don't want to go with this build.

When I look at external depencies in Visual Studio, I am missing the following
mso.dll, msword.olb, vbe6ext.olb, xl5en32.olb

The compilation error:
error C2772: #import referenced a type from a missing type library; '__missing_type__' used as a placeholder

The line where the error occured:
#import "C:\\Program Files\\Common Files\\Microsoft Shared\\VBA\\VBA6\\VBE6EXT.olb" rename_namespace("VBE6")
using namespace VBE6;
I had assumed Office 2010 had been installed and uninstalled, as this is what you stated in your original post. I don't know if this will help?
http://msdn.microsoft.com/en-us/library/aa449281.aspx
Office 2010 has been installed and uninstall, but the required type library is from Office 2003. I really did a deep cleanup to remove all reference to Office 2010 and 2003 before reinstalling Office 2003.

The secondary type is:
__missing_type__ CommandBars;

But I really don't know why it is not registering properly, since I reinstall everything from a cleaned state.
Can you compare the computers that work with the ones that don't to find what is different with file versions, registry settings, etc.?
I tried that, but the working computer is not really the same and I don't know where to compare.

By googling, the problem is for sure in the mso.dll file. This Type library refuse to load.

I am currently searching all the disk for any MSO.DLL that might be located somewher else.
Or this looks even more promising...
http://support.microsoft.com/kb/2516475
I just install VS C++ 6 on a fresh new XP and Office 2003 and the workspace is building correctly.

I would prefer to put my finger on the problem since I have many computers to rebuild and there is a lot of devellopement applications to install and finetune.

Again, Office 2010 should not be loaded on those computers.
There's always paid Microsoft support - they can guide you thru the inner workings and find stuff like that when nobody else can.
I will install the 137 Windows updates. That might fixed the problem.

If not, I will call Microsoft or rebuild the system from scratch.
ASKER CERTIFIED SOLUTION
Avatar of Stephan Bourgeois
Stephan Bourgeois
Flag of Canada image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
None of the other solutions helped to fix the issue.