No need for ATL
git-svn-id: https://svn.code.sf.net/p/nsis/code/NSIS/trunk@2738 212acab6-be3b-0410-9dea-997c60f758d6
This commit is contained in:
parent
e971cc9b40
commit
21d0160dba
1 changed files with 5 additions and 8 deletions
|
@ -9,8 +9,6 @@
|
|||
#include <windows.h>
|
||||
#include <windowsx.h>
|
||||
#include <shlobj.h>
|
||||
#include <atlbase.h>
|
||||
#include <stdio.h>
|
||||
#include <commdlg.h>
|
||||
#include <cderr.h>
|
||||
#include "resource.h"
|
||||
|
@ -269,15 +267,14 @@ bool BrowseForFolder(int nControlIdx) {
|
|||
LPSHELLFOLDER sf;
|
||||
ULONG eaten;
|
||||
LPITEMIDLIST root;
|
||||
#define _alloca MALLOC
|
||||
USES_CONVERSION;
|
||||
LPOLESTR s = A2OLE(pFields[nControlIdx].pszRoot);
|
||||
#undef _alloca
|
||||
int ccRoot = (lstrlen(pFields[nControlIdx].pszRoot) * 2) + 2;
|
||||
LPWSTR pwszRoot = (LPWSTR) MALLOC(ccRoot);
|
||||
MultiByteToWideChar(CP_ACP, 0, pFields[nControlIdx].pszRoot, -1, pwszRoot, ccRoot);
|
||||
SHGetDesktopFolder(&sf);
|
||||
sf->ParseDisplayName(hConfigWindow, NULL, (unsigned short *)s, &eaten, &root, NULL);
|
||||
sf->ParseDisplayName(hConfigWindow, NULL, pwszRoot, &eaten, &root, NULL);
|
||||
bi.pidlRoot = root;
|
||||
sf->Release();
|
||||
FREE(s);
|
||||
FREE(pwszRoot);
|
||||
}
|
||||
// CoInitializeEx(NULL, COINIT_APARTMENTTHREADED);
|
||||
LPITEMIDLIST pResult = SHBrowseForFolder(&bi);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue