Re: readfile help Programming Software Development by Lerner … project then you don't the variable t in the readFile() function at all. If p is assigned the value 0… before the first call to readFile() then readFile() could look something like this:[code] void readFile(Object pObject[], int &p) { double… Re: readfile help Programming Software Development by joeblob17 … Object::getDistance(){return distance;} My new code for the readfile is: void readFile(Object pObject[], int &p){ double distance[100]; double… readfile help Programming Software Development by joeblob17 … screwed up would be greatly appreciated! My code is: void readFile(Object pObject[], int &p){ double distance[100]; double height… Re: readfile help Programming Software Development by joeblob17 … slow with this stuff. Here is my file now: void readFile(Object pObject[], int &p){ double distance[100]; double height… Re: readfile help Programming Software Development by joeblob17 … is what my function looks like now: [code=cplusplus] void readFile(Object pObject[], int &p){ double distance[100]; double height… ReadFile Crash in C++ Programming Software Development by naveentj … I have a very weird problem. I have been using ReadFile() for reading data from a device connected to the PC…be read is received in chunks of 64 bytes, always, ReadFile() is called with 64 bytes to read. However, when …new(100bytes); // First read of 64 bytes ReadFile(64) // Second read of 64 bytes ReadFile(64) -> Here data that would … Re: ReadFile crashes needs more Programming Software Development by Comrade Ogilvy … more context? >Also, why I couldn't use ReadFile as written in Win32.HLP bothers me too You can… to usurp it from its rightful position in memory. ReadFile wants a DWORD address because it's going to write…(ie allocate storage) and pass a reference to that to ReadFile as, presumably, has already been suggested. If you absolutely must… ReadFile() doesn't return error code. Programming Software Development by AhmedHan … files on CDs and DVDs. I used ReadFile() function to read the corrupted file. ReadFile() is supposed to return ERROR_READ_FAULT value whenever… any read error occurs. Unfortunately, the program stucks at the ReadFile() function when there exist a read error, instead of returning… ReadFile function timeout ERROR Programming Software Development by abhi.nalluri ….ReadTotalTimeoutMultiplier = 1; noblock.WriteTotalTimeoutConstant = 1; noblock.WriteTotalTimeoutMultiplier = 1; [/code] my readfile function read a single character in a loop until it… gets a last character which is checked correctely. [code] if (ReadFile(rsi_handle,&c,1, &dwByteCount_r, NULL) == 0) { printf("… ReadFile problem Programming Software Development by Ricky65 …copy a file to a buffer using the ReadFile Win API. It works fine for text …FILE_ATTRIBUTE_NORMAL, NULL); //GetFileSize to determine size of buffer for ReadFile DWORD BufferSize = GetFileSize(hFile,NULL); cout << … the filesize //Read from the file: if(!ReadFile(hFile, ReadBuffer,BufferSize+1,&dwNumRead,NULL)) { … ReadFile does not read file Programming Software Development by Powerponken …sizeof(lpBuffer), &ofs, NULL); strcpy(buffer,""); if(ReadFile(hFile, idBuffer, 100, &ofs, NULL)) printf("OK…t get it working. Everything works fine except that ReadFile won't fill the idBuffer with any data from the… the expected data in the file. And then again ReadFile does not read it.... I'm using Visual Studio… ReadFile crashes Programming Software Development by toolmanx I am having trouble getting ReadFile to work for me. I am runnng an AMD with … tried a call to GetFileSize which worked fine before calling ReadFile. Tracking what happens in SoftIce, all is well until the… ReadFile function calls a tick count. Before the tick count, lpBuffer &… Re: ReadFile crashes Programming Software Development by dubeyprateek … tried a call to GetFileSize which worked fine before calling ReadFile. [/QUOTE] 1) Never call GetLastError if the API is sucessful… small code sinppet which can demonstrate how are u using ReadFile. ReadFile is a very widely used API in Windows. Most likely… Re: ReadFile crashes Programming Software Development by dubeyprateek …Mylength = GetFileSize(hfile,&lpFileSizeHigh); lpBuffer = GlobalAlloc(GPTR,Mylength); ReadFile(hfile,(BYTE *)lpBuffer,512,&dwRead,NULL); return 0; }[/CODE…LPDWORD dwRead = (LPDWORD)0;[/INLINECODE] is the culprit. [INLINECODE]ReadFile(hfile,lpBuffer,Mylength+1,dwRead,NULL);[/INLINECODE] tries to write… ReadFile crashes needs more Programming Software Development by toolmanx I recently sent a request for help because ReadFile kept crashing for me. The moderator sent me some code … what I had originally done wrong. (For further info see ReadFile crashes by toolmanx.) I started by replacing each item back…'m missing something here. Also, why I couldn't use ReadFile as written in Win32.HLP bothers me too. Is this… ReadFile with Overlapped flag On not working in Release Mode Hardware and Software Microsoft Windows by PrasM Topic: ReadFile prob in Release mode Posted: Today at 11:21pm … have used the CreateFile function with FILE_FLAG_OVERLAPPED Flag. In ReadFile fn I pass the Overlapped structure with the Event handle…the OutputDebugString function. BUUUUUUUUUTTTTTTT When I RUN the application the ReadFile returns a error code value "2" which… Re: ReadFile problem Programming Software Development by Banfa … shouldn't pass a buffer size of BufferSize+1 to ReadFile when ReadBuffer is in fact only BufferSize in length, either… memory or reduce the size passed to the call. If ReadFile is failing you should be calling GetLastError to find out… Re: ReadFile problem Programming Software Development by Ricky65 … as it's not the output that is the problem, ReadFile is only reading a file to buffer up to a… NULL character. Is there a way to make ReadFile read past the null character? Re: ReadFile() doesn't return error code. Programming Software Development by Ancient Dragon all file i/o functions on MS-DOS computers eventually call the win32 api functions such as ReadFile(), WriteFile(), CreateFile() etc. Re: ReadFile does not read file Programming Software Development by Powerponken … filehandle and opened the file again and now it works. ReadFile read the file earlier but in the wrong place. Thank… Re: ReadFile crashes Programming Software Development by toolmanx …,(HANDLE)NULL); Mylength = GetFileSize(hfile,lpFileSizeHigh); lpBuffer = GlobalAlloc(GPTR,Mylength); ReadFile(hfile,lpBuffer,Mylength+1,dwRead,NULL); Re: ReadFile crashes Programming Software Development by Salem … about how much memory they're allowed to use. [ICODE]ReadFile(hfile,lpBuffer,[COLOR="Red"]Mylength+1[/COLOR],&… ReadFile & WriteFile API Programming Software Development by JohnKelly Dear All I am using the API calls to ReadFile and WriteFile to access data coming in on serial ports … ReadFile() and SetFilePointer Problems? Programming Software Development by krishnampkkm … Failed: Error Number : %d\n",GetLastError()); return o; } if(!ReadFile(drive_handle, bBuffer1, cluster_size, &dwRetBytes1, 0)) { printf("\nUnable to… Re: ReadFile() and SetFilePointer Problems? Programming Software Development by Salem [url]http://cboard.cprogramming.com/cplusplus-programming/117065-readfile-setfilepointer-problems.html[/url] Making progress over there. "ReadFile" problem through COM1 port Programming Software Development by jp071 … the data. do { // Read the data from the serial port. ReadFile (hPort, &Byte, 1, &dwBytesTransferred, 0); // Display the data… Re: "ReadFile" problem through COM1 port Programming Software Development by jp071 … the data. do { // Read the data from the serial port. ReadFile (hPort, &Byte, 1, &dwBytesTransferred, 0); // Display the data… ReadFile(One Line) Programming Software Development by BluMan … Chr:Byte Mov Len, 0 .Repeat Mov rLen, 0 Invoke ReadFile, Hand, Addr Chr, 1, Addr rLen, NULL Invoke StdOut, Addr… ReadFile problem Programming Software Development by elexender … r is received by arduino it sends the characters back ReadFile(hComm, UitBuff, 24, &dwBytesRead, NULL);// ShowMessage(UitBuff); } else { ShowMessage… Re: winapi displaying ReadFile char. Programming Software Development by Ancient Dragon … if it were a binary file. Instead of CreteFile() and ReadFile() why don't you just use standard C++ fstreams. Just…