ExtractFilePath()函数返回值最后包含 "/"
///////////// 应用程序当前路径 /////////////
ExtractFilePath(paramstr(0))
ExtractFilePath(application.ExeName)
///////////// COM中当前路径 /////////////
.... ....
TCustomMG = class(TTypedComObject, ICustomMG)
function TCustomMG.getXmlPath: string;
var
xmlPath:string;
S:array[0..255] of char;
begin
Result:='';
GetModuleFileName(hinstance,s,length(s));
xmlPath := extractfilepath(s);
result := xmlPath;
end;
///////////// 应用程序当前路径 /////////////
ExtractFilePath(paramstr(0))
ExtractFilePath(application.ExeName)
///////////// COM中当前路径 /////////////
.... ....
TCustomMG = class(TTypedComObject, ICustomMG)
function TCustomMG.getXmlPath: string;
var
xmlPath:string;
S:array[0..255] of char;
begin
Result:='';
GetModuleFileName(hinstance,s,length(s));
xmlPath := extractfilepath(s);
result := xmlPath;
end;
博客介绍了ExtractFilePath()函数,其返回值最后包含“/”,还提及获取应用程序当前路径的方式,如ExtractFilePath(paramstr(0))等。此外,展示了COM中当前路径的获取,给出了TCustomMG类中getXmlPath函数获取路径的代码示例。
1万+

被折叠的 条评论
为什么被折叠?



