making a dialog box for VS 2005

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);


cvShowImage("MyWindow", img);




// return 0;

// this->Cursor = gcnew

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

// openFileDialog1->OpenFile());


Topic archived. No new replies allowed.