Selecting and Opening Multiple Files
CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 4 of 4

Thread: Selecting and Opening Multiple Files

  1. #1
    Join Date
    Dec 2009
    Posts
    3

    Selecting and Opening Multiple Files

    Hello, I'm afraid I'm very new to programming and I only know the bare basics of Visual C++ so please excuse my lack of knowledge.

    I'm using Visual C++ 2008 Express Edition and I was given an already existing working program that adds images via "openFileDialog". Currently the program can only select one file at a time, so in order to open multiple files (which we do constantly) we have to keep clicking the "Add image" button and open each file separately. My task is to tweek the code to allow the user to select and import more than one file to this program with one click of this "Add image" button (I'm assuming this is done by holding the "Control" key and selecting more than one file). This sounds like an easy task but I'm so frustrated with messing with the code I figured I'd give the forum a shot.

    I was wondering, what would be the best way to go about performing this task? I've currently tried messing around with multiselect but I probably still don't have the knowledge to apply it.

    I've attached the section of the code in a .txt file that I believe to be the part that I'm suppose to alter.

    Sorry if I left out any vital information but the code is huge and I didn't want to post everything, so if I left out anything that can help more please let me know. Any help would be much appreciated. Thanks!
    Attached Files Attached Files

  2. #2
    Join Date
    Jul 2002
    Posts
    2,512

    Re: Selecting and Opening Multiple Files


  3. #3
    Join Date
    Dec 2009
    Posts
    3

    Re: Selecting and Opening Multiple Files

    Thanks for the advice Alex, but alas I am still having some minor problems.

    I keep coming up with the same error repeatedly:

    data.obj : error LNK2020: unresolved token (06000001) helloworld.Form1::get_FileNames
    1>C:\Users\rmlab\Documents\Visual Studio 2008\Projects\Nick Project\Debug\Nick Project.exe : fatal error LNK1120: 1 unresolved externals

    Apparently I'm not defining something correctly but I'm not sure what (maybe FileNames?).

    I've attached more of the code if that will help. Since it's a lot more than it was last time if you scroll down and watch the right hand side of the .txt document I've indictated with an arrow where I've added the new code. Chances are great that I've placed it in the wrong place.

    Thanks again.
    Attached Files Attached Files

  4. #4
    Join Date
    Jul 2002
    Posts
    2,512

    Re: Selecting and Opening Multiple Files

    Well, FileNames is only property declaration, without implementation. If you don't mplement it in .cpp file, write it inline:
    Code:
    property array<String^>^ FileNames 
    {
        array<String^>^ get ()
        {
             return ...;   // place here what you need
        }   
    }

Posting Permissions

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


Windows Mobile Development Center


Click Here to Expand Forum to Full Width

This is a CodeGuru survey question.


Featured


HTML5 Development Center