ExtractFilepath(Application.ExeName)假设是c:\temp,我现在要调用c:\temp\mess
应如何写?

解决方案 »

  1.   

    我要的是相对路径,就默认路径的下一级目录怎么改一下ExtractFilepath(Application.ExeName)实现呢?
      

  2.   

    SetCurrentDirectory(PChar(ExtractFilepath(Application.ExeName)+'mess'));
      

  3.   

    [Error] setup.pas(45): Incompatible types: 'String' and 'LongBool'
    [Fatal Error] Project1.dpr(9): Could not compile used unit 'setup.pas'
    出错,类型不一致
      

  4.   

    代码贴出来啊。看起来你是进行赋值了,返回值是布尔型,你赋值给一个字符串了!
    这样啊:
    if SetCurrentDirectory(PChar(ExtractFilepath(Application.ExeName)+'mess')) then
    begin
      ShowMessage('设置成功');
    end;
      

  5.   

    procedure TFrm_setup.fcTreeView1Change(TreeView: TfcCustomTreeView;
      Node: TfcTreeNode);
    begin
      flatgroupbox1.Caption:=node.Text;
      strRoute:= ExtractFilepath(Application.ExeName)+fcTreeview1.Selected.Text+'.txt';
      flatlistbox1.Items.Clear;
      flatlistbox1.Items.LoadFromFile(strRoute);
    end;
      

  6.   

    老大叫你用SetCurrentDirectory(),你怎么没用?
      

  7.   

    我要的是相对路径,就默认路径的下一级目录怎么改一下ExtractFilepath(Application.ExeName)实现呢?
      

  8.   

    strRoute:=SetCurrentDirectory(PChar(ExtractFilepath(Application.ExeName)+'mess'))+fcTreeview1.Selected.Text+'.txt';
    错误
    [Error] setup.pas(45): Incompatible types: 'String' and 'LongBool'
    高手呢?
      

  9.   

    procedure TFrm_setup.fcTreeView1Change(TreeView: TfcCustomTreeView;
      Node: TfcTreeNode);
    begin
      flatgroupbox1.Caption:=node.Text;
      SetCurrentDirectory(PChar(ExtractFilepath(Application.ExeName)+'mess'));
      strRoute:= ExtractFilepath(Application.ExeName)+'mess\'+fcTreeview1.Selected.Text+'.txt';
      flatlistbox1.Items.Clear;
      flatlistbox1.Items.LoadFromFile(strRoute);
    end;
      

  10.   

    SetCurrentDirectory()这个函数的返回值是boolean,表示函数是否执行成功,你怎么能将它赋给strRoute(string类型)呢?
      

  11.   

    每个问题 sysu(死树) 都说过了
    唉!真是汝子不可教也!