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. SHGetFolderLocation() function gives compile time error.

SHGetFolderLocation() function gives compile time error.

Scheduled Pinned Locked Moved C / C++ / MFC
helpquestionannouncement
13 Posts 5 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 Sameer_Thakur

    Hi all. In my application I am calling a SHGetFolderLocation() function to load a browse Folder dialog. I have included Shlobj.h and also I have added shell32.lib file in Project->Settings->Lib tab. The version of shell32.dll is 6.0.2900.2180. But when I tried to compile a program, it gives me a compile time error " error C2065: 'SHGetFolderLocation' : undeclared identifier " Can anybody help? Thanks

    Rakesh Thakur

    H Offline
    H Offline
    Hamid Taebi
    wrote on last edited by
    #2

    Try to#define _WIN32_IE 0x0500


    WhiteSky


    S 1 Reply Last reply
    0
    • S Sameer_Thakur

      Hi all. In my application I am calling a SHGetFolderLocation() function to load a browse Folder dialog. I have included Shlobj.h and also I have added shell32.lib file in Project->Settings->Lib tab. The version of shell32.dll is 6.0.2900.2180. But when I tried to compile a program, it gives me a compile time error " error C2065: 'SHGetFolderLocation' : undeclared identifier " Can anybody help? Thanks

      Rakesh Thakur

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

      http://www.codeproject.com/cpp/cppforumfaq.asp#cl_apis[^]


      You may be right
      I may be crazy
      -- Billy Joel --

      Within you lies the power for good, use it!!!

      1 Reply Last reply
      0
      • H Hamid Taebi

        Try to#define _WIN32_IE 0x0500


        WhiteSky


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

        Thanks for reply. I tried adding #define _WIN32_IE 0x0500 but didn't worked-out. Thanks

        Rakesh Thakur

        H 1 Reply Last reply
        0
        • S Sameer_Thakur

          Thanks for reply. I tried adding #define _WIN32_IE 0x0500 but didn't worked-out. Thanks

          Rakesh Thakur

          H Offline
          H Offline
          Hamid Taebi
          wrote on last edited by
          #5

          Where did you declare


          WhiteSky


          S 1 Reply Last reply
          0
          • H Hamid Taebi

            Where did you declare


            WhiteSky


            S Offline
            S Offline
            Sameer_Thakur
            wrote on last edited by
            #6

            In the same file in which I am calling that function.

            Rakesh Thakur

            H 1 Reply Last reply
            0
            • S Sameer_Thakur

              In the same file in which I am calling that function.

              Rakesh Thakur

              H Offline
              H Offline
              Hamid Taebi
              wrote on last edited by
              #7

              Do you insert it to stdafx.h


              WhiteSky


              S 1 Reply Last reply
              0
              • H Hamid Taebi

                Do you insert it to stdafx.h


                WhiteSky


                S Offline
                S Offline
                Sameer_Thakur
                wrote on last edited by
                #8

                Yes I have #include "stdafx.h" #include "shlobj.h" #define _WIN32_IE 0x0500

                Rakesh Thakur

                H D S 3 Replies Last reply
                0
                • S Sameer_Thakur

                  Yes I have #include "stdafx.h" #include "shlobj.h" #define _WIN32_IE 0x0500

                  Rakesh Thakur

                  H Offline
                  H Offline
                  Hamid Taebi
                  wrote on last edited by
                  #9

                  If you insert this line on StdAfx.h I think it must solve:)


                  WhiteSky


                  1 Reply Last reply
                  0
                  • S Sameer_Thakur

                    Yes I have #include "stdafx.h" #include "shlobj.h" #define _WIN32_IE 0x0500

                    Rakesh Thakur

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

                    Rakesh_Thakur wrote:

                    #define _WIN32_IE 0x0500

                    You must define it before anything else.


                    "Approved Workmen Are Not Ashamed" - 2 Timothy 2:15

                    "Judge not by the eye but by the heart." - Native American Proverb

                    S 1 Reply Last reply
                    0
                    • D David Crow

                      Rakesh_Thakur wrote:

                      #define _WIN32_IE 0x0500

                      You must define it before anything else.


                      "Approved Workmen Are Not Ashamed" - 2 Timothy 2:15

                      "Judge not by the eye but by the heart." - Native American Proverb

                      S Offline
                      S Offline
                      Scott Holt
                      wrote on last edited by
                      #11

                      Try it like this: #define _WIN32_IE 0x0500 #include "stdafx.h" #include "shlobj.h" If you want, you can put _WIN32_IE=0x500 into the PreProcessor Definitions on the Project Properties page Scott

                      D 1 Reply Last reply
                      0
                      • S Scott Holt

                        Try it like this: #define _WIN32_IE 0x0500 #include "stdafx.h" #include "shlobj.h" If you want, you can put _WIN32_IE=0x500 into the PreProcessor Definitions on the Project Properties page Scott

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

                        Perhaps you meant to respond to Rakesh.


                        "Approved Workmen Are Not Ashamed" - 2 Timothy 2:15

                        "Judge not by the eye but by the heart." - Native American Proverb

                        1 Reply Last reply
                        0
                        • S Sameer_Thakur

                          Yes I have #include "stdafx.h" #include "shlobj.h" #define _WIN32_IE 0x0500

                          Rakesh Thakur

                          S Offline
                          S Offline
                          Scott Holt
                          wrote on last edited by
                          #13

                          Try it like this: #define _WIN32_IE 0x0500 #include "stdafx.h" #include "shlobj.h" If you want, you can put _WIN32_IE=0x500 into the PreProcessor Definitions on the Project Properties page Scott

                          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