Thread: simple doubt with shfolder.lib?
Hi Magnus. I have a doubt to the way of linking to use MS-SDK. It is defined as follows by using <shfolder.h> #ifdef UNICODE #define SHGetFolderPath SHGetFolderPathW #define PFNSHGETFOLDERPATH PFNSHGETFOLDERPATHW #else #define SHGetFolderPath SHGetFolderPathA #define PFNSHGETFOLDERPATH PFNSHGETFOLDERPATHA #endif Therefore, It seems that present patch is necessity. --- src/interfaces/libpq/fe-connect.c.orig Wed Feb 2 03:20:05 2005 +++ src/interfaces/libpq/fe-connect.c Wed Feb 2 03:20:19 2005 @@ -44,6 +44,7 @@ #endif #define near #include <shlobj.h> +#include <shfolder.h> #else #include <sys/socket.h> #include <netdb.h> --- src/port/path.c.orig Wed Feb 2 03:19:19 2005 +++ src/port/path.c Wed Feb 2 03:19:38 2005 @@ -27,6 +27,7 @@ #endif #define near #include <shlobj.h> +#include <shfolder.h> #else #include <unistd.h> #endif Or, my misunderstanding? Any comment? regards, Hiroshi Saito
I have SHGetFolderPath in ShlObj.h, per: SHFOLDERAPI SHGetFolderPathA(HWND hwnd, int csidl, HANDLE hToken, DWORD dwFlags, LPSTR pszPath); SHFOLDERAPI SHGetFolderPathW(HWND hwnd, int csidl, HANDLE hToken, DWORD dwFlags, LPWSTR pszPath); #ifdef UNICODE #define SHGetFolderPath SHGetFolderPathW #else #define SHGetFolderPath SHGetFolderPathA #endif // !UNICODE I ahve it in shfolder.h as well, but only as SHFOLDERAPI SHGetFolderPathA(HWND hwnd, int csidl, HANDLE hToken, DWORD dwFlags, LPSTR pszPath); SHFOLDERAPI SHGetFolderPathW(HWND hwnd, int csidl, HANDLE hToken, DWORD dwFlags, LPWSTR pszPath); And not the #define. What version of the Platform SDK do you have that does not contain the correct definition in ShlObj.h? //Magnus >-----Original Message----- >From: Hiroshi Saito [mailto:saito@inetrt.skcapi.co.jp] >Sent: den 1 februari 2005 19:25 >To: Magnus Hagander >Cc: pgsql-hackers-win32@postgresql.org >Subject: simple doubt with shfolder.lib? > > >Hi Magnus. > >I have a doubt to the way of linking to use MS-SDK. > >It is defined as follows by using <shfolder.h> > >#ifdef UNICODE >#define SHGetFolderPath SHGetFolderPathW >#define PFNSHGETFOLDERPATH PFNSHGETFOLDERPATHW >#else >#define SHGetFolderPath SHGetFolderPathA >#define PFNSHGETFOLDERPATH PFNSHGETFOLDERPATHA >#endif > >Therefore, It seems that present patch is necessity. > >--- src/interfaces/libpq/fe-connect.c.orig Wed Feb 2 >03:20:05 2005 >+++ src/interfaces/libpq/fe-connect.c Wed Feb 2 03:20:19 2005 >@@ -44,6 +44,7 @@ > #endif > #define near > #include <shlobj.h> >+#include <shfolder.h> > #else > #include <sys/socket.h> > #include <netdb.h> >--- src/port/path.c.orig Wed Feb 2 03:19:19 2005 >+++ src/port/path.c Wed Feb 2 03:19:38 2005 >@@ -27,6 +27,7 @@ > #endif > #define near > #include <shlobj.h> >+#include <shfolder.h> > #else > #include <unistd.h> > #endif > >Or, my misunderstanding? >Any comment? > >regards, >Hiroshi Saito >
Hi. Ah, I understood that it was a problem in reference of the order. I am watching Native which MinGW isn't used for with the environment which VC6+ was used for. ShlObj.h of VC6+ doesn't have SHGetFolderPath. It chooses the one which is not here exactly from the plural of my INCLUDE-PATH. This was a little complicated.:-( Thank you. A mystery was solved.:-) regards, Hiroshi Saito ----- Original Message ----- From: "Magnus Hagander" <mha@sollentuna.net> To: "Hiroshi Saito" <saito@inetrt.skcapi.co.jp> Cc: <pgsql-hackers-win32@postgresql.org> Sent: Wednesday, February 02, 2005 4:57 AM Subject: RE: simple doubt with shfolder.lib? I have SHGetFolderPath in ShlObj.h, per: SHFOLDERAPI SHGetFolderPathA(HWND hwnd, int csidl, HANDLE hToken, DWORD dwFlags, LPSTR pszPath); SHFOLDERAPI SHGetFolderPathW(HWND hwnd, int csidl, HANDLE hToken, DWORD dwFlags, LPWSTR pszPath); #ifdef UNICODE #define SHGetFolderPath SHGetFolderPathW #else #define SHGetFolderPath SHGetFolderPathA #endif // !UNICODE I ahve it in shfolder.h as well, but only as SHFOLDERAPI SHGetFolderPathA(HWND hwnd, int csidl, HANDLE hToken, DWORD dwFlags, LPSTR pszPath); SHFOLDERAPI SHGetFolderPathW(HWND hwnd, int csidl, HANDLE hToken, DWORD dwFlags, LPWSTR pszPath); And not the #define. What version of the Platform SDK do you have that does not contain the correct definition in ShlObj.h? //Magnus >-----Original Message----- >From: Hiroshi Saito [mailto:saito@inetrt.skcapi.co.jp] >Sent: den 1 februari 2005 19:25 >To: Magnus Hagander >Cc: pgsql-hackers-win32@postgresql.org >Subject: simple doubt with shfolder.lib? > > >Hi Magnus. > >I have a doubt to the way of linking to use MS-SDK. > >It is defined as follows by using <shfolder.h> > >#ifdef UNICODE >#define SHGetFolderPath SHGetFolderPathW >#define PFNSHGETFOLDERPATH PFNSHGETFOLDERPATHW >#else >#define SHGetFolderPath SHGetFolderPathA >#define PFNSHGETFOLDERPATH PFNSHGETFOLDERPATHA >#endif > >Therefore, It seems that present patch is necessity. > >--- src/interfaces/libpq/fe-connect.c.orig Wed Feb 2 >03:20:05 2005 >+++ src/interfaces/libpq/fe-connect.c Wed Feb 2 03:20:19 2005 >@@ -44,6 +44,7 @@ > #endif > #define near > #include <shlobj.h> >+#include <shfolder.h> > #else > #include <sys/socket.h> > #include <netdb.h> >--- src/port/path.c.orig Wed Feb 2 03:19:19 2005 >+++ src/port/path.c Wed Feb 2 03:19:38 2005 >@@ -27,6 +27,7 @@ > #endif > #define near > #include <shlobj.h> >+#include <shfolder.h> > #else > #include <unistd.h> > #endif > >Or, my misunderstanding? >Any comment? > >regards, >Hiroshi Saito >