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::DialogResult::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());
}
}
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.)
Re: dialog box for visual studios2005
thanks for the information. clearly im a beginner at this so i really appreciate it.
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);
Re: dialog box for visual studios2005
Quote:
Originally Posted by
mayweather
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
Re: dialog box for visual studios2005
Well, technically speaking, just open your source file in the Visual Studio code editor and change it. :p
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...