shfolder.dll - File Not Found

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Jerry West

    shfolder.dll - File Not Found

    I installed VB6 onto a Vista system to check some legacy code. When I run my
    project, the code where shell folders are determined, I get the following
    error when using the API:SHGetFolder Path

    Error #48: File Not Found

    I checked and shfolder is definitely in the sytem32 folder. But of course,
    the legacy code is expecting the pre-Vista version of shfolder.dll. Has
    there been so much change in this file that it would return a file not found
    message. Anybody have any background info on this issue they can share?

    Much appreciated!!

    JR

  • Ralph

    #2
    Re: shfolder.dll - File Not Found


    "Jerry West" <jw@comcast.net wrote in message
    news:FvGdndlvPe hhLZbUnZ2dnUVZ_ gKdnZ2d@giganew s.com...
    I installed VB6 onto a Vista system to check some legacy code. When I run
    my
    project, the code where shell folders are determined, I get the following
    error when using the API:SHGetFolder Path
    >
    Error #48: File Not Found
    >
    I checked and shfolder is definitely in the sytem32 folder. But of course,
    the legacy code is expecting the pre-Vista version of shfolder.dll. Has
    there been so much change in this file that it would return a file not
    found
    message. Anybody have any background info on this issue they can share?
    >
    Not enough information.

    The 'file' hasn't changed but due to UAC, compatiblity, and to some degree
    64-bit/wow issues, permissions and 'views' have certainly changed. ie, what
    may 'exist' in some situations, may not 'exist' in another.

    You might check out the new group -
    "microsoft.publ ic.vb.vista.com patibility".

    -ralph


    Comment

    • Jack

      #3
      Re: shfolder.dll - File Not Found

      In addition to Ralph reply, try to run it with the administrative
      privileges.
      Jack

      "Jerry West" <jw@comcast.net wrote in message
      news:FvGdndlvPe hhLZbUnZ2dnUVZ_ gKdnZ2d@giganew s.com...
      >I installed VB6 onto a Vista system to check some legacy code. When I run
      >my project, the code where shell folders are determined, I get the
      >following error when using the API:SHGetFolder Path
      >
      Error #48: File Not Found
      >
      I checked and shfolder is definitely in the sytem32 folder. But of course,
      the legacy code is expecting the pre-Vista version of shfolder.dll. Has
      there been so much change in this file that it would return a file not
      found message. Anybody have any background info on this issue they can
      share?
      >
      Much appreciated!!
      >
      JR

      Comment

      • Jerry West

        #4
        Re: shfolder.dll - File Not Found

        Well, I certainly should have mentioned that not only am I running the
        legacy code within the VB6 environment but the platform is a x64 bit system.
        The legacy code was compiled on a 32bit system.

        I am running the IDE in "Start as admin" mode.

        I'm not convinced the error is the result of the 32-bit versus 64-bit
        difference. Am I completely off track here? Any further suggestions?

        JW

        "Jack" <replyto@itwrot e in message
        news:%23dEzRl8O JHA.144@TK2MSFT NGP03.phx.gbl.. .
        In addition to Ralph reply, try to run it with the administrative
        privileges.
        Jack
        >
        "Jerry West" <jw@comcast.net wrote in message
        news:FvGdndlvPe hhLZbUnZ2dnUVZ_ gKdnZ2d@giganew s.com...
        >>I installed VB6 onto a Vista system to check some legacy code. When I run
        >>my project, the code where shell folders are determined, I get the
        >>following error when using the API:SHGetFolder Path
        >>
        >Error #48: File Not Found
        >>
        >I checked and shfolder is definitely in the sytem32 folder. But of
        >course, the legacy code is expecting the pre-Vista version of
        >shfolder.dll . Has there been so much change in this file that it would
        >return a file not found message. Anybody have any background info on this
        >issue they can share?
        >>
        >Much appreciated!!
        >>
        >JR
        >
        >

        Comment

        • Family Tree Mike

          #5
          Re: shfolder.dll - File Not Found

          Have you looked at
          http://msdn.microsoft.com/en-us/libr...81(VS.85).aspx, and understand
          what it says about the version on Vista?

          Also, it seems you think the error is indicating it cannot find the dll
          itself. It seems to me the message means that it cannot find whatever the
          folder id you are passing into the function.


          "Jerry West" <jw@comcast.net wrote in message
          news:0LGdnWT_Us YobpbUnZ2dnUVZ_ tTinZ2d@giganew s.com...
          Well, I certainly should have mentioned that not only am I running the
          legacy code within the VB6 environment but the platform is a x64 bit
          system. The legacy code was compiled on a 32bit system.
          >
          I am running the IDE in "Start as admin" mode.
          >
          I'm not convinced the error is the result of the 32-bit versus 64-bit
          difference. Am I completely off track here? Any further suggestions?
          >
          JW
          >
          "Jack" <replyto@itwrot e in message
          news:%23dEzRl8O JHA.144@TK2MSFT NGP03.phx.gbl.. .
          >In addition to Ralph reply, try to run it with the administrative
          >privileges.
          >Jack
          >>
          >"Jerry West" <jw@comcast.net wrote in message
          >news:FvGdndlvP ehhLZbUnZ2dnUVZ _gKdnZ2d@gigane ws.com...
          >>>I installed VB6 onto a Vista system to check some legacy code. When I run
          >>>my project, the code where shell folders are determined, I get the
          >>>following error when using the API:SHGetFolder Path
          >>>
          >>Error #48: File Not Found
          >>>
          >>I checked and shfolder is definitely in the sytem32 folder. But of
          >>course, the legacy code is expecting the pre-Vista version of
          >>shfolder.dl l. Has there been so much change in this file that it would
          >>return a file not found message. Anybody have any background info on
          >>this issue they can share?
          >>>
          >>Much appreciated!!
          >>>
          >>JR
          >>
          >>
          >

          Comment

          • Thorsten Albers

            #6
            Re: shfolder.dll - File Not Found

            Jerry West <jw@comcast.net schrieb im Beitrag
            <FvGdndlvPehhLZ bUnZ2dnUVZ_gKdn Z2d@giganews.co m>...
            I installed VB6 onto a Vista system to check some legacy code. When I run
            my
            project, the code where shell folders are determined, I get the following
            error when using the API:SHGetFolder Path
            The shfolder.dll has been designed primarily for Windows 9x and NT <= 4
            with IE <= 4. You shouldn't use this on newer versions of Windows. Use the
            following shell procedures instead:
            SHGetSpecialFol derLocation()
            SHGetSpecialFol derPath()

            --
            ----------------------------------------------------------------------
            Thorsten Albers albers(a)uni-freiburg.de
            ----------------------------------------------------------------------

            Comment

            • expvb

              #7
              Re: shfolder.dll - File Not Found

              "Jerry West" <jw@comcast.net wrote in message
              news:FvGdndlvPe hhLZbUnZ2dnUVZ_ gKdnZ2d@giganew s.com...
              Error #48: File Not Found
              VB6 throws that error when there is something wrong with the declaration or
              the way the function was called, and doesn't necessarily mean that the file
              was not found.

              Please post the function declaration and how it's called.


              Comment

              • Jerry West

                #8
                Re: shfolder.dll - File Not Found

                It seems what I am doing should be supported based on the MSDN article
                indicated by a previous post on this thread. The call I make looks like
                this:

                'Declare Function SHGetFolderPath Lib "shfolder.d ll" Alias
                "SHGetFolderPat hA" (ByVal hwndOwner As Long, 'ByVal nFolder As Long, ByVal
                hToken As Long, ByVal dwReserved As Long, ByVal lpszPath As String) As 'Long

                ' sFolderPath$ = Space(MAX_PATH)
                ' alFolders&(iIdx %) = 48
                ' SHGFP_TYPE_CURR ENT = 0

                lRet& = SHGetFolderPath (frmMain.hWnd, alFolders&(iIdx %), 0&,
                SHGFP_TYPE_CURR ENT, sFolderPath$)

                Like I said, works fine pre-Vista.

                JW

                "expvb" <nobody@cox.net wrote in message
                news:%23vd0HLEP JHA.4496@TK2MSF TNGP04.phx.gbl. ..
                "Jerry West" <jw@comcast.net wrote in message
                news:FvGdndlvPe hhLZbUnZ2dnUVZ_ gKdnZ2d@giganew s.com...
                >Error #48: File Not Found
                >
                VB6 throws that error when there is something wrong with the declaration
                or the way the function was called, and doesn't necessarily mean that the
                file was not found.
                >
                Please post the function declaration and how it's called.
                >
                >

                Comment

                • Family Tree Mike

                  #9
                  Re: shfolder.dll - File Not Found

                  I don't have vb 6, but the code runs on vist from .net 2008. With a
                  non-admin user, I get a path that is not a valid path.
                  The folder returned does exist for an admin user.

                  "Jerry West" <jw@comcast.net wrote in message
                  news:ANadnRk8Uq Q2X5HUnZ2dnUVZ_ hSdnZ2d@giganew s.com...
                  It seems what I am doing should be supported based on the MSDN article
                  indicated by a previous post on this thread. The call I make looks like
                  this:
                  >
                  'Declare Function SHGetFolderPath Lib "shfolder.d ll" Alias
                  "SHGetFolderPat hA" (ByVal hwndOwner As Long, 'ByVal nFolder As Long, ByVal
                  hToken As Long, ByVal dwReserved As Long, ByVal lpszPath As String) As
                  'Long
                  >
                  ' sFolderPath$ = Space(MAX_PATH)
                  ' alFolders&(iIdx %) = 48
                  ' SHGFP_TYPE_CURR ENT = 0
                  >
                  lRet& = SHGetFolderPath (frmMain.hWnd, alFolders&(iIdx %), 0&,
                  SHGFP_TYPE_CURR ENT, sFolderPath$)
                  >
                  Like I said, works fine pre-Vista.
                  >
                  JW
                  >
                  "expvb" <nobody@cox.net wrote in message
                  news:%23vd0HLEP JHA.4496@TK2MSF TNGP04.phx.gbl. ..
                  >"Jerry West" <jw@comcast.net wrote in message
                  >news:FvGdndlvP ehhLZbUnZ2dnUVZ _gKdnZ2d@gigane ws.com...
                  >>Error #48: File Not Found
                  >>
                  >VB6 throws that error when there is something wrong with the declaration
                  >or the way the function was called, and doesn't necessarily mean that the
                  >file was not found.
                  >>
                  >Please post the function declaration and how it's called.
                  >>
                  >>
                  >

                  Comment

                  • Thorsten Albers

                    #10
                    Re: shfolder.dll - File Not Found

                    Jerry West <jw@comcast.net schrieb im Beitrag
                    <ANadnRk8UqQ2X5 HUnZ2dnUVZ_hSdn Z2d@giganews.co m>...
                    lRet& = SHGetFolderPath (frmMain.hWnd, alFolders&(iIdx %), 0&,
                    SHGFP_TYPE_CURR ENT, sFolderPath$)
                    >
                    Like I said, works fine pre-Vista.
                    Presumably the reason for this is what the documentation on
                    SHGetFolderPath () in the MSDN states on the parameter 'nFolder': "Only real
                    folders are valid. If a virtual folder is specified, this function will
                    fail". Under certain conditions on Windows Vista your application somehow
                    works with virtual folder pathes, not with real ones (keyword is 'virtual
                    store').

                    --
                    ----------------------------------------------------------------------
                    Thorsten Albers albers(a)uni-freiburg.de
                    ----------------------------------------------------------------------

                    Comment

                    Working...