Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. CSlider Control Problems.

CSlider Control Problems.

Scheduled Pinned Locked Moved C / C++ / MFC
questionlearning
7 Posts 4 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • J Offline
    J Offline
    jerry1211a
    wrote on last edited by
    #1

    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 :)

    P N D 3 Replies Last reply
    0
    • J jerry1211a

      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 :)

      P Offline
      P Offline
      PJ Arends
      wrote on last edited by
      #2

      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!

      1 Reply Last reply
      0
      • J jerry1211a

        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 :)

        N Offline
        N Offline
        Nilesh K
        wrote on last edited by
        #3

        jerry1211a wrote: how do you distinguish between CSlider controls Check with GetDlgCtrlID.

        - Nilesh "Reading made Don Quixote a gentleman. Believing what he read made him mad" -George Bernard Shaw

        1 Reply Last reply
        0
        • J jerry1211a

          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 :)

          D Offline
          D Offline
          David Crow
          wrote on last edited by
          #4

          What does the dialog's DoDataExchange() method look like? Put a breakpoint on the SetRange() 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

          J 1 Reply Last reply
          0
          • D David Crow

            What does the dialog's DoDataExchange() method look like? Put a breakpoint on the SetRange() 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

            J Offline
            J Offline
            jerry1211a
            wrote on last edited by
            #5

            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

            D 1 Reply Last reply
            0
            • J jerry1211a

              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

              D Offline
              D Offline
              David Crow
              wrote on last edited by
              #6

              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

              J 1 Reply Last reply
              0
              • D David Crow

                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

                J Offline
                J Offline
                jerry1211a
                wrote on last edited by
                #7

                Thanks...have a good weekend.

                1 Reply Last reply
                0
                Reply
                • Reply as topic
                Log in to reply
                • Oldest to Newest
                • Newest to Oldest
                • Most Votes


                • Login

                • Don't have an account? Register

                • Login or register to search.
                • First post
                  Last post
                0
                • Categories
                • Recent
                • Tags
                • Popular
                • World
                • Users
                • Groups