Click here to Skip to main content
15,912,578 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Using HOOKs Pin
Marcelo Guerra26-Dec-00 6:47
Marcelo Guerra26-Dec-00 6:47 
GeneralMoney 2000 Pin
pankaj8-Sep-00 21:07
pankaj8-Sep-00 21:07 
GeneralRe: Money 2000 Pin
David Wulff10-Sep-00 10:58
David Wulff10-Sep-00 10:58 
GeneralSetWindowLong Pin
Jamie Nordmeyer8-Sep-00 14:13
Jamie Nordmeyer8-Sep-00 14:13 
GeneralRe: SetWindowLong Pin
Michael Dunn8-Sep-00 20:57
sitebuilderMichael Dunn8-Sep-00 20:57 
GeneralRe: SetWindowLong Pin
Jamie Nordmeyer11-Sep-00 7:55
Jamie Nordmeyer11-Sep-00 7:55 
GeneralRe: SetWindowLong Pin
Michael Dunn11-Sep-00 8:16
sitebuilderMichael Dunn11-Sep-00 8:16 
GeneralRe: SetWindowLong Pin
Sam Hobbs11-Sep-00 17:50
Sam Hobbs11-Sep-00 17:50 
That is what the documentation says, but this is an example where the documentation is totally misleading. Just as a static function can access members of other classes, a static function is entirely capable of accessing members of it's own class.

Now I can hear you saying that I am quack or something like that, but I do it all the time. The thing that most people just do not realize is that you simply must provide to the static function (that does not have the "this" pointer) the pointer that it does not have. Very simple, yet it seems that many people overlook this and take the documentation too literally.

The trick of course is passing the pointer. Most callbacks and such have a parameter and the pointer can be passed as a parameter or part of a parameter. In the case of the situation being discussed, the solution is probably not so easy. It might be possible to use a solution simialr to MFC's solution to the equivalent problem. It is possible to create a mapping from the window handle to the pointer for the class. Right?

GeneralRich Edit Question Pin
Mihalcik8-Sep-00 8:25
sussMihalcik8-Sep-00 8:25 
GeneralMDI Child Window Pin
Jamie Nordmeyer8-Sep-00 7:46
Jamie Nordmeyer8-Sep-00 7:46 
GeneralRe: MDI Child Window Pin
Sam Hobbs8-Sep-00 8:34
Sam Hobbs8-Sep-00 8:34 
GeneralRe: MDI Child Window Pin
Jamie Nordmeyer8-Sep-00 8:44
Jamie Nordmeyer8-Sep-00 8:44 
GeneralRe: MDI Child Window Pin
Jamie Nordmeyer8-Sep-00 8:49
Jamie Nordmeyer8-Sep-00 8:49 
GeneralRe: MDI Child Window Pin
Sam Hobbs8-Sep-00 9:01
Sam Hobbs8-Sep-00 9:01 
GeneralDll programming... Linker Error Pin
thedogbear8-Sep-00 5:52
thedogbear8-Sep-00 5:52 
GeneralRe: Dll programming... Linker Error Pin
Chris Meech8-Sep-00 8:09
Chris Meech8-Sep-00 8:09 
GeneralCListViewCtrl (ATL) Pin
Chris B.8-Sep-00 5:00
Chris B.8-Sep-00 5:00 
GeneralRe: CListViewCtrl (ATL) Pin
Chris B.8-Sep-00 5:02
Chris B.8-Sep-00 5:02 
Generalsecond SelectObject crashs Pin
real name8-Sep-00 3:45
sussreal name8-Sep-00 3:45 
GeneralRe: second SelectObject crashs Pin
real name21-Sep-00 3:20
sussreal name21-Sep-00 3:20 
GeneralSendKeys Pin
Mustafa Demirhan8-Sep-00 2:07
Mustafa Demirhan8-Sep-00 2:07 
GeneralRe: SendKeys Pin
Remus Lazar8-Sep-00 2:54
Remus Lazar8-Sep-00 2:54 
GeneralRe: SendKeys Pin
Paolo Messina8-Sep-00 8:05
professionalPaolo Messina8-Sep-00 8:05 
GeneralRe: SendKeys Pin
Michael Dunn8-Sep-00 8:11
sitebuilderMichael Dunn8-Sep-00 8:11 
GeneralModeless dialog Pin
Mustafa Demirhan8-Sep-00 2:02
Mustafa Demirhan8-Sep-00 2:02 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.