抱歉,我知道这方面有很多信息,但找不到任何与从非静态方法调用另一个项目中的另一个非静态方法有关的信息。这是我的问题:
我导入了一个现有项目并添加了参考。
我可以在导入的项目中调用静态方法。
但我不能调用非静态方法。
我从非静态方法调用。
I don't want to change the method in the imported project to static because then I think I will have trouble calling other non-static methods from that program.
Usually calling a non-static method from another non-static method is not a problem. I don't understand why calling a non-static method in an imported project will cause a problem.
Can someone suggest how I can do it? Do I have to create a new object? For example I had a go and tried:
Form newForm= new MyImportedProject.MyNonStaticMethod();
But there were not methods in newForm to call.