|
-
April 11th, 2003, 06:59 AM
#1
instance address
I have to register a class (MyClass1) pointer in another class (MyClass2). MyClass2 needs to have this pointer to execute methods from MyClass1 later. The code below doesn't work because the 'this' pointer is const. So how can I obtain an address of MyClass1 instance pointer in MyClass2 ?
class MyClass1 : class MyMotherClass
{
...
protected:
void Init() {theApp.m_pMyClass2->Register(this);}
...
}
class MyClass2
{
...
public:
void Register(MyMotherClass *& pMyMotherClass);
...
}
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|