Board index » cppbuilder » SaveDialog bug?
Analian
CBuilder Developer |
SaveDialog bug?2005-02-21 05:52:11 PM cppbuilder45 I've got this piece of code: FILE *fi; fi = fopen ("bla.txt", "r"); if (fi == 0) Edit2->Text = "NULL"; else Edit2->Text = "OK"; fclose (fi); SaveDialog1->Execute(); // Line X fi = fopen ("bla.txt", "r"); if (fi == 0) Edit3->Text = "NULL"; else Edit3->Text = "OK"; fclose (fi); Edit1, Edit2, Edit3, SaveDialog1 are in a TForm. The file bla.txt is present in the current dir. The strange thing that happens is: When the code above starts working it comes to Line X and the user is prompted for action. If I choose "cancel" at the dialog, Edit1->Text and Edit2->Text are "OK". But, if I type some filename and then select "save" Edit2->Text is "OK" and Edit3->Text is "NULL; If I select "save" again, both Edit1->Text and Edit2->Text are "NULL"; So, why using SaveDialog1 interfers with fopen's work and prevents in from opening files at sometimes and is it some kind of a bug or I'm not doing something correctly. If a bug, how to solve the problem? |