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. incrementing via timer and loading value to text box

incrementing via timer and loading value to text box

Scheduled Pinned Locked Moved C / C++ / MFC
csharpc++dotnetgraphicshelp
8 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
    Jeffrey Webster
    wrote on last edited by
    #1

    Hi, To pry my way into C++ graphics programming I'm trying to start simple. I'm just trying to get a textbox to increment every time a timer event (tick) occurs. In a nutshell, I'm calling a function which increments a 'public' (form-wide) variable and then trying to read that value into a textbox. The problem I'm having is that the type is mismatched and I can't seem to get the textbox to accept the value. The .NET Framework Class Library says you can use this class: public __gc __sealed class Convert however, despite their examples which show the use of one argument, it claims that it wants something other than 1 argument (says "does not contain 1 argument"). Not sure how to use this, if indeed that is what I should be using. Any suggestions would be appreciated. Thanks, Jeff

    _ T 2 Replies Last reply
    0
    • J Jeffrey Webster

      Hi, To pry my way into C++ graphics programming I'm trying to start simple. I'm just trying to get a textbox to increment every time a timer event (tick) occurs. In a nutshell, I'm calling a function which increments a 'public' (form-wide) variable and then trying to read that value into a textbox. The problem I'm having is that the type is mismatched and I can't seem to get the textbox to accept the value. The .NET Framework Class Library says you can use this class: public __gc __sealed class Convert however, despite their examples which show the use of one argument, it claims that it wants something other than 1 argument (says "does not contain 1 argument"). Not sure how to use this, if indeed that is what I should be using. Any suggestions would be appreciated. Thanks, Jeff

      _ Offline
      _ Offline
      _AnsHUMAN_
      wrote on last edited by
      #2

      Can you show your code? From the description you provide it appears that there is a mismatch in the parameters you use for the function call.

      You need to google first, if you have "It's urgent please" mentioned in your question. ;-)_AnShUmAn_

      1 Reply Last reply
      0
      • J Jeffrey Webster

        Hi, To pry my way into C++ graphics programming I'm trying to start simple. I'm just trying to get a textbox to increment every time a timer event (tick) occurs. In a nutshell, I'm calling a function which increments a 'public' (form-wide) variable and then trying to read that value into a textbox. The problem I'm having is that the type is mismatched and I can't seem to get the textbox to accept the value. The .NET Framework Class Library says you can use this class: public __gc __sealed class Convert however, despite their examples which show the use of one argument, it claims that it wants something other than 1 argument (says "does not contain 1 argument"). Not sure how to use this, if indeed that is what I should be using. Any suggestions would be appreciated. Thanks, Jeff

        T Offline
        T Offline
        ThatsAlok
        wrote on last edited by
        #3

        it would be better if you post your Managed C++ question in it's relevent column http://www.codeproject.com/script/Forums/View.aspx?fid=3785[^]

        "Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
        Never mind - my own stupidity is the source of every "problem" - Mixture

        cheers, Alok Gupta VC Forum Q&A :- I/IV Support CRY- Child Relief and You

        J 1 Reply Last reply
        0
        • T ThatsAlok

          it would be better if you post your Managed C++ question in it's relevent column http://www.codeproject.com/script/Forums/View.aspx?fid=3785[^]

          "Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
          Never mind - my own stupidity is the source of every "problem" - Mixture

          cheers, Alok Gupta VC Forum Q&A :- I/IV Support CRY- Child Relief and You

          J Offline
          J Offline
          Jeffrey Webster
          wrote on last edited by
          #4

          Hi, Okay this is the simplest expression:

          private: System::Void timer1_Tick(System::Object * sender, System::EventArgs * e)
          {
          timerVal++;
          textBox1->Text = timerVal;
          }

          This didn't work. I tried using the aforementioned class pretty much as shown in the example, and that gave me the message about an incorrect number of arguments. This is surprisingly hard to find information on. ___ Alok: I noticed that other code category which might be more relevant. I felt the questions there seemed more advanced. I'm not averse to someone moving it if they think this is improperly placed. Thanks, Jeff

          T S 2 Replies Last reply
          0
          • J Jeffrey Webster

            Hi, Okay this is the simplest expression:

            private: System::Void timer1_Tick(System::Object * sender, System::EventArgs * e)
            {
            timerVal++;
            textBox1->Text = timerVal;
            }

            This didn't work. I tried using the aforementioned class pretty much as shown in the example, and that gave me the message about an incorrect number of arguments. This is surprisingly hard to find information on. ___ Alok: I noticed that other code category which might be more relevant. I felt the questions there seemed more advanced. I'm not averse to someone moving it if they think this is improperly placed. Thanks, Jeff

            T Offline
            T Offline
            ThatsAlok
            wrote on last edited by
            #5

            Jeffrey Webster wrote:

            Alok: I noticed that other code category which might be more relevant. I felt the questions there seemed more advanced. I'm not averse to someone moving it if they think this is improperly placed.

            No offence, actually this forum is dedicated to unmanaged vc++, very few people gradute to managed vc++ from unmanaged vc++. So, chances of finding a managed vc++ guy on unmanaged vc++ forum is less compared to managed vc++ forum.So just to help you, I mentioned it would be better if you post your query in appropiate forum. Regarding moving your post, i don't haev authority to do so.. might be some from CP Staff can do it

            "Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
            Never mind - my own stupidity is the source of every "problem" - Mixture

            cheers, Alok Gupta VC Forum Q&A :- I/IV Support CRY- Child Relief and You

            J 1 Reply Last reply
            0
            • J Jeffrey Webster

              Hi, Okay this is the simplest expression:

              private: System::Void timer1_Tick(System::Object * sender, System::EventArgs * e)
              {
              timerVal++;
              textBox1->Text = timerVal;
              }

              This didn't work. I tried using the aforementioned class pretty much as shown in the example, and that gave me the message about an incorrect number of arguments. This is surprisingly hard to find information on. ___ Alok: I noticed that other code category which might be more relevant. I felt the questions there seemed more advanced. I'm not averse to someone moving it if they think this is improperly placed. Thanks, Jeff

              S Offline
              S Offline
              Stuart Dootson
              wrote on last edited by
              #6

              You could try

              textBox1->Text = timerVal.ToString();

              Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p

              J 1 Reply Last reply
              0
              • S Stuart Dootson

                You could try

                textBox1->Text = timerVal.ToString();

                Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p

                J Offline
                J Offline
                Jeffrey Webster
                wrote on last edited by
                #7

                Hi, Thanks, that worked. Jeff

                1 Reply Last reply
                0
                • T ThatsAlok

                  Jeffrey Webster wrote:

                  Alok: I noticed that other code category which might be more relevant. I felt the questions there seemed more advanced. I'm not averse to someone moving it if they think this is improperly placed.

                  No offence, actually this forum is dedicated to unmanaged vc++, very few people gradute to managed vc++ from unmanaged vc++. So, chances of finding a managed vc++ guy on unmanaged vc++ forum is less compared to managed vc++ forum.So just to help you, I mentioned it would be better if you post your query in appropiate forum. Regarding moving your post, i don't haev authority to do so.. might be some from CP Staff can do it

                  "Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
                  Never mind - my own stupidity is the source of every "problem" - Mixture

                  cheers, Alok Gupta VC Forum Q&A :- I/IV Support CRY- Child Relief and You

                  J Offline
                  J Offline
                  Jeffrey Webster
                  wrote on last edited by
                  #8

                  Hi Alok, I did actually post another question on the Managed C++ board. I'll use this board only if it's specifically a C++ question. Thanks, Jeff

                  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