Click here to Skip to main content
15,894,410 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: function send() (Winsocks) help !! Pin
ThatsAlok18-Oct-05 19:47
ThatsAlok18-Oct-05 19:47 
QuestionHow can I make a modeless topmost for the desktop ? Pin
yarp18-Oct-05 4:03
yarp18-Oct-05 4:03 
AnswerRe: How can I make a modeless topmost for the desktop ? Pin
Iain Clarke, Warrior Programmer18-Oct-05 4:25
Iain Clarke, Warrior Programmer18-Oct-05 4:25 
GeneralRe: How can I make a modeless topmost for the desktop ? Pin
yarp18-Oct-05 5:47
yarp18-Oct-05 5:47 
AnswerRe: How can I make a modeless topmost for the desktop ? Pin
Arman S.18-Oct-05 10:35
Arman S.18-Oct-05 10:35 
AnswerRe: How can I make a modeless topmost for the desktop ? Pin
S Douglas18-Oct-05 22:50
professionalS Douglas18-Oct-05 22:50 
AnswerRe: How can I make a modeless topmost for the desktop ? Pin
yarp20-Oct-05 6:19
yarp20-Oct-05 6:19 
QuestionAccess Violation Error Pin
nripun18-Oct-05 3:50
nripun18-Oct-05 3:50 
I created a dialog class CSchDlg derived from CDialog. The dialog box has a few buttons(radio and checkboxes also) and a list box. Using the class wizard i created member variables of type CButton for all the buttons and of type CListBox for the list box.

Inside the OnInitDialog() i tried the following.
Say m_ctrlButton1 is of type CButton and is the member variable for the radio button with the ID IDC_RADIOBUTTON1
<br />
m_ctrButton1.SetCheck(BST_CHECKED);<br />

The above stmt produced error.

So i changed it to

<br />
CButton *pButton;<br />
pButton = (CButton *) this->GetDlgItem(IDC_RADIOBUTTON1);<br />
pButton->SetCheck(BST_CHECKED);<br />


... and it worked fine.

I tried the same thing for the ListBox also.

<br />
CListBox *pListBox;<br />
pListBox = (CListBox*) this->GetDlgItem(IDC_LISTBOX1);<br />


... but it produced Access Violation Error


What could be the reason?

Why do i have to use GetDlgItem() to set/enable or do anything on the buttons inside the OnInitDlg() but neednt do it in other functions?
AnswerRe: Access Violation Error Pin
David Crow18-Oct-05 3:57
David Crow18-Oct-05 3:57 
GeneralRe: Access Violation Error Pin
Chris Losinger18-Oct-05 4:03
professionalChris Losinger18-Oct-05 4:03 
GeneralRe: Access Violation Error Pin
David Crow18-Oct-05 4:43
David Crow18-Oct-05 4:43 
GeneralRe: Access Violation Error Pin
Chris Losinger18-Oct-05 4:50
professionalChris Losinger18-Oct-05 4:50 
GeneralRe: Access Violation Error Pin
nripun18-Oct-05 5:21
nripun18-Oct-05 5:21 
GeneralRe: Access Violation Error Pin
Rage18-Oct-05 5:43
professionalRage18-Oct-05 5:43 
GeneralRe: Access Violation Error Pin
nripun19-Oct-05 0:45
nripun19-Oct-05 0:45 
GeneralRe: Access Violation Error Pin
Rage18-Oct-05 5:47
professionalRage18-Oct-05 5:47 
QuestionRe: Access Violation Error Pin
David Crow18-Oct-05 5:50
David Crow18-Oct-05 5:50 
Questiontime help pleas Pin
Gapilazo18-Oct-05 3:18
Gapilazo18-Oct-05 3:18 
AnswerRe: time help pleas Pin
Calc2018-Oct-05 3:44
Calc2018-Oct-05 3:44 
AnswerRe: time help pleas Pin
vikas amin18-Oct-05 3:45
vikas amin18-Oct-05 3:45 
QuestionRe: time help pleas Pin
David Crow18-Oct-05 3:50
David Crow18-Oct-05 3:50 
QuestionCString memory leak Pin
mails_aphale18-Oct-05 2:50
mails_aphale18-Oct-05 2:50 
AnswerRe: CString memory leak Pin
prasad_som18-Oct-05 3:02
prasad_som18-Oct-05 3:02 
GeneralRe: CString memory leak Pin
mails_aphale18-Oct-05 3:48
mails_aphale18-Oct-05 3:48 
AnswerRe: CString memory leak Pin
vikas amin18-Oct-05 3:51
vikas amin18-Oct-05 3:51 

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.