CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 11 of 11
  1. #1
    Join Date
    Aug 1999
    Posts
    167

    SHGetFolderLocation' : undeclared identifier

    Hi
    I add #include <shlobj.h> in my project.
    And also #define _WIN32_IE 0x500 in the stdafx.h
    before any #include directive.
    But it doesn't work!

    What's wrong? I use Release Win32 configuration.

    Thanks


  2. #2
    Join Date
    May 2000
    Location
    KY, USA
    Posts
    18,652

    Re: SHGetFolderLocation' : undeclared identifier

    Hi,

    Did you compile and link your program with the 'shell32.lib'??

    Ciao, Andreas

    "Software is like sex, it's better when it's free." - Linus Torvalds

  3. #3
    Join Date
    Aug 1999
    Posts
    167

    Re: SHGetFolderLocation' : undeclared identifier

    I really do it but it doesn't work either.
    I use win 2000 professional


  4. #4
    Join Date
    Jul 1999
    Location
    Israel
    Posts
    1,793

    Re: SHGetFolderLocation' : undeclared identifier

    Hi..
    Which os do you use???
    Id suggest you to read note 3 in msdn about this function, it is important.
    (find the help document about thi api and scroll down, click on 5.00 (the shlwapi.dll version i think, then fund note 3]

    Regards
    kishk91


    [email protected]
    ICQ: 13610258

  5. #5
    Join Date
    Aug 1999
    Posts
    167

    Re: SHGetFolderLocation' : undeclared identifier

    I use win2000 pro and IE 5.5; so, I don't think I have
    a problem with dll version.
    They are the lastest.


  6. #6
    Join Date
    May 2000
    Location
    KY, USA
    Posts
    18,652

    Re: SHGetFolderLocation' : undeclared identifier

    Maybe you could try to add those two lines to 'stdafx.h' as well

    #define _WIN32_WINNT 0x0500
    #define WINVER 0x0500




    Ciao, Andreas

    "Software is like sex, it's better when it's free." - Linus Torvalds

  7. #7
    Join Date
    Aug 1999
    Posts
    167

    Re: SHGetFolderLocation' : undeclared identifier

    I'm very sure that I'm using correct version of dll files.
    I use Win2000 pro and IE 5.5.
    comctl32.dll version 5.81.4807.2300
    SHELL32.DLL version 5.0.3103.1000
    shlwapi.dll version 5.50.4807.2300

    In StdAfx.h
    I try to add this "#define _WIN32_IE 0x0500"
    or "#define _WIN32_IE 0x0501" or
    "#define _WIN32_WINNT 0x0500
    #define WINVER 0x0500"

    But, all of settings seem not to work at all.

    And, I include shlobj.h and link with all related dlls.
    Moreover, one other thing I doubt is why I cannot
    compile successfully when I use

    bif.ulFlags=(BIF_BROWSEFORPRINTER | BIF_SHAREABLE);

    It is told that BIF_SHAREABLE' : undeclared identifier

    Can anyone solve this?


  8. #8
    Join Date
    May 2000
    Location
    KY, USA
    Posts
    18,652

    Re: SHGetFolderLocation' : undeclared identifier

    Well, the only guess I have left would be that you don't have the latest version of at least the header file. I assume that's why you don't have a definition for 'BIF_SHAREABLE'...

    Ciao, Andreas

    "Software is like sex, it's better when it's free." - Linus Torvalds

  9. #9
    Join Date
    Aug 1999
    Posts
    167

    Re: SHGetFolderLocation' : undeclared identifier

    Where can I get it?
    I wonder if VC 6.0 also contains old version.


  10. #10
    Join Date
    May 2000
    Location
    KY, USA
    Posts
    18,652

    Re: SHGetFolderLocation' : undeclared identifier

    Well, I don't know for sure since I didn't do much with the shell API yet. But I'm assuming it will be downloadable at http://msdn.microsoft.com. Visual C++ 6.0 is nearly two years old (I guess) so there is of couse some old stuff in it. Even with the latest service pack you will still have some outdated files...

    Ciao, Andreas

    "Software is like sex, it's better when it's free." - Linus Torvalds

  11. #11
    Join Date
    Dec 2001
    Posts
    4

    Re: SHGetFolderLocation' : undeclared identifier

    FYI, I am also having SHGetFolderPath come up as an 'undeclared identifier'. I am running VC++ v6.0sp5 on W2Ksp1 with IEv5sp2. So, there really shouldn't be a problem, however this function does not even appear in the SHLOBJ.H file.

    Any help would be welcome.
    David

    David_Carr@NoSpam_Canada.Com


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured