G
Guest
I have a coding problem. I hope I can explain it well enough.
I’m using VC++.NET, managed window forms
I want a dialog window change some process going on controlled by a class
defined in my main window form class.
Let my give you some code snippets to make it clearer (hopefully):
public class someclass
{
//code goes here
};
public: __gc class fclDialog
{
public:
void DoSomethingToo(void)
{
fclMainWindow->DoSomethig();
}
};
public __gc class fclMainWindow
{
public:
someclass A = new someclass;
void DoSomething(void)
{
//Code that effects “someclassâ€
A->…
};
void OpenDialog(void)
{
fclDialog *DlgForm = new fclDialog();
DlgForm->Show();
};
};
I hope you can see what I’m trying to do. A function in the Dialog class has
to call a function in the MainWindow class from which it has been created and
called. When I try to compile my code I get an error saying that I can’t call
a non static function like this, and if I use the keyword static (static void
DoSomething(void)) I get an error saying it can not be used on functions with
file scope. What do I have to change?
Chris
I’m using VC++.NET, managed window forms
I want a dialog window change some process going on controlled by a class
defined in my main window form class.
Let my give you some code snippets to make it clearer (hopefully):
public class someclass
{
//code goes here
};
public: __gc class fclDialog
{
public:
void DoSomethingToo(void)
{
fclMainWindow->DoSomethig();
}
};
public __gc class fclMainWindow
{
public:
someclass A = new someclass;
void DoSomething(void)
{
//Code that effects “someclassâ€
A->…
};
void OpenDialog(void)
{
fclDialog *DlgForm = new fclDialog();
DlgForm->Show();
};
};
I hope you can see what I’m trying to do. A function in the Dialog class has
to call a function in the MainWindow class from which it has been created and
called. When I try to compile my code I get an error saying that I can’t call
a non static function like this, and if I use the keyword static (static void
DoSomething(void)) I get an error saying it can not be used on functions with
file scope. What do I have to change?
Chris