
Originally Posted by
skrewdlude
That code should run now. You had forgotten the () after declaring the classes, and a few other minor things. Also, you should give your classes modifers (public, private, etc ).
The problem wasn't that it wouldn't compile, I wrote that _example_ from my memory.
The problem with having two "new" declarations of the other class
Code:
Class A....
myb = new Class B
Class B...
myA = new Class A
Is that you create an endless spiral that eventually (long before the app launched) will make .net puke.
I ended up solving it this way:
Code:
public class ClassA: CFPlugin
{
...............
private ClassB m_ClassB
public ClassA()
{
m_ClassB= new ClassB();
m_ClassB.init(this);
}
..............
}
public class ClassB
{
..................
private ClassA m_ClassA
public ClassB()
{
//
// TODO: Add constructor logic here
//
}
public void init(ClassA pc)
{
m_ClassA=pc;
}
Bookmarks