I created a library in which one exposed function accepts a function pointer of type void(*fun_ptr)(int).
The function syntax is:
start_server(char *devices, char *folder, int number, int timeout, void(*status_of_server)(int));
This is working with normal C++ functions like void getStatus(int n); but when I used them in a Visual C++ environment for a GUI application, I'm getting this error:
A pointer to member is not valid for a managed class
start_server(&devs, &base, 1, 0, &TestApplication::MainWindow::StatusOfServer );
Where StatusOfServer is defined inside the MainWindow class which can be used for UI management.
private: void TestApplication::MainWindow::StatusOfServer(int n)
{
this->progressBar->Value = n;
}
What is the correct way of handling this?