-
What about this?
class Class1{ //dialog class
int m_1;
void setm1(int m);
}
class Class2{
HWND tbd;
}
Class1::Class1(){
Class2 c2;
c2.tbd = m_hWnd;
}
Class2::Class2(){
tbd->setm1 - //why wont this work???
}
All I want to do is add to a listbox on a dialog from a child class of the dialog...
-
not certain what you're trying to do, but the HWND handle is just for passing to api functions, declare tbd as Class1* maybe?
-
I tried that... All I want to do is call a dialog function that will add a string to the list box.
-
you'd need to pass an argument as well, that function name wont do anything
-
I did pass an argument. The compiler doesn't understand the relationship between the pointer and the function..
tbd->setm1(2)
gives a compiler error of:
C2227 left of -> must point to class/struct/union.
I did include the header file in the code, too.
-
The compiler error says it all: HWND is not a struct/union/class pointer