Menu

#57 SHGetSpecialFolderPathW could not be located

open
Other (38)
5
2003-05-22
2003-05-22
Anonymous
No

I get a stop alert box
Title: "matrix.exe - Entry Point Not Found"
Alert: "The procedure entry point
SHGetSpecialFolderPathW could not be located in the
dynamic link library SHELL32.dll"

Program will not launch

OS: NT4 SP6
System: P3 800 with 512MB RAM
contact email: joseph dot lindsay at courts dot govt dot
nz

Discussion

  • Nobody/Anonymous

    Screen dump of alert message

     
  • ~Happy Dude~

    ~Happy Dude~ - 2003-05-23

    Logged In: YES
    user_id=435794

    Hey Joe,

    This problem arises in NT4 and Win95 if you don't have the
    Microsoft 'Desktop Update' installed. See the NT4 question
    at the end of the FAQ for information on this desktop update:

    http://zmatrix.sourceforge.net/help/FAQ.html

     
  • James R. Twine

    James R. Twine - 2003-05-31

    Logged In: YES
    user_id=25727

    This problem is easy to fix (I had the exact problem with one
    of my products). Systems that have updated service packs
    on them (or any recent "real" MS applications like Office and
    likely IE) will have a DLL installed called "SHFolder.dll". This
    DLL contains the SHGetSpecialFolderPath* functions (and
    other SH functions missing from Shell32.dll when Active
    Desktop was not installed). Finding the function is as easy
    as follows (the following code snippet comes from one of my
    products, with the actual calls to the function replaced with
    how they would be used in the matrix.cpp file; you should be
    able to copy and paste it directly):
    -----
    //
    // Typedefs For SHGetSpecialFolderPath (GSFPFP) And
    // SHGetFolderPath (GFPFP)...
    //
    typedef BOOL (STDAPICALLTYPE *GSFPFP)( HWND,
    LPTSTR, int, BOOL );
    typedef HRESULT (STDAPICALLTYPE *GFPFP)( HWND, int,
    HANDLE, DWORD, LPTSTR );

    HMODULE hDLL = ::LoadLibrary( _T( "ShFolder.dll" ) );
    GSFPFP pSHGetSpecialFolderPath = NULL;
    GFPFP pSHGetFolderPath = NULL;

    if( hDLL ) // If ShFolder
    Found
    {
    pSHGetFolderPath = (GFPFP)::GetProcAddress( hDLL,
    _T( "SHGetFolderPathA" ) ); // Get
    Function Address
    if( !pSHGetFolderPath ) // If Failed
    {
    ::FreeLibrary( hDLL ); // Free The
    Library
    hDLL = NULL; // NULL The
    DLL Handle (Try Other DLL Below)
    }
    else // If Found
    {
    if( !pSHGetFolderPath( ghWnd,
    CSIDL_COMMON_STARTUP,
    NULL, SHGFP_TYPE_CURRENT,
    AllUsersStartupDirectoryPath ) )
    {
    // ...
    }
    if( !pSHGetFolderPath( ghWnd, CSIDL_STARTUP,
    NULL,
    SHGFP_TYPE_CURRENT,
    CurrentUserStartupDirectoryPath ) )
    {
    // ...
    }
    if( !pSHGetFolderPath( ghWnd, CSIDL_APPDATA,
    NULL,
    SHGFP_TYPE_CURRENT,
    CurrentUserAppDataDirectoryPath ) )
    {
    // ...
    }
    }
    }
    if( !hDLL ) // If Not Found (Or
    Failed Above)
    {
    hDLL = ::LoadLibrary( _T( "Shell32.dll" ) ); // Try
    Shell32 DLL
    if( !hDLL ) // If Failed (Should
    Not Happen)
    {
    return; // Stop Here
    }
    pSHGetSpecialFolderPath = (GSFPFP)::GetProcAddress(
    hDLL, _T( "SHGetSpecialFolderPathA" ) ); //
    Get Function Address
    if( !pSHGetSpecialFolderPath ) // If Failed
    {
    ::FreeLibrary( hDLL ); // Free The
    Library
    return; // Stop Here
    }
    if( !pSHGetSpecialFolderPath( ghWnd,
    AllUsersStartupDirectoryPath,
    CSIDL_COMMON_STARTUP, FALSE ) )
    {
    // ...
    }
    if( !pSHGetSpecialFolderPath( ghWnd,
    CurrentUserStartupDirectoryPath, CSIDL_STARTUP,
    FALSE ) )
    {
    // ...
    }
    if( !pSHGetSpecialFolderPath( ghWnd,
    CurrentUserAppDataDirectoryPath,
    CSIDL_APPDATA,
    FALSE ) )
    {
    // ...
    }
    }
    ::FreeLibrary( hDLL ); // Free The
    Loaded Library
    -----

    Peace!

    -=- James R. Twine

     

Log in to post a comment.