CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 6 of 6
  1. #1
    Join Date
    Mar 2013
    Posts
    7

    dialog box for visual studios2005

    i've took some codes from VS 2010 to make a dialog box in VS 2005 but there are errors to it. can someone help me with this problem. the codes are stated below.

    OpenFileDialog ^ openFileDialog1= gcnew OpenFileDialog();
    OpenFileDialog1->Filter = "Image Files|*.tif";
    OpenFileDialog1->Title = "Select a Image File";



    // Show the Dialog.

    // If the user clicked OK in the dialog and

    // a .CUR file was selected, open it.

    if (OpenFileDialog1->Sho() == System::Windows::Forms:ialogResult::OK)

    {

    // Assign the cursor in the Stream to

    // the Form's Cursor property.

    marshal_context ^ context = gcnew marshal_context();

    const char* str4 = context->marshal_as<const char*>(openFileDialog1->FileName);

    IplImage* img = cvLoadImage(str4);

    cvNamedWindow("MyWindow");

    cvShowImage("MyWindow", img);

    cvWaitKey(0);

    cvDestroyWindow("MyWindow");

    cvReleaseImage(&img);

    // return 0;





    // this->Cursor = gcnew

    // System::Windows::Forms::Cursor(

    // openFileDialog1->OpenFile());

    }

    }

  2. #2
    Join Date
    Jun 2010
    Location
    Germany
    Posts
    2,675

    Re: dialog box for visual studios2005

    Your code is Windows Forms written in C++/CLI, at least basically/mostly. The forum section here, where you posted, is dedicated to native C++ (with MFC), which is quite different. There's a separate forum section on C++/CLI, http://forums.codeguru.com/forumdisp...ed-C-and-C-CLI, so I suggest you repost your inquiry there. (If it could be answered quickly in a short response, I'd have tried to do that here, but this one looks like it will likely lead to a rather extensive discussion which would be too off-topic here.)
    I was thrown out of college for cheating on the metaphysics exam; I looked into the soul of the boy sitting next to me.

    This is a snakeskin jacket! And for me it's a symbol of my individuality, and my belief... in personal freedom.

  3. #3
    Join Date
    Mar 2013
    Posts
    7

    Re: dialog box for visual studios2005

    thanks for the information. clearly im a beginner at this so i really appreciate it.

  4. #4
    Join Date
    Mar 2013
    Posts
    7

    Re: dialog box for visual studios2005

    how can i change this set of codes to sting form?


    marshal_context ^ context = gcnew marshal_context();

    const char* str4 = context->marshal_as<const char*>(openFileDialog1->FileName);

  5. #5
    Join Date
    Apr 1999
    Posts
    27,449

    Re: dialog box for visual studios2005

    Quote Originally Posted by mayweather View Post
    how can i change this set of codes to sting form?
    Why are you still posting Windows Forms/Managed C++ code in this forum?

    Regards,

    Paul McKenzie

  6. #6
    Join Date
    Jun 2010
    Location
    Germany
    Posts
    2,675

    Re: dialog box for visual studios2005

    Well, technically speaking, just open your source file in the Visual Studio code editor and change it.

    No, honestly, don't you think yourself that your question is pretty vague?

    Also, I think we had already settled for your code being (mostly) C++/CLI, and already started a more elaborate thread about it in the respective forum section. So please post a (much) more detailed question in our other thread at http://forums.codeguru.com/showthrea...inner-at-this..

    Perhaps you should best start your post in the other thread by explaining what you want your program to do in the first place. I still didn't really get that, you know...
    I was thrown out of college for cheating on the metaphysics exam; I looked into the soul of the boy sitting next to me.

    This is a snakeskin jacket! And for me it's a symbol of my individuality, and my belief... in personal freedom.

Tags for this Thread

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