In my project there is one .cpp file which include main() function and one more function which I want to call from Form1.h on button click event.
My code:
My someting.cpp
main()
{
Application::Run(gcnew Form1());
return 0;
}
my_function()
{
/code
}
My Form1.h
namespace somthing {
//auto generated code
private: System::Void button1_Click(System::Object^ sender, System::EventArgs^ e)
{
my_function();
}
}
That’s because the .h file doesn’t know the content of the .cpp file.
Try declaring the body of your onClick in the .cpp file.