Click here to Skip to main content
15,918,404 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: Problem in Using CEdit box control. Pin
Cool_Dev11-Oct-10 3:12
Cool_Dev11-Oct-10 3:12 
AnswerRe: Problem in Using CEdit box control. Pin
David Crow11-Oct-10 4:13
David Crow11-Oct-10 4:13 
GeneralRe: Problem in Using CEdit box control. Pin
Le@rner11-Oct-10 18:19
Le@rner11-Oct-10 18:19 
GeneralRe: Problem in Using CEdit box control. Pin
David Crow12-Oct-10 3:32
David Crow12-Oct-10 3:32 
QuestionOne c++ project how to transmit it to WSDL Pin
yu-jian11-Oct-10 1:09
yu-jian11-Oct-10 1:09 
AnswerRe: One c++ project how to transmit it to WSDL Pin
Aisteru M.11-Oct-10 23:48
Aisteru M.11-Oct-10 23:48 
GeneralRe: One c++ project how to transmit it to WSDL Pin
yu-jian15-Oct-10 6:50
yu-jian15-Oct-10 6:50 
QuestionExcel Issue Pin
Pryabu10-Oct-10 23:53
Pryabu10-Oct-10 23:53 
AnswerRe: Excel Issue Pin
prasad_som11-Oct-10 0:35
prasad_som11-Oct-10 0:35 
QuestionRasSetCustomAuthData is writting corrupted data in rasphone.pbk Pin
birajendu10-Oct-10 22:04
birajendu10-Oct-10 22:04 
Question64-Bit Printer Driver vs 32-Bit Printer Driver and viceversa Pin
msr_codeproject10-Oct-10 18:55
msr_codeproject10-Oct-10 18:55 
AnswerRe: 64-Bit Printer Driver vs 32-Bit Printer Driver and viceversa Pin
«_Superman_»10-Oct-10 19:02
professional«_Superman_»10-Oct-10 19:02 
GeneralRe: 64-Bit Printer Driver vs 32-Bit Printer Driver and viceversa Pin
msr_codeproject10-Oct-10 19:30
msr_codeproject10-Oct-10 19:30 
GeneralRe: 64-Bit Printer Driver vs 32-Bit Printer Driver and viceversa Pin
«_Superman_»10-Oct-10 22:06
professional«_Superman_»10-Oct-10 22:06 
AnswerRe: 64-Bit Printer Driver vs 32-Bit Printer Driver and viceversa Pin
Richard MacCutchan11-Oct-10 0:16
mveRichard MacCutchan11-Oct-10 0:16 
GeneralRe: 64-Bit Printer Driver vs 32-Bit Printer Driver and viceversa Pin
msr_codeproject11-Oct-10 1:44
msr_codeproject11-Oct-10 1:44 
GeneralRe: 64-Bit Printer Driver vs 32-Bit Printer Driver and viceversa Pin
Richard MacCutchan11-Oct-10 2:05
mveRichard MacCutchan11-Oct-10 2:05 
GeneralRe: 64-Bit Printer Driver vs 32-Bit Printer Driver and viceversa Pin
Alain Rist11-Oct-10 4:07
Alain Rist11-Oct-10 4:07 
QuestionImplementing CALLBACK in MFC getting error C2440: 'type cast' conversion problem Pin
Vaclav_10-Oct-10 16:48
Vaclav_10-Oct-10 16:48 
AnswerRe: Implementing CALLBACK in MFC getting error C2440: 'type cast' conversion problem Pin
Tim Craig10-Oct-10 17:23
Tim Craig10-Oct-10 17:23 
GeneralRe: Implementing CALLBACK in MFC getting error C2440: 'type cast' conversion problem Pin
Vaclav_10-Oct-10 17:54
Vaclav_10-Oct-10 17:54 
GeneralRe: Implementing CALLBACK in MFC getting error C2440: 'type cast' conversion problem Pin
Tim Craig10-Oct-10 22:06
Tim Craig10-Oct-10 22:06 
GeneralRe: Implementing CALLBACK in MFC getting error C2440: 'type cast' conversion problem [modified] Pin
Vaclav_11-Oct-10 2:57
Vaclav_11-Oct-10 2:57 
GeneralRe: Implementing CALLBACK in MFC getting error C2440: 'type cast' conversion problem Pin
Tim Craig11-Oct-10 9:42
Tim Craig11-Oct-10 9:42 
For an SDI app, I'd just keep a pointer to the view somewhere the callback function can find it. Then when it gets the data, it can use the view pointer to call methods on the view instance and to its thing. For an SDI app, it's a little tougher if you want multiple views interacting with the callback. If it was the active view you wanted to receive the data, you could keep the pointer updated everytime a view is activated. Not very C++ elegant but it's one solution.

Some APIs that use callbacks help by letting you pass a "magic cookie" which is usually a void pointer and then give it back to you with the data. If you passed the view pointer, you could cast it back inside the callback function and have your way with the associated view. Not type safe but at least it's in a very limited scope.
Once you agree to clans, tribes, governments...you've opted for socialism. The rest is just details.

GeneralRe: Implementing CALLBACK in MFC getting error C2440: 'type cast' conversion problem Pin
Vaclav_11-Oct-10 12:45
Vaclav_11-Oct-10 12:45 

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.