error C2664: 'void System::Windows::Forms::TextBox::set_Text(System:: String __gc *)' : cannot convert parameter 1 from 'int' to 'System::String __gc *'
error C2039: 'SetParameter' : is not a member of 'System::Windows::Forms::Form'
Form1.cpp main:
Code:
int APIENTRY _tWinMain(HINSTANCE hInstance,
HINSTANCE hPrevInstance,
LPTSTR lpCmdLine,
int nCmdShow)
{
int test1;
string line;
System::Threading::Thread::CurrentThread->ApartmentState = System::Threading::ApartmentState::STA;
ifstream iFile("test.txt");
if (!iFile)
{
//error msg
return -1;
}
iFile >> test1;
iFile.close();
Form *Form1 = new Form();
Form1->SetParameter(test1); //put parameter into form
Application::Run(Form1); //run app
return 0;
}
Code:
public __gc class Form1 : public System::Windows::Forms::Form
{
public:
Form1()
{
InitializeComponent();
}
void SetParameter(int t){
textBox1->Text = t;
}
protected:
void Dispose(Boolean disposing)......
.....
.....
.....
Million thanks again.

