Hello, I have a quick question regarding passing variables by reference that reside within a class. On most tutorials that I've seen (I dunno, actually I haven't seen this covered at all really) they simple have the a private class variable and a public function which takes the variable to modify it. What I'm saying might be hard to picture, so here's an example (of exactly what I'm trying to do!):
http://www.relisoft.com/win32/winnie.html
I was wondering if, instead, I could do something like this:Code:class WinClass { public: WinClass (WNDPROC winProc, char const * className, HINSTANCE hInst); void Register () { ::RegisterClass (&_class); } private: WNDCLASS _class; };
Naturally, this doesn't work, I do not know exactly what it is resolving the address of, but it's not passing my wndClass by reference to the function (I don't think!). If this really is the method I should use, I don't know my problem is and I'll post more of my code...or if this is completely not allowed in C++, sorry for being stupidCode:class SomeClass { public: WNDCLASS _wndClass } ...somemorecodehere... SomeClass* someClass = new SomeClass; ::RegisterClass(& (someClass->_wndClass) );. Thanks for your time
Tonto



LinkBack URL
About LinkBacks
. Thanks for your time


