Click here to Skip to main content
15,888,401 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralDirectShow / DMO Effects Pin
Robert Fiegender20-Dec-07 12:49
sussRobert Fiegender20-Dec-07 12:49 
QuestionHow to access program call arguments? Pin
Anthony Appleyard20-Dec-07 12:10
Anthony Appleyard20-Dec-07 12:10 
AnswerRe: How to access program call arguments? Pin
Steve Echols20-Dec-07 12:22
Steve Echols20-Dec-07 12:22 
GeneralRe: How to access program call arguments? Pin
Anthony Appleyard20-Dec-07 20:31
Anthony Appleyard20-Dec-07 20:31 
AnswerRe: How to access program call arguments? Pin
CPallini20-Dec-07 12:28
mveCPallini20-Dec-07 12:28 
GeneralGetting objects in ROT Pin
Akin Ocal20-Dec-07 12:07
Akin Ocal20-Dec-07 12:07 
GeneralRe: Getting objects in ROT Pin
Stephen Hewitt20-Dec-07 13:55
Stephen Hewitt20-Dec-07 13:55 
Generalifstream slow to close Pin
Budric B.20-Dec-07 11:05
Budric B.20-Dec-07 11:05 
Hi,
I'm getting some terrible performance when calling ifstream close. It takes about the same amount of time to close() as it takes to read my 64 Mb of data! I've been playing around with it and found it only happens if I have been writing to a file recently. Here's my test code:

void readTest(const std::string & path) 
{
	ifstream in;
	in.open(path.c_str(), ios_base::in | ios_base::binary);
	char * buffer = new char[67108864];
	in.read(buffer, 67108864);
	SW_ELAPSED_MSG()
	in.close();
	SW_ELAPSED_MSG()
	delete [] buffer;
}

void writeTest(const std::string & path)
{
	ofstream out;
	out.open(path.c_str(), ios_base::out | ios_base::binary);
	char * buffer = new char[67108864];
	out.write(buffer, 67108864);
	//out.flush();
	out.close();
	delete [] buffer;
}

int _tmain(int argc, _TCHAR* argv[])
{
	writeTest("testfile");
	SW_START();
	readTest("testfile");
	SW_ELAPSED_MSG()
        return 0;
}

Note my macros do the timing and display it on screen. I don't believe there's any problem with that code.
So anyone know why? I'm closing the streams. Why is the read stream affected at all by the write stream? Also as you can see I have a flush() statement in there. It doesn't help, commented or not.
QuestionRuntime error - incompatible iterator - why??? Pin
Philstix20-Dec-07 10:47
Philstix20-Dec-07 10:47 
GeneralRe: Runtime error - incompatible iterator - why??? Pin
Philstix20-Dec-07 10:50
Philstix20-Dec-07 10:50 
GeneralRe: Runtime error - incompatible iterator - why??? Pin
Philstix20-Dec-07 10:53
Philstix20-Dec-07 10:53 
GeneralRe: Runtime error - incompatible iterator - why??? Pin
CPallini20-Dec-07 11:37
mveCPallini20-Dec-07 11:37 
QuestionRe: Runtime error - incompatible iterator - why??? Pin
Philstix20-Dec-07 15:34
Philstix20-Dec-07 15:34 
GeneralRe: Runtime error - incompatible iterator - why??? Pin
Stephen Hewitt20-Dec-07 15:36
Stephen Hewitt20-Dec-07 15:36 
GeneralRe: Runtime error - incompatible iterator - why??? Pin
Philstix20-Dec-07 17:28
Philstix20-Dec-07 17:28 
GeneralClass/struct declarations and bit patterns Pin
Anthony Appleyard20-Dec-07 10:43
Anthony Appleyard20-Dec-07 10:43 
GeneralRe: Class/struct declarations and bit patterns Pin
CPallini20-Dec-07 11:19
mveCPallini20-Dec-07 11:19 
GeneralRe: Class/struct declarations and bit patterns Pin
Anthony Appleyard20-Dec-07 11:56
Anthony Appleyard20-Dec-07 11:56 
GeneralGood Luck! Pin
CPallini20-Dec-07 12:45
mveCPallini20-Dec-07 12:45 
GeneralRe: Class/struct declarations and bit patterns [modified] Pin
Mark Salsbery20-Dec-07 13:22
Mark Salsbery20-Dec-07 13:22 
GeneralAfter a picture is tranformed by GDI+, mouse cursor point problem Pin
followait20-Dec-07 5:57
followait20-Dec-07 5:57 
GeneralRe: After a picture is tranformed by GDI+, mouse cursor point problem Pin
CPallini20-Dec-07 10:16
mveCPallini20-Dec-07 10:16 
Generalplzz hlep Pin
coderwizard20-Dec-07 3:45
coderwizard20-Dec-07 3:45 
GeneralRe: plzz hlep Pin
George L. Jackson20-Dec-07 4:54
George L. Jackson20-Dec-07 4:54 
GeneralRe: plzz hlep Pin
coderwizard20-Dec-07 5:19
coderwizard20-Dec-07 5:19 

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.