Ususally, the I/O failue is due to the way the app is compiled. If it is compiled on a PC with more than a "C" drive, the app will look for those drives on the destination PC. If there is no response from a drive on the destination PC (i.e. a CD player) you will get this message.
Try running the following code on your app (of course, make a backup first!).
To run it, copy the code to a PRG file in the same directory as you app code
and, from the command prompt (in FoxPro) run this code with the name of the app
as the paramter.
* Program fixdrive
* replaces upper drive letters in *.app/*.exe files with "C:"
* Public domain - No copyright on this
PARAMETERS AppFile && the full name of *.app, *.exe
AppHandle = FOPEN(AppFile, 2)
IF AppHandle > 0
FileLen = FSEEK(AppHandle, 0, 2)
LastPos = -1
= FSEEK(AppHandle, 0)
DO WHILE !FEOF(AppHandle)
LastPos=Srchfile(AppHandle, LastPos+1, FileLen, ':\')
IF LastPos > 1 AND UPPER(GetString(AppHandle, LastPos-1, 1)) $ 'DEFGHIJKLMNOPQRSTUVWXYZ'
=Fseek(AppHandle, LastPos -1)
=FWRITE(AppHandle, 'c')
ENDIF
ENDDO
=FCLOSE(AppHandle)
ENDIF
*************
PROCEDURE GetString
PARAMETERS FileHandle, fileloc, nbytes
=FSEEK(FileHandle, fileloc)
RETURN FREAD(FileHandle, nbytes)
************
PROCEDURE SrchFile
PARAMETERS FileHandle, FStart, FEnd, String1
***************************************
PRIVATE ALL && Bpos, Fpos, ByteBlock1, ByteBlock2, EndOfFile
Fpos=Fstart
BPos=0
=FSEEK(FileHandle, Fstart)
IF FEOF(FileHandle)
RETURN -1
ENDIF
EndOfFile = .F.
ByteBlock1 = FREAD(FileHandle, 2048)
EndOfFile = LEN(ByteBlock1)=0
ByteBlock2 = FREAD(FileHandle, 2048)
DO WHILE !EndOfFile AND FPos<=FEnd
Bpos=AT(String1, ByteBlock1+ByteBlock2)
IF Bpos>0
=FSEEK(FileHandle, Fpos+Bpos-1)
RETURN Fpos+Bpos-1
ENDIF
Fpos=Fpos+2048
ByteBlock1 = ByteBlock2
ByteBlock2 = FREAD(FileHandle, 2048)
EndOfFile = LEN(ByteBlock2)=0
ENDDO
RETURN -1
Hope this helps.
Bill Perkins
Précédent
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement