CSlider Control Problems.
-
Hi! I create an object of class A in my code. An object of dialogWnd, dlg, is created. See dialogWnd below. When I attempt m_Slide.SetRange(1, 300), in OnInitDialog(), my program crashes every time. Can anyone give me some idea what is going on? Also, how do you distinguish between CSlider controls if you have more than one is a dialog resource? class A : public CMDIChildWnd { public: dialogWnd dlg; }; BOOL dialogWnd::OnInitDialog() { CDialog::OnInitDialog(); m_Slide.SetRange(1, 300); return TRUE; } class dialogWnd : public CDialog { public: dialogWnd(CWnd* pParent = NULL); virtual ~dialogWnd(); //Dialog Data //{{AFX_DATA(dialogWnd) enum {IDD = IDD_DIALOGWND}; CSliderCtrl m_Slide; //}}AFX_DATA Thanks. Jerry :)
-
Hi! I create an object of class A in my code. An object of dialogWnd, dlg, is created. See dialogWnd below. When I attempt m_Slide.SetRange(1, 300), in OnInitDialog(), my program crashes every time. Can anyone give me some idea what is going on? Also, how do you distinguish between CSlider controls if you have more than one is a dialog resource? class A : public CMDIChildWnd { public: dialogWnd dlg; }; BOOL dialogWnd::OnInitDialog() { CDialog::OnInitDialog(); m_Slide.SetRange(1, 300); return TRUE; } class dialogWnd : public CDialog { public: dialogWnd(CWnd* pParent = NULL); virtual ~dialogWnd(); //Dialog Data //{{AFX_DATA(dialogWnd) enum {IDD = IDD_DIALOGWND}; CSliderCtrl m_Slide; //}}AFX_DATA Thanks. Jerry :)
jerry1211a wrote: my program crashes every time. Kind of vague on your description aren't you? Usually when a program crashes (especially in DEBUG mode) there will be some kind of error message. If you would enlighten those of us without mind reading abilities as to what the actual error message is we may be able to help you.
"You're obviously a superstar." - Christian Graus about me - 12 Feb '03 "Obviously ??? You're definitely a superstar!!!" - mYkel - 21 Jun '04 "There's not enough blatant self-congratulatory backslapping in the world today..." - HumblePie - 21 Jun '05 Within you lies the power for good - Use it!
-
Hi! I create an object of class A in my code. An object of dialogWnd, dlg, is created. See dialogWnd below. When I attempt m_Slide.SetRange(1, 300), in OnInitDialog(), my program crashes every time. Can anyone give me some idea what is going on? Also, how do you distinguish between CSlider controls if you have more than one is a dialog resource? class A : public CMDIChildWnd { public: dialogWnd dlg; }; BOOL dialogWnd::OnInitDialog() { CDialog::OnInitDialog(); m_Slide.SetRange(1, 300); return TRUE; } class dialogWnd : public CDialog { public: dialogWnd(CWnd* pParent = NULL); virtual ~dialogWnd(); //Dialog Data //{{AFX_DATA(dialogWnd) enum {IDD = IDD_DIALOGWND}; CSliderCtrl m_Slide; //}}AFX_DATA Thanks. Jerry :)
-
Hi! I create an object of class A in my code. An object of dialogWnd, dlg, is created. See dialogWnd below. When I attempt m_Slide.SetRange(1, 300), in OnInitDialog(), my program crashes every time. Can anyone give me some idea what is going on? Also, how do you distinguish between CSlider controls if you have more than one is a dialog resource? class A : public CMDIChildWnd { public: dialogWnd dlg; }; BOOL dialogWnd::OnInitDialog() { CDialog::OnInitDialog(); m_Slide.SetRange(1, 300); return TRUE; } class dialogWnd : public CDialog { public: dialogWnd(CWnd* pParent = NULL); virtual ~dialogWnd(); //Dialog Data //{{AFX_DATA(dialogWnd) enum {IDD = IDD_DIALOGWND}; CSliderCtrl m_Slide; //}}AFX_DATA Thanks. Jerry :)
What does the dialog's
DoDataExchange()
method look like? Put a breakpoint on theSetRange()
method and single-step from there. Where does it "crash?"
"Ideas are a dime a dozen. People who put them into action are priceless." - Unknown
-
What does the dialog's
DoDataExchange()
method look like? Put a breakpoint on theSetRange()
method and single-step from there. Where does it "crash?"
"Ideas are a dime a dozen. People who put them into action are priceless." - Unknown
Hey there! Sorry about my confusing explanation, I had been coding all day as was burned out. Anyway, what I am looking for is a simple example of a project just using a slider control, showing DoDataExchange, etc. I assume I need a separate slider class to init the control through a construtor?? I can't seem to find an example. Thanks again, you have helped me before :) Jerry
-
Hey there! Sorry about my confusing explanation, I had been coding all day as was burned out. Anyway, what I am looking for is a simple example of a project just using a slider control, showing DoDataExchange, etc. I assume I need a separate slider class to init the control through a construtor?? I can't seem to find an example. Thanks again, you have helped me before :) Jerry
jerry1211a wrote: Anyway, what I am looking for is a simple example of a project just using a slider control, showing DoDataExchange, etc...I can't seem to find an example. There are several examples here. jerry1211a wrote: I assume I need a separate slider class to init the control through a construtor?? For each slider control on the dialog, a
CSliderCtrl
member control variable will be needed.
"Ideas are a dime a dozen. People who put them into action are priceless." - Unknown
-
jerry1211a wrote: Anyway, what I am looking for is a simple example of a project just using a slider control, showing DoDataExchange, etc...I can't seem to find an example. There are several examples here. jerry1211a wrote: I assume I need a separate slider class to init the control through a construtor?? For each slider control on the dialog, a
CSliderCtrl
member control variable will be needed.
"Ideas are a dime a dozen. People who put them into action are priceless." - Unknown
Thanks...have a good weekend.