0

我想将图像文件的完整路径 + 名称 + 扩展名显示到 Visual C++ 文本框(Windows 窗体),当我尝试构建它时,它失败了:

1>------ Build started: Project: Testing, Configuration: Debug Win32 ------
1>  Testing.cpp
1>Testing.obj : error LNK2020: unresolved token (06000003) Testing.Form1::GetFileName
1>c:\users\febri nur hidayat\documents\visual studio 2010\Projects\Testing\Debug\Testing.exe : fatal error LNK1120: 1 unresolved externals
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========


这是我的源代码:

private: System::Void textBox1_Click(System::Object^  sender, System::EventArgs^  e) {
    if(openFileDialog1->ShowDialog() == System::Windows::Forms::DialogResult::OK){
        this->pictureBox1->Image = Image::FromFile(openFileDialog1->FileName);
        String^ sourceImage;
        citra = Path::GetFileName(openFileDialog1->FileName);
        this->textBox1->Text = sourceImage;
    }
}


任何建议或我应该编码什么?

4

0 回答 0