The only thing I see different between your code and code I use is that I don't cast the read or write buffer to (void *).
Michael. venkatesh <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > > Hi > I want to use File Streaming API in my application. I have > tried with FileWrite( ) and FileRead( ) calls. I am able to write some > bytes into a file. But reading that file always returns zero objects. > I didn't got any errors also. Can anybody suggest some way to do this. > > The code follows: > > int file(void) > { > FileHand tmpFile = NULL; > Int32 written, read; > char write_buffer[4] = "abcd"; > char read_buffer[4] = " "; > tmpFile = FileOpen (0, "ptt1.txt", 0, 0, fileModeReadWrite, NULL); > if (tmpFile == NULL) > { > printf("Error opening file"); > } > > written = FileWrite (tmpFile, (void *)write_buffer, 1, 4, &err); > printf("Bytes Written = %d.\n",(int)written); > > read = FileRead (tmpFile, (void *)read_buffer, 1, 4, &err); > printf("Bytes Read = %d.\n",(int)read); > err = FileClose(tiffFile); > return 0; > } > debugging returns err = 0 > > Thanks in advance > > venkatesh > > > -- For information on using the ACCESS Developer Forums, or to unsubscribe, please see http://www.access-company.com/developers/forums/
