[ros-diffs] [dreimer] 29549: Fix a FixMe (FIXME : Fails with IShellFolder interface) (Pierre Schweitzer)

dreimer at svn.reactos.org dreimer at svn.reactos.org
Sat Oct 13 13:10:20 CEST 2007


Author: dreimer
Date: Sat Oct 13 15:10:19 2007
New Revision: 29549

URL: http://svn.reactos.org/svn/reactos?rev=29549&view=rev
Log:
Fix a FixMe (FIXME : Fails with IShellFolder interface) (Pierre Schweitzer)

Modified:
    trunk/tools/RosBE-Windows/Tools/config/options.c
    trunk/tools/RosBE-Windows/Tools/config/todo.txt

Modified: trunk/tools/RosBE-Windows/Tools/config/options.c
URL: http://svn.reactos.org/svn/reactos/trunk/tools/RosBE-Windows/Tools/config/options.c?rev=29549&r1=29548&r2=29549&view=diff
==============================================================================
--- trunk/tools/RosBE-Windows/Tools/config/options.c (original)
+++ trunk/tools/RosBE-Windows/Tools/config/options.c Sat Oct 13 15:10:19 2007
@@ -26,6 +26,8 @@
 #include "resources.h"
 
 #define MINGWVERSION L"\\4.1.3"
+
+typedef LPITEMIDLIST __stdcall (CALLBACK* ILCREATEFROMPATHW)(LPCWSTR path);
 
 // note: do not change the order - theses are the color under winxp they might differ in another OSes
 WCHAR *Colors[] = { L"black", L"dark blue", L"green", L"turquoise", L"dark red", L"purple",
@@ -166,17 +168,20 @@
             {
                 WCHAR MGWPath[MAX_PATH];
                 BROWSEINFO PathInfo;
+                HINSTANCE hDLL;
+                ILCREATEFROMPATHW ILCreateFromPathW;
                 ZeroMemory(&PathInfo, sizeof(BROWSEINFO));
-/* FIXME : Fails with IShellFolder interface */
-#if 0
-                LPSHELLFOLDER psf = NULL;
-                HRESULT hr;
-                hr = SHGetDesktopFolder(&psf);
-                LPITEMIDLIST pidlRoot;
-                hr = psf->ParseDisplayName(NULL, NULL, defaultmingwpath, NULL, &pidlRoot, NULL);
-                psf->Release();
-                PathInfo.pidlRoot = pidlRoot;
-#endif
+                hDLL = LoadLibrary(L"shell32.dll");
+                if (hDLL)
+                {
+                    ILCreateFromPathW = (ILCREATEFROMPATHW)GetProcAddress(hDLL, "ILCreateFromPathW");
+                    if (ILCreateFromPathW)
+                    {
+                        GetDlgItemText(Dlg, ID_MGWDIR, MGWPath, MAX_PATH);
+                        PathInfo.pidlRoot = ILCreateFromPathW(MGWPath);
+                    }
+                    FreeLibrary(hDLL);
+                }
                 PathInfo.hwndOwner = Dlg;
                 PathInfo.lpszTitle = L"Please choose the directory where MingW is located:";
                 LPITEMIDLIST pidl = SHBrowseForFolder(&PathInfo);

Modified: trunk/tools/RosBE-Windows/Tools/config/todo.txt
URL: http://svn.reactos.org/svn/reactos/trunk/tools/RosBE-Windows/Tools/config/todo.txt?rev=29549&r1=29548&r2=29549&view=diff
==============================================================================
--- trunk/tools/RosBE-Windows/Tools/config/todo.txt (original)
+++ trunk/tools/RosBE-Windows/Tools/config/todo.txt Sat Oct 13 15:10:19 2007
@@ -2,4 +2,3 @@
 - Load old settings
 - Improve Save button status (disabled if no changes, even if user played with param)
 - Font preview
-- Fix FIXME




More information about the Ros-diffs mailing list