R real_clq Unregistered / Unconfirmed GUEST, unregistred user! 2001-11-28 #3 听说是GetModuleFileName,不过怎么用?
X xianjun Unregistered / Unconfirmed GUEST, unregistred user! 2001-11-28 #5 var ; sFileName: string; begin ; SetLength(sFileName, MAX_PATH); ; GetModuleFileName(HInstance, sFileName, MAX_PATH); end; 随手写的。
var ; sFileName: string; begin ; SetLength(sFileName, MAX_PATH); ; GetModuleFileName(HInstance, sFileName, MAX_PATH); end; 随手写的。
X xianjun Unregistered / Unconfirmed GUEST, unregistred user! 2001-11-28 #6 呵呵, 随手写的果然有点小问题! procedure TForm1.Button1Click(Sender: TObject); var ; sFileName: string; begin ; SetLength(sFileName, MAX_PATH); ; SetLength(sFileName, GetModuleFileName(HInstance, PChar(sFileName), MAX_PATH)); ; ShowMessage(sFileName); end;
呵呵, 随手写的果然有点小问题! procedure TForm1.Button1Click(Sender: TObject); var ; sFileName: string; begin ; SetLength(sFileName, MAX_PATH); ; SetLength(sFileName, GetModuleFileName(HInstance, PChar(sFileName), MAX_PATH)); ; ShowMessage(sFileName); end;
R real_clq Unregistered / Unconfirmed GUEST, unregistred user! 2001-11-29 #7 不好意思 昨天已经解决了 var ; FileName1: array[0..255] of Char; begin ; try ; ; //showmessage(application.ExeName); ; ; GetModuleFileName(HInstance, FileName1, SizeOf(FileName1)); ; ; //showmessage(strpas(FileName1)); ; ; treeview1.LoadFromFile(extractfilepath(strpas(FileName1))+'his1.txt'); ; except ; end; end;
不好意思 昨天已经解决了 var ; FileName1: array[0..255] of Char; begin ; try ; ; //showmessage(application.ExeName); ; ; GetModuleFileName(HInstance, FileName1, SizeOf(FileName1)); ; ; //showmessage(strpas(FileName1)); ; ; treeview1.LoadFromFile(extractfilepath(strpas(FileName1))+'his1.txt'); ; except ; end; end;