王宏健的专栏 ---- 健康快乐

  博客园 :: 首页 :: 新随笔 :: 联系 :: 订阅 :: 管理 ::
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;
posted on 2004-11-29 16:54  LuckyJan  阅读(234)  评论(0)    收藏  举报