Click here to Skip to main content
15,892,746 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: executing Pin
Hamid_RT18-Feb-07 5:43
Hamid_RT18-Feb-07 5:43 
QuestionVC++ Tutorial? Pin
Pr0f17-Feb-07 15:41
Pr0f17-Feb-07 15:41 
AnswerRe: VC++ Tutorial? Pin
David Crow17-Feb-07 16:03
David Crow17-Feb-07 16:03 
AnswerRe: VC++ Tutorial? Pin
Ravi Bhavnani17-Feb-07 16:26
professionalRavi Bhavnani17-Feb-07 16:26 
AnswerRe: VC++ Tutorial? Pin
Hamid_RT18-Feb-07 4:45
Hamid_RT18-Feb-07 4:45 
AnswerRe: VC++ Tutorial? Pin
Pr0f19-Feb-07 10:06
Pr0f19-Feb-07 10:06 
QuestionUser message Pin
Oliver12317-Feb-07 12:16
Oliver12317-Feb-07 12:16 
AnswerRe: User message Pin
Ravi Bhavnani17-Feb-07 15:06
professionalRavi Bhavnani17-Feb-07 15:06 
Oliver123 wrote:
This code works, but I don't like it.

I'm with you on this! Smile | :)

Here's an ultra-easy alternative, which while not perfect, has its advantages.
  1. Add 2 buttons (IDC_HOST_CHANGE and IDC_LOGON_CHANGE) to CNewDlg and make them invisible.

  2. Write a handler for each - the one for IDC_HOST_CHANGE should call HostChange() and the one for IDC_LOGON_CHANGE should call LogonChange().

  3. HostChange() and LogonChange() should get a pointer to an (perhaps the) instance of LinkPtr via a singleton access method exposed by your app class.

  4. Your static callbacks should post the appropriate message to your app's AfxGetMainWnd(). No casting to CNewDlg is required. For example:
    AfxGetMainWnd()->PostMessage (WM_COMMAND, IDC_HOST_CHANGE);
    
In lieu of a registered message, this provides a clean separation between event generation by your application's innards and event handling by your application's user interface.

/ravi

This is your brain on Celcius
Home | Music | Articles | Freeware | Trips
ravib(at)ravib(dot)com

AnswerRe: User message Pin
Gary R. Wheeler18-Feb-07 2:37
Gary R. Wheeler18-Feb-07 2:37 
QuestionChanging Shapes of Windows Pin
AprNgp17-Feb-07 8:31
AprNgp17-Feb-07 8:31 
AnswerRe: Changing Shapes of Windows Pin
Waldermort17-Feb-07 8:33
Waldermort17-Feb-07 8:33 
GeneralRe: Changing Shapes of Windows Pin
AprNgp17-Feb-07 8:43
AprNgp17-Feb-07 8:43 
GeneralRe: Changing Shapes of Windows Pin
Hamid_RT18-Feb-07 5:26
Hamid_RT18-Feb-07 5:26 
GeneralRe: Changing Shapes of Windows Pin
Waldermort18-Feb-07 5:53
Waldermort18-Feb-07 5:53 
GeneralRe: Changing Shapes of Windows Pin
Hamid_RT18-Feb-07 5:31
Hamid_RT18-Feb-07 5:31 
AnswerRe: Changing Shapes of Windows Pin
Newbie0017-Feb-07 10:56
Newbie0017-Feb-07 10:56 
GeneralRe: Changing Shapes of Windows Pin
Hamid_RT18-Feb-07 5:23
Hamid_RT18-Feb-07 5:23 
QuestionRe: Changing Shapes of Windows Pin
Newbie0018-Feb-07 6:10
Newbie0018-Feb-07 6:10 
AnswerRe: Changing Shapes of Windows Pin
Hamid_RT18-Feb-07 5:23
Hamid_RT18-Feb-07 5:23 
QuestionHow to change IWebBrowser2->LocationName ? Pin
amsdev17-Feb-07 7:48
amsdev17-Feb-07 7:48 
AnswerRe: How to change IWebBrowser2->LocationName ? Pin
Michael Dunn17-Feb-07 9:13
sitebuilderMichael Dunn17-Feb-07 9:13 
AnswerRe: How to change IWebBrowser2->LocationName ? Pin
prasad_som17-Feb-07 15:50
prasad_som17-Feb-07 15:50 
QuestionDirect X 9.0 and Visual C++ 6.0 Pin
Dosin17-Feb-07 5:39
Dosin17-Feb-07 5:39 
AnswerRe: Direct X 9.0 and Visual C++ 6.0 Pin
Waldermort17-Feb-07 6:40
Waldermort17-Feb-07 6:40 
QuestionPalettes and HDC?? Pin
dSolariuM17-Feb-07 3:01
dSolariuM17-Feb-07 3:01 

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.