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. passing parameters to Cdialog

passing parameters to Cdialog

Scheduled Pinned Locked Moved C / C++ / MFC
11 Posts 6 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.
  • F Offline
    F Offline
    ForNow
    wrote on last edited by
    #1

    Hi I know the CDialog constructer takes two parameters an id template and Parent Cwnd if my derived CDialog wanted to pass a parameter woud be the first or last in my case I passed it as the first and got a warning

    RTMDialog::RTMDialog(LPARAM mylparam, CWnd* pParent /*=NULL*/)
    : CDialog(IDD_DIALOG9, pParent)

    the extra param is mylparam

    S L 2 Replies Last reply
    0
    • F ForNow

      Hi I know the CDialog constructer takes two parameters an id template and Parent Cwnd if my derived CDialog wanted to pass a parameter woud be the first or last in my case I passed it as the first and got a warning

      RTMDialog::RTMDialog(LPARAM mylparam, CWnd* pParent /*=NULL*/)
      : CDialog(IDD_DIALOG9, pParent)

      the extra param is mylparam

      S Offline
      S Offline
      Sascha Lefevre
      wrote on last edited by
      #2

      What kind of warning?

      If the brain were so simple we could understand it, we would be so simple we couldn't. — Lyall Watson

      F 1 Reply Last reply
      0
      • F ForNow

        Hi I know the CDialog constructer takes two parameters an id template and Parent Cwnd if my derived CDialog wanted to pass a parameter woud be the first or last in my case I passed it as the first and got a warning

        RTMDialog::RTMDialog(LPARAM mylparam, CWnd* pParent /*=NULL*/)
        : CDialog(IDD_DIALOG9, pParent)

        the extra param is mylparam

        L Offline
        L Offline
        Lost User
        wrote on last edited by
        #3

        What is the definition of your RTMDialog constructor?

        1 Reply Last reply
        0
        • S Sascha Lefevre

          What kind of warning?

          If the brain were so simple we could understand it, we would be so simple we couldn't. — Lyall Watson

          F Offline
          F Offline
          ForNow
          wrote on last edited by
          #4

          progDebug.cpp(356): warning C4930: 'RTMDialog Abenddialog(LPARAM,CWnd *)': prototyped function not called (was a variable definition intended?)

          Here is the source

          RTMDialog Abenddialog(LPARAM mylparam, CWnd* pParent /*=NULL*/);

          F S R L J 5 Replies Last reply
          0
          • F ForNow

            progDebug.cpp(356): warning C4930: 'RTMDialog Abenddialog(LPARAM,CWnd *)': prototyped function not called (was a variable definition intended?)

            Here is the source

            RTMDialog Abenddialog(LPARAM mylparam, CWnd* pParent /*=NULL*/);

            F Offline
            F Offline
            ForNow
            wrote on last edited by
            #5

            class RTMDialog : public CDialog
            {
            DECLARE_DYNAMIC(RTMDialog)

            public:
            RTMDialog(LPARAM mylparam,CWnd* pParent = NULL); // standard constructor

            D 1 Reply Last reply
            0
            • F ForNow

              progDebug.cpp(356): warning C4930: 'RTMDialog Abenddialog(LPARAM,CWnd *)': prototyped function not called (was a variable definition intended?)

              Here is the source

              RTMDialog Abenddialog(LPARAM mylparam, CWnd* pParent /*=NULL*/);

              S Offline
              S Offline
              Sascha Lefevre
              wrote on last edited by
              #6

              This is a bit of a shot in the dark from me but I think you ran into the Most vexing parse - Wikipedia[^] This line:

              RTMDialog Abenddialog(LPARAM mylparam, CWnd* pParent /*=NULL*/);

              ..has the signature of a function declaration but the name and arguments of your class constructor. I'm a bit confused about where it could be "located" as you've shown your class declaration with a proper constructor declaration and the proper (beginning) of the constructor implementation. Maybe it's just needless?

              If the brain were so simple we could understand it, we would be so simple we couldn't. — Lyall Watson

              1 Reply Last reply
              0
              • F ForNow

                progDebug.cpp(356): warning C4930: 'RTMDialog Abenddialog(LPARAM,CWnd *)': prototyped function not called (was a variable definition intended?)

                Here is the source

                RTMDialog Abenddialog(LPARAM mylparam, CWnd* pParent /*=NULL*/);

                R Offline
                R Offline
                Rick York
                wrote on last edited by
                #7

                If this is truly "source" as in the .cpp file then I think the problem is the semicolon.

                1 Reply Last reply
                0
                • F ForNow

                  progDebug.cpp(356): warning C4930: 'RTMDialog Abenddialog(LPARAM,CWnd *)': prototyped function not called (was a variable definition intended?)

                  Here is the source

                  RTMDialog Abenddialog(LPARAM mylparam, CWnd* pParent /*=NULL*/);

                  L Offline
                  L Offline
                  Lost User
                  wrote on last edited by
                  #8

                  That is a function declaration which takes two parameters and returns an RTMDialog object. Firstly, is that what you wanted, and secondly, what is this to do with your original question? Where exactly in your code is this declaration?

                  1 Reply Last reply
                  0
                  • F ForNow

                    progDebug.cpp(356): warning C4930: 'RTMDialog Abenddialog(LPARAM,CWnd *)': prototyped function not called (was a variable definition intended?)

                    Here is the source

                    RTMDialog Abenddialog(LPARAM mylparam, CWnd* pParent /*=NULL*/);

                    J Offline
                    J Offline
                    Jochen Arndt
                    wrote on last edited by
                    #9

                    Compiler Warning (level 1) C4930[^]:

                    C4930 can also occur when the compiler cannot distinguish between a function prototype declaration and a function call.

                    It looks like that is the case here and you wanted to create a dialog. Then it must be something like

                    RTMDialog Abenddialog(some_lparam, this);

                    1 Reply Last reply
                    0
                    • F ForNow

                      class RTMDialog : public CDialog
                      {
                      DECLARE_DYNAMIC(RTMDialog)

                      public:
                      RTMDialog(LPARAM mylparam,CWnd* pParent = NULL); // standard constructor

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

                      So where's the problem?

                      "One man's wage rise is another man's price increase." - Harold Wilson

                      "Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons

                      "You can easily judge the character of a man by how he treats those who can do nothing for him." - James D. Miles

                      F 1 Reply Last reply
                      0
                      • D David Crow

                        So where's the problem?

                        "One man's wage rise is another man's price increase." - Harold Wilson

                        "Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons

                        "You can easily judge the character of a man by how he treats those who can do nothing for him." - James D. Miles

                        F Offline
                        F Offline
                        ForNow
                        wrote on last edited by
                        #11

                        I had typo with the parameters thanks

                        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