Skip to content

Commit 904e238

Browse files
committed
Use TCHAR types for GetShellFolderPath
Change GetShellFolderPath signatures from char* to LPCTSTR/LPTSTR in CColorCopApp and CColorCopDlg to use TCHAR-based types for Unicode/ANSI compatibility. Update the GetTempFolder call to use _T("AppData") and ensure buffer usage matches the new signatures. Also include minor header tidy-up.
1 parent ca0c08c commit 904e238

4 files changed

Lines changed: 5 additions & 6 deletions

File tree

ColorCop.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ bool CColorCopApp::InstanceRunning() {
9191
return false;
9292
}
9393

94-
BOOL CColorCopApp::GetShellFolderPath(char* pShellFolder, char* pShellPath) {
94+
BOOL CColorCopApp::GetShellFolderPath(LPCTSTR pShellFolder, LPTSTR pShellPath) {
9595
// pShellFolder can be one of the following
9696
// AppData, Cache, Cookies, Desktop, Favorites, Fonts, History, NetHood,
9797
// Personal, Printhood, Programs, Recent, SendTo, Start Menu, Startup,

ColorCop.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,8 @@ class CColorCopApp : public CWinApp {
2828
void CloseApplication();
2929
void LoadDefaultSettings();
3030
CString GetTempFolder();
31-
BOOL GetShellFolderPath(char * pShellFolder, char * pShellPath);
31+
BOOL GetShellFolderPath(LPCTSTR pShellFolder, LPTSTR pShellPath);
3232
void ClipOrCenterWindowToMonitor(HWND hwnd, UINT flags);
33-
3433
// multi mon
3534
void ClipOrCenterRectToMonitor(LPRECT prc, UINT flags);
3635

ColorCopDlg.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2040,7 +2040,7 @@ void CColorCopDlg::ParseHTML(CString inst) {
20402040
return;
20412041
}
20422042

2043-
BOOL CColorCopDlg::GetShellFolderPath(char* pShellFolder, char* pShellPath) {
2043+
BOOL CColorCopDlg::GetShellFolderPath(LPCTSTR pShellFolder, LPTSTR pShellPath) {
20442044
// pShellFolder can be one of the following
20452045
// AppData, Cache, Cookies, Desktop, Favorites, Fonts, History, NetHood,
20462046
// Personal, Printhood, Programs, Recent, SendTo, Start Menu, Startup,
@@ -2068,7 +2068,7 @@ BOOL CColorCopDlg::GetShellFolderPath(char* pShellFolder, char* pShellPath) {
20682068

20692069
CString CColorCopDlg::GetTempFolder() {
20702070
CString strTmpPath;
2071-
GetShellFolderPath("AppData", strTmpPath.GetBuffer(MAX_PATH));
2071+
GetShellFolderPath(_T("AppData"), strTmpPath.GetBuffer(MAX_PATH));
20722072
strTmpPath.ReleaseBuffer();
20732073
return strTmpPath;
20742074
}

ColorCopDlg.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ class CColorCopDlg : public CDialog {
180180
HBITMAP CopyBitmap(HBITMAP hBitmapSrc);
181181
bool isWebsafeColor(int R, int G, int B);
182182
CString GetTempFolder();
183-
BOOL GetShellFolderPath(char* pShellFolder, char* pShellPath);
183+
BOOL GetShellFolderPath(LPCTSTR pShellFolder, LPTSTR pShellPath);
184184

185185
void SetStatusBarText(UINT strResource, int toggleVal);
186186

0 commit comments

Comments
 (0)