W
wuyi
Unregistered / Unconfirmed
GUEST, unregistred user!
下面的程序是在一个POPMENU中执行的, 当执行到该过程返回的END时, 出现<br><br>以下信息并只有用RUN菜单下的PROGRAM RESET恢复, 用单步跟踪也不行.<br><br>Project myproject raised exception class c0000005 with<br>message 'access violation at oxbff76ece: read of address <br>oxffffffff'. Process stopped. Use Step or Run to continue.<br><br>而用Shellexecute(hinstance,'open','netscape.exe',pchar(filename),'e:',SW_SHOWDEFAULT);<br><br>时不会出错, 请大侠们会诊一下.<br><br><br>procedure TMainForm.AttachListDblClick(Sender: TObject);<br>var filename:string;<br> dirlen: integer;<br> curdir :array[0..100] of Char;<br>begin<br> with attachList do<br> if AttachList.ItemFocused <> nil then<br> begin<br> dirlen := GetCurrentDirectory(sizeof(curdir),curdir);<br> FileName:=copy(curdir,1,dirlen)+'/attach/'+AttachList.ItemFocused.caption;<br> Shellexecute(hinstance,'open',PChar(FileName),'','e:',SW_SHOWDEFAULT);<br> end;<br>end;<br>