|
-
Dec 18th, 2002, 01:29 PM
#1
Thread Starter
Member
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...
-
Dec 18th, 2002, 01:52 PM
#2
transcendental analytic
not certain what you're trying to do, but the HWND handle is just for passing to api functions, declare tbd as Class1* maybe?
Use  
writing software in C++ is like driving rivets into steel beam with a toothpick.
writing haskell makes your life easier:
reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.
-
Dec 18th, 2002, 01:56 PM
#3
Thread Starter
Member
I tried that... All I want to do is call a dialog function that will add a string to the list box.
-
Dec 18th, 2002, 02:23 PM
#4
transcendental analytic
you'd need to pass an argument as well, that function name wont do anything
Use  
writing software in C++ is like driving rivets into steel beam with a toothpick.
writing haskell makes your life easier:
reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.
-
Dec 18th, 2002, 02:30 PM
#5
Thread Starter
Member
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.
-
Dec 18th, 2002, 05:09 PM
#6
The compiler error says it all: HWND is not a struct/union/class pointer
All the buzzt
 CornedBee
"Writing specifications is like writing a novel. Writing code is like writing poetry."
- Anonymous, published by Raymond Chen
Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.
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
|