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. c2120 error

c2120 error

Scheduled Pinned Locked Moved C / C++ / MFC
help
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.
  • S Offline
    S Offline
    subramanyeswari
    wrote on last edited by
    #1

    Hi, We are making changes in our application. Instead of writing in ini we writing in a local file. So we wrote a wrapper for GetProfileInt and GetProfileString. But this piece of code is giving error.

    bAllowDeleteSystemVars =
    WWGetProfileInt("test",
    "test123"/* "AllowDeleteSystemVars" */
    NULL);

    where bAllowDeleteSystemVars is a BOOL variable. I am getting the following error error C2120: 'void' illegal with all types Regards

    N D D 3 Replies Last reply
    0
    • S subramanyeswari

      Hi, We are making changes in our application. Instead of writing in ini we writing in a local file. So we wrote a wrapper for GetProfileInt and GetProfileString. But this piece of code is giving error.

      bAllowDeleteSystemVars =
      WWGetProfileInt("test",
      "test123"/* "AllowDeleteSystemVars" */
      NULL);

      where bAllowDeleteSystemVars is a BOOL variable. I am getting the following error error C2120: 'void' illegal with all types Regards

      N Offline
      N Offline
      Naveen
      wrote on last edited by
      #2

      subramanyeswari wrote:

      error C2120: 'void' illegal with all types

      Does WWGetProfileInt() returns a value???

      nave [OpenedFileFinder]

      S 1 Reply Last reply
      0
      • S subramanyeswari

        Hi, We are making changes in our application. Instead of writing in ini we writing in a local file. So we wrote a wrapper for GetProfileInt and GetProfileString. But this piece of code is giving error.

        bAllowDeleteSystemVars =
        WWGetProfileInt("test",
        "test123"/* "AllowDeleteSystemVars" */
        NULL);

        where bAllowDeleteSystemVars is a BOOL variable. I am getting the following error error C2120: 'void' illegal with all types Regards

        D Offline
        D Offline
        Dan 0
        wrote on last edited by
        #3

        Because you are missing a comma after "test123"?

        S 1 Reply Last reply
        0
        • N Naveen

          subramanyeswari wrote:

          error C2120: 'void' illegal with all types

          Does WWGetProfileInt() returns a value???

          nave [OpenedFileFinder]

          S Offline
          S Offline
          subramanyeswari
          wrote on last edited by
          #4

          yes, the prototype is this UINT wwGetProfileInt(LPCTSTR lpAppName, LPCTSTR lpKeyName, INT nDefault)

          D 1 Reply Last reply
          0
          • D Dan 0

            Because you are missing a comma after "test123"?

            S Offline
            S Offline
            subramanyeswari
            wrote on last edited by
            #5

            it's a typo. comma is there

            1 Reply Last reply
            0
            • S subramanyeswari

              yes, the prototype is this UINT wwGetProfileInt(LPCTSTR lpAppName, LPCTSTR lpKeyName, INT nDefault)

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

              Yet your previous code showed WWGetProfileInt(). Which is it?

              "Love people and use things, not love things and use people." - Unknown

              "To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne

              1 Reply Last reply
              0
              • S subramanyeswari

                Hi, We are making changes in our application. Instead of writing in ini we writing in a local file. So we wrote a wrapper for GetProfileInt and GetProfileString. But this piece of code is giving error.

                bAllowDeleteSystemVars =
                WWGetProfileInt("test",
                "test123"/* "AllowDeleteSystemVars" */
                NULL);

                where bAllowDeleteSystemVars is a BOOL variable. I am getting the following error error C2120: 'void' illegal with all types Regards

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

                If you remove the bAllowDeleteSystemVars =, does the error persist?

                "Love people and use things, not love things and use people." - Unknown

                "To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne

                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