|
Callback crisis
I have this problem with a callback with dialog boxes... I want to make a class giving basic functionality using the DialogBox/CreateDialog functions, but the callback function is a problem, as I don't know how to access my original class from it.
Creating a global value just defeats the purpose of having it in a class, and there are no user defined parameters I can pass into the DialogBox/CreateDialog functions for use in the callback function (so no pointer passing).
And just using mfc is out because I want to use seperate resources from my dlls (which mfc, as far as I can figure out, spits the dummy over (AfxSetResourceHandle sets the resource for the entire program))
At the moment it is like this...
where DialogProc is static, but I want to get at the CMyDialog class that created the hWnd...
This is really pissing me off. Any ideas?
btw, I'm not going to be able to reply for a while...
Edited by - ludemann8 on March 5, 2001 2:34:25 PM
Here is a simple idea, hope it what you need.
When you call your callback function from you class pass this to it, now you've got a pointer to you dialog class.
I just noticed that you callback function is part of you dialog class so you don't need to pass this to it, its already available.
Edited by - xstreme2000 on March 5, 2001 3:43:44 PM
When you call your callback function from you class pass this to it, now you've got a pointer to you dialog class.
I just noticed that you callback function is part of you dialog class so you don't need to pass this to it, its already available.
Edited by - xstreme2000 on March 5, 2001 3:43:44 PM
Here''s how it''s usually done:
Cheers!
Meduzza
|
Cheers!
Meduzza
Thanks for the replies,
xstreme2000, that is no good as the callback function type is already defined.
Meduzza, thanks very much... I had a look and found that DialogBox is just a redifinition of DialogBoxParam. Thanks.
Edited by - ludemann8 on March 6, 2001 7:53:32 AM
Edited by - ludemann8 on March 6, 2001 7:55:52 AM
xstreme2000, that is no good as the callback function type is already defined.
Meduzza, thanks very much... I had a look and found that DialogBox is just a redifinition of DialogBoxParam. Thanks.
Edited by - ludemann8 on March 6, 2001 7:53:32 AM
Edited by - ludemann8 on March 6, 2001 7:55:52 AM
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement
Recommended Tutorials
Advertisement