4

我正在尝试在 Delphi XE 中重构一个 Delphi 5 项目,为此我需要修复一个名为 BrowseDr 的单元中的一些错误。我得到的错误是

[DCC Error] BrowseDr.pas(1033): E2033 Types of actual and formal var parameters
 must be identical

line 1033:   SHGetMalloc(FShellMalloc);

“MyShlObj”:

//SHGetMalloc declaration 
function SHGetMalloc(var ppMalloc: IMalloc): HResult; stdcall;

现在 FShellMalloc 声明中使用的 IMalloc 派生自一段OLE2.IMalloc 时间,“MyShlObj”中使用的 IMalloc 来自ActiveX.IMalloc.

有可能改变其中之一吗?如果是,是否推荐?

4

3 回答 3

7

OLE2单元被较旧的 Delphi 版本使用,该单元已被该单元替换ActiveX,因此现在您必须 ActiveX在新项目中使用这些类型。

于 2011-01-20T09:59:32.360 回答
1

The only alteration I think will work is to make sure that FShellMalloc is derived from the same interface as the one used from MyShlObj.

Modify either one to use the same IMalloc as the other.

于 2011-01-20T09:57:16.727 回答
1

检查您的使用条款。许多第三方代码使用编译器指令来加载正确的单元。更改编译器版本通常会导致加载错误的文件。

DFS是一个经典的例子。转到DFS.INC并确保定义了适当DFS_COMPILER_xxx的。

于 2012-11-03T20:46:04.770 回答