std::cout Messes Up Filter in OpenFileDialog
-
Does anybody else experience the following behavior? When I comment out the line
std::cout << 0;
inf()
, everything works fine. However, if I uncomment the line, then when I change the filter in the OpenFileDialog, all the files in the list disappear. This is using Visual C++ .NET 2003 (Managed Extensions to C++, not C++/CLI).-
I created a new Visual C++ Windows Forms Application (.NET).
-
I added a button to this form.
-
I added an event handler for this button that consists of the following:
OpenFileDialog* dlg = new OpenFileDialog; dlg->Filter = "Text Files (*.txt)|*.txt|All Files (*.*)|*.*"; dlg->ShowDialog();
-
I added a native C++ file that consists of the following:
#include <iostream> void f() { // Comment the following line to get correct behavior std::cout << 0; }
-
I turned off Precompiled Headers for the project. (not essential, otherwise you need to add
#include "stdafx.h"
to the native file). -
Compile and run (click the button then change the file filter).
Note that nowhere in the program did I actually call the function
f()
. It seems that its mere existence in the project is enough to mess this up. -- Marcus Kwok -
-
Does anybody else experience the following behavior? When I comment out the line
std::cout << 0;
inf()
, everything works fine. However, if I uncomment the line, then when I change the filter in the OpenFileDialog, all the files in the list disappear. This is using Visual C++ .NET 2003 (Managed Extensions to C++, not C++/CLI).-
I created a new Visual C++ Windows Forms Application (.NET).
-
I added a button to this form.
-
I added an event handler for this button that consists of the following:
OpenFileDialog* dlg = new OpenFileDialog; dlg->Filter = "Text Files (*.txt)|*.txt|All Files (*.*)|*.*"; dlg->ShowDialog();
-
I added a native C++ file that consists of the following:
#include <iostream> void f() { // Comment the following line to get correct behavior std::cout << 0; }
-
I turned off Precompiled Headers for the project. (not essential, otherwise you need to add
#include "stdafx.h"
to the native file). -
Compile and run (click the button then change the file filter).
Note that nowhere in the program did I actually call the function
f()
. It seems that its mere existence in the project is enough to mess this up. -- Marcus KwokHmm, OK something is really weird now. I sent the code to a colleague of mine and the issue does not appear on his machine. I even sent him both versions of the executable, and neither version shows the bug on his machine, though the exact same exe's do show the bug on mine. :confused: -- Marcus Kwok
-
-
Does anybody else experience the following behavior? When I comment out the line
std::cout << 0;
inf()
, everything works fine. However, if I uncomment the line, then when I change the filter in the OpenFileDialog, all the files in the list disappear. This is using Visual C++ .NET 2003 (Managed Extensions to C++, not C++/CLI).-
I created a new Visual C++ Windows Forms Application (.NET).
-
I added a button to this form.
-
I added an event handler for this button that consists of the following:
OpenFileDialog* dlg = new OpenFileDialog; dlg->Filter = "Text Files (*.txt)|*.txt|All Files (*.*)|*.*"; dlg->ShowDialog();
-
I added a native C++ file that consists of the following:
#include <iostream> void f() { // Comment the following line to get correct behavior std::cout << 0; }
-
I turned off Precompiled Headers for the project. (not essential, otherwise you need to add
#include "stdafx.h"
to the native file). -
Compile and run (click the button then change the file filter).
Note that nowhere in the program did I actually call the function
f()
. It seems that its mere existence in the project is enough to mess this up. -- Marcus KwokI posted a workaround here: http://groups.google.com/group/microsoft.public.dotnet.languages.vc/msg/3f5536f97758b712[^] but unfortunately I don't think it will be of much use, since no one else was able to reproduce the bug. -- Marcus Kwok -- modified at 14:52 Tuesday 4th April, 2006
-
-
Does anybody else experience the following behavior? When I comment out the line
std::cout << 0;
inf()
, everything works fine. However, if I uncomment the line, then when I change the filter in the OpenFileDialog, all the files in the list disappear. This is using Visual C++ .NET 2003 (Managed Extensions to C++, not C++/CLI).-
I created a new Visual C++ Windows Forms Application (.NET).
-
I added a button to this form.
-
I added an event handler for this button that consists of the following:
OpenFileDialog* dlg = new OpenFileDialog; dlg->Filter = "Text Files (*.txt)|*.txt|All Files (*.*)|*.*"; dlg->ShowDialog();
-
I added a native C++ file that consists of the following:
#include <iostream> void f() { // Comment the following line to get correct behavior std::cout << 0; }
-
I turned off Precompiled Headers for the project. (not essential, otherwise you need to add
#include "stdafx.h"
to the native file). -
Compile and run (click the button then change the file filter).
Note that nowhere in the program did I actually call the function
f()
. It seems that its mere existence in the project is enough to mess this up. -- Marcus Kwok -