louarnold

louarnold

  • NA
  • 14
  • 6.9k

Cross-Class calling without passing references: How can do?

Jun 18 2011 3:46 PM
I'm working with VC 2010 Express with dotNet V4 under Windows XP. I have a small Windows Forms application with a main form and a subform. I have also constructed a utility class of useful functions. There will only ever be one instance of it, and I cannot make it a static class. How do I code a call from the subform to a public method of the utility class without passing a reference of the utility class to the subform?

Is there away to remove the utility class from the main project so as to allow any other classes to call the public methods directly (ie without passing around references)?

Just a note: Singletons and DLLs don't solve the problem of having to pass references. So forget those answers.

Answers (8)