Visual C++ - FileStream

This is a discussion on Visual C++ - FileStream within the C++ Programming forums, part of the General Programming Boards category; I'm trying to make a text editor with open, save, and font buttons. I copied the code off the board ...

  1. #1
    MB1
    MB1 is offline
    Registered User
    Join Date
    Feb 2005
    Posts
    38

    Visual C++ - FileStream

    I'm trying to make a text editor with open, save, and font buttons.

    I copied the code off the board in class and obviously incorrectly.

    FileStream is an undeclared identifier.

    Suggestions?

    Code as follows:
    Code:
         private: System::Void SaveBtn_Click(System::Object *  sender, System::EventArgs *  e)
         {
              SaveFileDialog * fd = new SaveFileDialog(); 
    	if(fd->ShowDialog() == DialogResult::OK)
    	{
    	MessageBox::Show(fd->FileName, S"FileName");
    	FileStream* fs = new FileStream(fd->FileName,  FileMode::OpenOrCreate);
    	StreamWriter * sw = new StreamWriter(fs);
    	}
         }

  2. #2
    Registered User hk_mp5kpdw's Avatar
    Join Date
    Jan 2002
    Location
    Northern Virginia/Washington DC Metropolitan Area
    Posts
    3,802
    Seems there was some code somewhere that described the FileStream object that you forgot to copy off the board.

    [edit]No wait... is this C# code?[/edit]
    "Owners of dogs will have noticed that, if you provide them with food and water and shelter and affection, they will think you are god. Whereas owners of cats are compelled to realize that, if you provide them with food and water and shelter and affection, they draw the conclusion that they are gods."
    -Christopher Hitchens

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. We Got _DEBUG Errors
    By Tonto in forum Windows Programming
    Replies: 5
    Last Post: 12-22-2006, 04:45 PM
  2. C++ std routines
    By siavoshkc in forum C++ Programming
    Replies: 33
    Last Post: 07-28-2006, 12:13 AM
  3. load gif into program
    By willc0de4food in forum Windows Programming
    Replies: 14
    Last Post: 01-11-2006, 09:43 AM
  4. Errors with including winsock 2 lib
    By gamingdl'er in forum C++ Programming
    Replies: 3
    Last Post: 12-05-2005, 07:13 PM
  5. Learning OpenGL
    By HQSneaker in forum C++ Programming
    Replies: 7
    Last Post: 08-06-2004, 08:57 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21