VC6.0 limitations

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Does the standard version not allow opening of files? I copied and pasted code from help files and was able to compile without errors. It runs OK, but it will not open a file. The output I get is 'The file 'data' was not opened'. Is it necessary to own professional version to be able to open a disk file?

if( (fp = fopen( "GYX.SRV", "r" )) == NULL )

{
tempi=sprintf(textString,"The file 'data' was not opened\n");
TextOut(hdcWork, 1, 1, textString, tempi);
SelectObject(hdcWork, hdc);
BitBlt(hdc, 0,0, 630,454, hdcWork, 0, 0, SRCCOPY);
printf( "" );
.....
 
newbe said:
Does the standard version not allow opening of files? I copied and
pasted code from help files and was able to compile without errors.
It runs OK, but it will not open a file. The output I get is 'The
file 'data' was not opened'. Is it necessary to own professional
version to be able to open a disk file?

if( (fp = fopen( "GYX.SRV", "r" )) == NULL )

{
tempi=sprintf(textString,"The file 'data' was not opened\n");
TextOut(hdcWork, 1, 1, textString, tempi);
SelectObject(hdcWork, hdc);
BitBlt(hdc, 0,0, 630,454, hdcWork, 0, 0, SRCCOPY);
printf( "" );
...

VC6 standard can most certainly open files - there must be something else at
play. Are you sure the file exists in the same directory where the EXE
resides? (that's where it'd have to be in the example above).

-cd
 
Thanks for replying. I first tried:
if( (fp = fopen( "C:\\My Downloads\\Surveillance Files\\GYX.SRV", "r" )) == NULL )
where I knew the file was located. With single backslashes, I got escape code error. With the above line, I got the same output of '...not opened'.

I also tried:
if( (fp = fopen( "C:GYX.SRV", "r" )) == NULL )
thinking the backslashes might have something to do with it, but same result (and I did copy the file to the C: root).

Then I tried copying the data file into the directory where the .exe is and used the fopen function 1st parameter of "GYX.SRV" Same result of '... not opened'

EW
 
Back
Top