2012-02-09 30 views
0

我在C++ Builder中有一个大项目,似乎已经使用了函数导入类型库。在它是一个头文件这样导入的类型库不再工作

// ************************************************************************ // 
// 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> 

... 

正如你可以看到这个文件genereated相当长的时间以前:)。我已经能够使用C++ Builder 2010 on Windows 7 64位来构建此项目。但是,当我安装XE2并尝试修复因为它现在默认为严格而不是NO_STRICT出现的所有小问题,我遇到了一个完全不同的问题。上面的文件和其他人以相同的方式生成,他们不再按预期工作。

我得到这样的错误

[BCC32错误] MSMQ_OCX.h(66):E2090预选赛 'Oleserver' 不是 类或命名空间名称

寻找的MQOA。它声称它没有使用任何类似的东西似乎存在的DLL。将项目更新到XE2时,有没有人有过关于如何解决这些问题的指导?该项目在升级之前幸免于难,并被lastley升级到了C++ Builder 2010.但我更像是一个Visual Studio人,所以很多Embarcadero的东西都是新领域。

+2

您是否尝试过将TypeLibrary重新导入到XE2中,而不是重新使用旧的.h文件? – 2012-02-09 20:41:57

+0

我该怎么做?我以为我要查找使用的文件,例如** C:\ WINNT \ system32 \ MQOA.DLL **。但是这个文件在Windows 7中不存在。 – inquam 2012-02-10 08:11:24

+0

如果你没有安装该文件,那么即使你的项目编译好了,你如何期望你的应用程序在运行时使用TypeLibrary/Object? – 2012-02-10 19:43:21

回答

1

我结束了重新导入需要的类型库和删除旧的,如雷米Lebeau建议。这是微软的图书馆消息队列XML在我的情况。

请注意,一些其他问题给出类似的错误信息可以是编译器只是困惑:)。尝试编译时没有定义NO_STRICT