p:=ExtractFilePath(application.ExeName);
usepath:=Copy(p,1,3);
usepath:=usepath+'分析化验-原始\'+ form1.DBGrid1.DataSource.DataSet.FieldByName('文件原位置').AsString;
u:=string(usepath);
ShellExecute(Handle,'open','Explorer.exe',u,nil,1);
最后一句报错:
Incompatible types:'String and PAnsuChar'我该怎么改?请指点!!
usepath:=Copy(p,1,3);
usepath:=usepath+'分析化验-原始\'+ form1.DBGrid1.DataSource.DataSet.FieldByName('文件原位置').AsString;
u:=string(usepath);
ShellExecute(Handle,'open','Explorer.exe',u,nil,1);
最后一句报错:
Incompatible types:'String and PAnsuChar'我该怎么改?请指点!!
ShellExecute(Handle,'open','Explorer.exe',PChar(u),nil,1); 那句u:=string(usepath); 似乎可以去掉