laod an image in visual c++ express edition

hi i m the project student and my project topic is "image processing"
sir i m working in Microsoft visual c++ 2008 express edition
n write a code for load a picture in it,but there is some error which i can't understand so plzzzz help me

private: System::Void openImageToolStripMenuItem_Click(System::Object^ sender, System::EventArgs^ e)
{
openFileDialog^ dlg=gcnew OpenFileDialog();
dlg->Filter="image files|*.jpg;*.jpeg;*.png;*.gif";
if(dlg->ShowDialog()==Windows::Forms::DialogResult::OK)
{
pictureBox1->Image = Image::FromFile(dlg->FileName);
pictureBox1->Top =0;
pictureBox1->Left=0;
pictureBox1->Height= pictureBox1->Image->Height;
pictureBox1->Width= pictureBox1->Image->Width;
} }};


list of error

error C2065: 'openFileDialog' : undeclared identifier
error C2065: 'dlg' : undeclared identifier
error C2065: 'dlg' : undeclared identifier
error C2227: left of '->Filter' must point to class/struct/union/generic type
error C2065: 'dlg' : undeclared identifier
error C2227: left of '->ShowDialog' must point to class/struct/union/generic type
type is ''unknown-type''
error C2065: 'dlg' : undeclared identifier
error C2227: left of '->FileName' must point to class/struct/union/generic type
type is ''unknown-type''
[code][/code][code][/code][code][/code][code][/code][code][/code][code][/code][code][/code][u][/u][u][/u][u][/u][code][/code]

Comments

  • openFileDialog //could be capital O
    dlg->filter="..." //did you try (struct)dlg->filter ? is dlg a void?
    ----------
    gwbasic 10 CLS
    qbasic A$=INKEY$
    fortran printf("hello word");
    labview |_|--->|_|-|-|_|----->o
    c if(A=='q') {
    cobol MOVE "hello world" TO A
    c++ }
    algol END
    pascal .
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

In this Discussion