我正在尝试在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);
Run Code Online (Sandbox Code Playgroud)
"MyShlObj":
//SHGetMalloc declaration
function SHGetMalloc(var ppMalloc: IMalloc): HResult; stdcall;
Run Code Online (Sandbox Code Playgroud)
现在,在FShellMalloc声明中使用的IMalloc源自OLE2.IMalloc
"MyShlObj"中使用的IMalloc ActiveX.IMalloc.
有可能改变其中一个吗?如果是的话,是否推荐?
我有一个停止网站的脚本:
param($HostName = "localhost", $SiteName)
$server = $HostName
$siteName = $SiteName
$iis = [ADSI]"IIS://$server/W3SVC"
$site = $iis.psbase.children | where { $_.keyType -eq "IIsWebServer" -AND $_.ServerComment -eq $siteName}
$site.start()
# SIG # Begin signature block ...
Run Code Online (Sandbox Code Playgroud)
但是当我在具有高安全性策略的服务器上运行脚本时,我收到此错误:
The following exception was thrown when trying to enumerate the collection: "Unknown error (0x80005000)".
At D:\DeploymentScripts\Common\StopSite.ps1:6 char:8
+ $site = <<<< $iis.psbase.children | where { $_.keyType -eq "IIsWebServer" -AND $_.ServerComment -eq $siteName}
+ CategoryInfo : NotSpecified: (:) [], ExtendedTypeSystemException
+ FullyQualifiedErrorId : ExceptionInGetEnumerator
Run Code Online (Sandbox Code Playgroud)
从我所看到的,如果我无法访问IIS,可能会发生这种情况,但我以管理员身份运行脚本,是否应该授予我所需的访问权限? …
我试图将旧项目从Delphi 5迁移到Delphi XE.当我尝试编译项目时,我收到此错误:
[DCC Error] *.pas(352): E2003 Undeclared identifier: 'VarToStr'
Run Code Online (Sandbox Code Playgroud)
关于这一行:
PropValue := VarToStr(GetPropValue(Component, PropInfo^.Name));
Run Code Online (Sandbox Code Playgroud)
它在Delphi 5中运行良好,据我所知,在XE中也支持VarToStr?