求助!!!
在用ShellExecute函数前应该在uses中加入一句什么吧?

解决方案 »

  1.   

    我在uses中加入了shellAPI,在编译中还有一个错误
    错误信息是 Incompatible type:'variant' and 'Pchar'
    我的Shellexecute语句是这样的:
    ShellExecute(handle,'open',' c:\ver.txt', NULL, NULL, SW_SHOWNORMAL);
      

  2.   

    修改如下
       ShellExecute(handle,'open',pchar(' c:\ver.txt'),nil,nil, SW_SHOWNORMAL);
      

  3.   

    uses 再加上 Variant
    因为你用的是null在delphi如果不用null,就写上nil,这样就不用在uses加上variant了
      

  4.   

    ShellExecute(handle,'open',pchar(' c:\ver.txt'), NULL, NULL, SW_SHOWNORMAL);
      

  5.   

    shellexecute(handle,nil,pchar('http://www.sohu.com'),nil,nil,sw_shownormal);
    是打开浏览器的,至于文件嘛,没的研究啦.
    应该是把null改成nil吧.
      

  6.   

    procedure TForm1.Button1Click(Sender: TObject);
    begin
      shellexecute(handle,'open','c:\boot.ini','','',1);
    end;我已调试过,可以运行。
      

  7.   

    楼上的我copy你的下来,编译没有报错,文件也有但就是运行的时候,按按钮没作用为什么呢?
      

  8.   

    在delphi中需要用pchar函数将shellexecute中的数据转换一下,如:pchar(string)