Question

I have a large project in C++ Builder that seems to have used the function Import Type Library. In it is a file with a header like this

// ************************************************************************ //
// WARNING                                                                    
// -------                                                                    
// The types declared in this file were generated from data read from a       
// Type Library. If this type library is explicitly or indirectly (via        
// another type library referring to this type library) re-imported, or the   
// 'Refresh' command of the Type Library Editor activated while editing the   
// Type Library, the contents of this file will be regenerated and all        
// manual modifications will be lost.                                         
// ************************************************************************ //

// C++ TLBWRTR : $Revision:   1.134.1.41  $
// File generated on 2003-10-27 12:57:05 from Type Library described below.

// ************************************************************************ //
// Type Lib: C:\WINNT\system32\MQOA.DLL (1)
// IID\LCID: {D7D6E071-DCCD-11D0-AA4B-0060970DEBAE}\0
// Helpfile: 
// DepndLst: 
//   (1) v2.0 stdole, (C:\WINNT\System32\stdole2.tlb)
//   (2) v4.0 StdVCL, (C:\WINNT\System32\STDVCL40.DLL)
// ************************************************************************ //
#ifndef   __MSMQ_OCX_h__
#define   __MSMQ_OCX_h__

#pragma option push -b -w-inl

#include <utilcls.h>
#if !defined(__UTILCLS_H_VERSION) || (__UTILCLS_H_VERSION < 0x0500)
//
// The code generated by the TLIBIMP utility or the Import|TypeLibrary 
// and Import|ActiveX feature of C++Builder rely on specific versions of
// the header file UTILCLS.H found in the INCLUDE\VCL directory. If an 
// older version of the file is detected, you probably need an update/patch.
//
#error "This file requires a newer version of the header UTILCLS.H" \
       "You need to apply an update/patch to your copy of C++Builder"
#endif
#include <olectl.h>
#include <ocidl.h>
#if !defined(_NO_VCL)
#include <stdvcl.hpp>
#endif  //   _NO_VCL
#include <ocxproxy.h>

...

As you can see this file was genereated quite long time ago :). I have been able to build this project using C++ Builder 2010 on Windows 7 64-bit. But when I install XE2 and try to fix all the small issues that arise since it now defaults to STRICT instead of NO_STRICT, I run into a totaly different issue. The above file, ad others generated in the same way, they no longer work as intended.

I get errors like

[BCC32 Error] MSMQ_OCX.h(66): E2090 Qualifier 'Oleserver' is not a class or namespace name

Looking for the MQOA.DLL it claims to have used nothing of the sort seems to exist. Does anyone have any pointers on how to get around these kind of problems when updating the project to XE2? The project has survived upgrades before and was lastley upgraded to C++ Builder 2010. But I'm more of a Visual Studio person so a lot of the Embarcadero stuff is new territory.

Was it helpful?

Solution

I ended up re-importing the type libraries needed and deleting the old ones, as suggested by Remy Lebeau. It was Microsoft's libraries for Message Queues and XML in my case.

Note that some other issues giving similar error messages CAN be that the compiler is just confused :). Try compiling without NO_STRICT defined.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top