尝试调试 64 位控制台应用程序时出错

Error when trying to debug a 64-bit console application

我尝试在 Delphi 10.3.3 Rio 中调试一个简单的 64 位控制台应用程序:

program ShellLinkShortcutTest;

{$APPTYPE CONSOLE}

{$R *.res}

uses
  JclShell,
  System.SysUtils;

const
  ShortcutFile = 'R:\myshortcut.lnk';
  ShortcutTarget = 'C:\Windows\System32\notepad.exe';

function SaveShortcutShellLink(const AFile: string): string;
var
  SL: JclShell.TShellLink;
  HR: Integer;
begin
  Result := 'error';

  SL.Target := ShortcutTarget;
  SL.Description := 'My description';
  HR := JclShell.ShellLinkCreate(SL, AFile);
end;

begin
  try
    Writeln(SaveShortcutShellLink(ShortcutFile));
    Readln;
  except
    on E: Exception do
    begin
      Writeln(E.ClassName, ': ', E.Message);
      Readln;
    end;
  end;
end.

但是我一按 F9 就收到了这个错误信息:

更奇怪的是:文件wmcipc.cpp不存在!

但是,调试与 32 位相同的程序没有问题。

我的 OS:Windows 7 x64 SP1

这里有什么问题?

But as soon as I press F9 I get this error message:

这是 Delphi 64 位调试器中一个非常古老且众所周知的错误:

https://forums.embarcadero.com/thread.jspa?messageID=712725

它有一个简单的修复:

Open a command prompt as Administrator, and run

netsh winsock reset

After rebooting, your 64-bit debugger should work again.

What is even more strange: The file wmcipc.cpp does not exist!

它不应该存在于您的机器上。您看到调试器本身引发的断言错误,而不是您的项目。 wmcipc.cpp 源文件是调试器实现的内部文件。