Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

callback in class

Status
Not open for further replies.

wduty

Programmer
Jun 24, 2000
271
US
I am subclassing a dialog and want to put the callback procedure into a class which manages that part of an application. I get the following cast error:

cannot convert from
'long (__stdcall ManagerObj::*)(struct HWND__ *, unsinged int, unsigned int, long)'
to
'unsigned long'

This occurs when I try to subclass the callback as follows:

origLineNumsProc = (WNDPROC)SetWindowLong(ghNums, GWL_WNDPROC, (DWORD)LineNumsProc);

The error refers to the third param of SetWindowLong. The same subclass attempt works in the global space of the program but putting into this class causes this error. The class declaration compiles fine as long as I don't try to subclass the dialog.
--Will Duty
wduty@radicalfringe.com

 
Make that function static. John Fill
1c.bmp


ivfmd@mail.md
 
I tried that already. Didn't work. But I'll try it again. Thanks.
--Will Duty
wduty@radicalfringe.com

 
What didn't work? It didn't compilled or didn't work at runtime? I both cases, tell me the what was the trouble. A suggestion, a static function doesn't have access to a class member because doesn't receive the pointer this. John Fill
1c.bmp


ivfmd@mail.md
 
Didn't compile. I will try it again as soon as I have time and post exactly what happens. Thanks John.
--Will Duty
wduty@radicalfringe.com

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top