From: SMTP%"BFiske@clariion.com" 30-DEC-1997 17:41:25.35 To: "'ntdev@atria.com'" CC: Subj: FW: [ntdev] Simple MFC question, sorry... Return-Path: owner-ntdev@atria.com Received: by arisia.gce.com (UCX V4.1-12C, OpenVMS V7.1 VAX); Tue, 30 Dec 1997 17:38:17 -0500 Received: from gw.atria.com (gw.atria.com [192.88.237.2]) by mercury.mv.net (8.8.8/mem-971025) with SMTP id PAA07900 for ; Tue, 30 Dec 1997 15:27:09 -0500 (EST) Received: by gw.atria.com id Tue, 30 Dec 1997 11:44:36 -0500 Received: from dg-webo.webo.dg.com by gw.atria.com id Tue, 30 Dec 1997 11:44:31 -0500 Received: from imps0014 by dg-webo.webo.dg.com (5.4R3.10/dg-webo-v1) id AA18661; Tue, 30 Dec 1997 11:43:59 -0500 Received: by imps0014.us.dg.com with Internet Mail Service (5.0.1458.49) id ; Tue, 30 Dec 1997 11:43:58 -0500 Message-Id: <4B9D26C3380BD011A21F0000F8010A9B0279CD30@imps0014.us.dg.com> From: "Fiske, Bob" To: "'ntdev@atria.com'" Subject: FW: [ntdev] Simple MFC question, sorry... Date: Tue, 30 Dec 1997 11:42:49 -0500 X-Priority: 3 X-Mailer: Internet Mail Service (5.0.1458.49) Sender: owner-ntdev@atria.com Precedence: bulk X-Majordomo-Taboo: ntdev > Another solution is to use the GetDlgItem function. In any function > in your dialog class (OnInitDialog, OnOK, etc), you can issue a call > such as > CButton * pMyButtonWindow = (CButton *)GetDlgItem(IDC_MYBUTTONID) > to get the handle to the dialog control. You can then call any of the > CButton functions such as > pMyButtonWindow->SetCheck(). > The technique described by Tom below works equally well if you don't need to receive the contents or state of the dialog object in the member variable. Using GetDlgItem allows you to define the member variable as CString or int and receive the state or contents of the variable via a call to UpdateData(true). > -----Original Message----- > From: Thomas F. Divine [SMTP:tdivine@pcausa.com] > Sent: Tuesday, December 30, 1997 1:02 AM > To: Richard Hartman; ntdev@atria.com > Subject: Re: [ntdev] Simple MFC question, sorry... > > At 05:14 PM 12/29/97 -0800, Richard Hartman wrote: > >I'm throwing a quick MFC wrapper around a server program I've written > and > >need an answer to what's probably a simple question. I've used the > dialog > >editor to put a checkbox on the dialog box, which I presume creates a > >CButton object. I want to call GetCheck and SetCheck on that button > to read > >and write its status, but I can't find any reference to a CButton > object > >anywhere in any of the source files! In fact, the pattern "CButton" > doesn't > >appear in any of the files in the project directory. I can use the > >ClassWizard to attach functions to mouse clicks on it, so I know VC > is aware > >of the object... but it seems like a waste to define a whole new > function > >and a new boolean variable to do what the CButton object already does > >internally. I just want to read and write what is already there. > Thanks for > >your indulgence with this admittedly elementary MFC question. > > > Use the MFC Class Wizzard to add a member variable of type CButton to > your > dialog class. e.g. call it m_MyButton; Then you can use > m_MyButton.SetCheck(1), etc. like you want. > > Regards, > > Thomas F. Divine > > President > > Printing Communications Associates, Inc. > 4201 Brunswick Court > Smyrna GA 30080 U.S.A. > Tel: (770) 423-4580 -OR- (770) 436-1714 > Fax: (770) 436-7246 > WWW: http://www.pcausa.com/ > - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - > [ To unsubscribe, send email to ntdev-request@atria.com with body > UNSUBSCRIBE (the subject is ignored). ] - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - [ To unsubscribe, send email to ntdev-request@atria.com with body UNSUBSCRIBE (the subject is ignored). ]