What version of IMalloc should I use in Delphi?

I'm trying to reorganize a Delphi 5 project in Delphi XE, to do this, I need to fix some errors in a module called BrowseDr. The error I get is this

[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;

Now the IMalloc used in the FShellMalloc declaration is obtained from OLE2.IMalloc and the one used in "MyShlObj" is from ActiveX.IMalloc.

Is it possible to change one of them? If so, is this recommended?

+3
source share
3 answers

The block was OLE2used by older versions of Delphi, this block has been replaced by a module ActiveX, so now you should use types ActiveXin your new project.

+7
source

, , , , - , FShellMalloc , , MyShlObj.

, IMalloc, .

+1

Check the condition of use. Many third-party codes use compiler directives to load the correct unit. Changing the compiler version often leads to the loading of the wrong file.

DFSis a classic example. Go to DFS.INCand make sure that the appropriate one is defined DFS_COMPILER_xxx.

+1
source

Source: https://habr.com/ru/post/1786621/


All Articles