尝试使用2010速成版重新启动Visual C++。
想弄明白些什么。
如果在
Project.cpp
文件,为什么我不能在
Form1.h
文件,特别是私有文件:
System::Void Form1_Load
?
我收到此错误:
1>c:\users\boss\documents\visual studio 2010\projects\second\second\Form1.h(94): error C3861: 'Function': identifier not found
有没有办法定义一个函数,以便它可以在任何地方使用?
在Form1.h中:
private: System::Void Form1_Load(System::Object^ sender, System::EventArgs^ e) {
this->txtMain->Text += FunctionX("Data");
this->txtMain->SelectionStart = this->txtMain->Text->Length;
}
在Project.cpp中:
std::string FunctionX(std::string message) {
return message;
}