Article View: borland.public.cppbuilder.nativeapi
Article #10976FindExecutable cannot find the file
From: MortZ
Date: Tue, 09 Mar 2004 03:36
Date: Tue, 09 Mar 2004 03:36
24 lines
1914 bytes
1914 bytes
The call to FindExecutable returns the error code #2 "File Not Found"
The questions are:
1.- what file is not being found, the document or the exe?
2.- what is wrong with the code
//node is a TTreeNode object
char szExecutable[MAX_PATH];
int res;
NodeInfo *dataPtr; //this holds an AnsiString with the filename
and path...
AnsiString fileName;
AnsiString fileDir;
dataPtr=(NodeInfo *)node->Data;
fileName=ExtractFileName(dataPtr->SystemString());
fileDir=ExtractFileDir(dataPtr->SystemString());
//watches for long file names with spaces...
fileName="\""+fileName+"\"";
fileDir="\""+fileDir+"\"";
res=
(int)FindExecutable(fileName.c_str(),fileDir.c_str(),szExecutable);
//here res=2 every time with different file names and paths
Edit2->Text=szExecutable;
Technical Details
Message-ID:
<404d3cfe$1@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!news.maxwell.syr.edu!border1.nntp.ash.giganews.com!border2.nntp.ash.giganews.com!nntp.giganews.com!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mailShow Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 10cc67,5a42057a02edac12,start X-Google-Attributes: gid10cc67,public X-Google-ArrivalTime: 2004-03-08 19:56:06 PST Date: Mon, 08 Mar 2004 19:36:21 -0800 From: MortZ <rmorteo@hotmail.com> Reply-To: rmorteo@hotmail.com Organization: www.cicese.mx User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.4) Gecko/20030624 Netscape/7.1 (ax) X-Accept-Language: en-us, en MIME-Version: 1.0 Newsgroups: borland.public.cppbuilder.nativeapi Subject: FindExecutable cannot find the file Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit NNTP-Posting-Host: 158.97.22.182 Message-ID: <404d3cfe$1@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1078803710 158.97.22.182 (8 Mar 2004 19:41:50 -0800) Lines: 25 Path: arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!news.maxwell.syr.edu!border1.nntp.ash.giganews.com!border2.nntp.ash.giganews.com!nntp.giganews.com!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail