Click here to Skip to main content
15,886,919 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Check for input from console in C++ Pin
Naveen13-Dec-07 16:12
Naveen13-Dec-07 16:12 
GeneralRe: Check for input from console in C++ Pin
dabs14-Dec-07 3:28
dabs14-Dec-07 3:28 
GeneralCString into string Pin
CodingLover13-Dec-07 14:27
CodingLover13-Dec-07 14:27 
GeneralRe: CString into string Pin
Mark Salsbery13-Dec-07 15:16
Mark Salsbery13-Dec-07 15:16 
GeneralRe: CString into string Pin
CodingLover13-Dec-07 15:34
CodingLover13-Dec-07 15:34 
GeneralRe: CString into string [modified] Pin
Mark Salsbery13-Dec-07 16:19
Mark Salsbery13-Dec-07 16:19 
GeneralRe: CString into string Pin
CodingLover13-Dec-07 17:02
CodingLover13-Dec-07 17:02 
QuestionReadFile() hang Pin
MMM Computers13-Dec-07 12:40
MMM Computers13-Dec-07 12:40 
I have two applications running on one computer. The first app imports data from elsewhere, parses it, and writes out several files using CreateFile and WriteFile to a directory. The second app reads each of these files from the first app using FindFirstFile, CreateFile and ReadFile, and does further processing.

The data written to these files is fairly big in each case (~8 MB), so each file write can take 2-3 seconds. Also, each batch of files can potentially be large (say 100 or more). So, while the first app is busy writing each file, the second app should be able to take the first file it finds (via FindFirstFile), and open and read it. The problem is, ReadFile doesn't return for that first file until the first app has written out ALL of its files. So this ReadFile call in essence hangs for a few minutes, possibly causing havoc elsewhere in the app.

I'm closing my file handles properly in the first app (at least I think I am), so there shouldn't be any reason for ReadFile to wait on file writes that are on different files in the same directory. Is there some "feature" in the Win32 file API that would explain this behavior? I'm writing the files using FILE_FLAG_SEQUENTIAL_SCAN and sharing disabled, if it matters; I've also played with FILE_FLAG_NO_BUFFERING to attempt to improve performance.
GeneralRe: ReadFile() hang Pin
Mark Salsbery13-Dec-07 13:00
Mark Salsbery13-Dec-07 13:00 
QuestionRe: ReadFile() hang Pin
David Crow14-Dec-07 3:45
David Crow14-Dec-07 3:45 
GeneralRe: ReadFile() hang Pin
KarstenK14-Dec-07 4:09
mveKarstenK14-Dec-07 4:09 
QuestionWorking with files in c++ unmanaged Pin
clint198213-Dec-07 12:21
clint198213-Dec-07 12:21 
GeneralRe: Working with files in c++ unmanaged Pin
Mark Salsbery13-Dec-07 12:39
Mark Salsbery13-Dec-07 12:39 
GeneralReading and displaying JPG images Pin
Anthony Appleyard13-Dec-07 11:24
Anthony Appleyard13-Dec-07 11:24 
GeneralRe: Reading and displaying JPG images Pin
Mark Salsbery13-Dec-07 12:47
Mark Salsbery13-Dec-07 12:47 
GeneralVisual C++ program displaying junk characters Pin
Anthony Appleyard13-Dec-07 11:21
Anthony Appleyard13-Dec-07 11:21 
GeneralRe: Visual C++ program displaying junk characters Pin
Maximilien13-Dec-07 12:33
Maximilien13-Dec-07 12:33 
Generalinterpolation subroutine or a function C++ Pin
mrby12313-Dec-07 10:32
mrby12313-Dec-07 10:32 
GeneralRe: interpolation subroutine or a function C++ Pin
cp987613-Dec-07 11:35
cp987613-Dec-07 11:35 
GeneralRe: interpolation subroutine or a function C++ Pin
Bevan C Bird13-Dec-07 12:31
Bevan C Bird13-Dec-07 12:31 
GeneralRe: interpolation subroutine or a function C++ Pin
mrby12314-Dec-07 5:20
mrby12314-Dec-07 5:20 
GeneralRe: interpolation subroutine or a function C++ Pin
Iain Clarke, Warrior Programmer15-Dec-07 2:16
Iain Clarke, Warrior Programmer15-Dec-07 2:16 
GeneralRe: interpolation subroutine or a function C++ Pin
KarstenK14-Dec-07 4:12
mveKarstenK14-Dec-07 4:12 
GeneralRe: interpolation subroutine or a function C++ Pin
mrby12314-Dec-07 7:08
mrby12314-Dec-07 7:08 
GeneralRe: interpolation subroutine or a function C++ Pin
Bevan C Bird14-Dec-07 12:53
Bevan C Bird14-Dec-07 12:53 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.