CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Join Date
    Dec 2006
    Posts
    21

    Question problems with saveFileDialog

    Hi all,

    Have a bit of a strange one here.

    On my form, I'm using a SaveFileDialog box

    private: System::Windows::Forms::SaveFileDialog^ saveFileDialog1;


    on initiate


    this.saveFileDialog1.DefaultExt = "xml";

    this.saveFileDialog1.Filter = "SCM files|*.xml";

    this.saveFileDialog1.InitialDirectory = "c:\";

    when my user calls a save menu option, I initiate the dialog as follows:


    saveFileDialog1.ShowDialog();

    String temp = saveFileDialog1.FileName;

    ....


    When I test the code, I get the following result:
    1. save file dialogue pops up perfectly
    2. if saving a new file name, all is well
    3. if REPLACING an existing file, all appears to hang.If the overwrite prompt
    is set to false then it will work.but it wont check wether the file exists or not

    Anyone have any ideas?
    Last edited by binilprasad; December 21st, 2006 at 07:26 AM.

  2. #2
    Join Date
    Nov 2006
    Posts
    15

    Re: problems with saveFileDialog

    Hmmm...

    I don't seem to be having any issues with my saving here... And i'm using (pretty much) the same code.

    Could it maybe have something to do with the file size???

    I'll take a look at my code, and I'll post the saving part here.

  3. #3
    Join Date
    Sep 2006
    Location
    Eastern, NC, USA
    Posts
    907

    Re: problems with saveFileDialog

    Quote Originally Posted by binilprasad
    Hi all,

    Have a bit of a strange one here.
    .........

    this.saveFileDialog1.DefaultExt = "xml";

    this.saveFileDialog1.Filter = "SCM files|*.xml";

    this.saveFileDialog1.InitialDirectory = "c:\";

    when my user calls a save menu option, I initiate the dialog as follows:


    saveFileDialog1.ShowDialog();

    String temp = saveFileDialog1.FileName;

    ....

    Anyone have any ideas?
    I'll bet that the problem is probably not with the saveFileDialog but with how you are saving the file. Please show us your "save file" code here, not just the dialog code. What are you using to save the file, a stream? Also, check your path statements that you have double "\\" backslashes instead of the single backslash that is shown here.

    Good luck!

    /Pete

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured