小编use*_*060的帖子

如何将字符串变量传递给期望PChar的函数?

我有这个代码:

ShellExecute(Handle, 'open',
             'C:\Users\user\Desktop\sample\menu\WTSHELP\start.html',
             nil, nil, sw_Show);
Run Code Online (Sandbox Code Playgroud)

如何用字符串变量替换第三个参数中的文字?如果我使用下面的代码,它不会编译.

var
  dir: string;

dir := 'C:\Users\user\Desktop\sample\menu\WTSHELP\start.html';
ShellExecute(Handle, 'open', dir, nil, nil, sw_Show);
Run Code Online (Sandbox Code Playgroud)

delphi string pchar

7
推荐指数
2
解决办法
5098
查看次数

标签 统计

delphi ×1

pchar ×1

string ×1