Kiln » TortoiseHg » TortoiseHg
Clone URL:  
Pushed to one repository · View In Graph Contained in 0.8, 0.8.1, and 0.8.2

shellext: fix incorrect method signature and datatypes

In x64, UINT and UINT_PTR are distinct, causing compilation to fail.
Also, int was used for UINT values in several places.

Changeset 2ec802829059

Parent d7c481716ff1

by Sune Foldager

Changes to 2 files · Browse files at 2ec802829059 Showing diff from parent d7c481716ff1 Diff from another changeset...

 
9
10
11
12
 
13
14
15
 
110
111
112
113
 
114
115
116
117
118
 
119
120
121
 
137
138
139
140
 
141
142
143
 
162
163
164
165
 
166
167
168
 
188
189
190
191
192
 
 
193
194
195
 
301
302
303
304
 
305
306
307
 
349
350
351
352
 
353
354
355
356
 
357
358
359
 
360
361
362
363
 
 
364
365
366
 
9
10
11
 
12
13
14
15
 
110
111
112
 
113
114
115
116
117
 
118
119
120
121
 
137
138
139
 
140
141
142
143
 
162
163
164
 
165
166
167
168
 
188
189
190
 
 
191
192
193
194
195
 
301
302
303
 
304
305
306
307
 
349
350
351
 
352
353
354
355
356
357
358
359
 
360
361
362
 
 
363
364
365
366
367
@@ -9,7 +9,7 @@
  std::string menuText;   std::string helpText;   std::string iconName; - int idCmd; + UINT idCmd;  } MenuDescription;    MenuDescription menuDescList[] = { @@ -110,12 +110,12 @@
 };    typedef std::map<std::string, MenuDescription> MenuDescriptionMap; -typedef std::map<int, MenuDescription> MenuIdCmdMap; +typedef std::map<UINT, MenuDescription> MenuIdCmdMap;    MenuDescriptionMap MenuDescMap;  MenuIdCmdMap MenuIdMap;   -void AddMenuList(int idCmd, const std::string& name) +void AddMenuList(UINT idCmd, const std::string& name)  {   TDEBUG_TRACE("AddMenuList: idCmd = " << idCmd << " name = " << name);   MenuIdMap[idCmd] = MenuDescMap[name]; @@ -137,7 +137,7 @@
  MenuIdMap.clear();  }   -void InsertMenuItemWithIcon(HMENU hMenu, int indexMenu, int idCmd, +void InsertMenuItemWithIcon(HMENU hMenu, UINT indexMenu, UINT idCmd,   const std::string& menuText, const std::string& iconName)  {   MENUITEMINFO mi; @@ -162,7 +162,7 @@
  InsertMenuItem(hMenu, indexMenu, TRUE, &mi);  }   -void InsertSubMenuItemWithIcon(HMENU hMenu, HMENU hSubMenu, int indexMenu, int idCmd, +void InsertSubMenuItemWithIcon(HMENU hMenu, HMENU hSubMenu, UINT indexMenu, UINT idCmd,   const std::string& menuText, const std::string& iconName)  {   MENUITEMINFO mi; @@ -188,8 +188,8 @@
  InsertMenuItem(hMenu, indexMenu, TRUE, &mi);  }   -void InsertMenuItemByName(HMENU hMenu, const std::string& name, int indexMenu, - int idCmd, int idCmdFirst) +void InsertMenuItemByName(HMENU hMenu, const std::string& name, UINT indexMenu, + UINT idCmd, UINT idCmdFirst)  {   TDEBUG_TRACE("InsertMenuItemByName: name = " << name);   MenuDescriptionMap::iterator iter = MenuDescMap.find(name); @@ -301,7 +301,7 @@
  HMENU hSubMenu = CreatePopupMenu();   if (hSubMenu)   { - int indexSubMenu = 0; + UINT indexSubMenu = 0;   for( walk = entries ; *walk != EndOfList ; walk++ )   {   if( *walk == Separator ) @@ -349,18 +349,19 @@
 }    STDMETHODIMP -CShellExt::GetCommandString(UINT idCmd, UINT uFlags, UINT FAR *reserved, +CShellExt::GetCommandString(UINT_PTR idCmd, UINT uFlags, UINT FAR *reserved,   LPSTR pszName, UINT cchMax)  {   *pszName = 0;   char *psz; + UINT idCmdU = static_cast<UINT>(idCmd)     TDEBUG_TRACE("CShellExt::GetCommandString: idCmd = " << idCmd); - MenuIdCmdMap::iterator iter = MenuIdMap.find(idCmd); + MenuIdCmdMap::iterator iter = MenuIdMap.find(idCmdU);   if (iter != MenuIdMap.end())   { - TDEBUG_TRACE("CShellExt::GetCommandString: name = " << MenuIdMap[idCmd].name); - psz = (char*)MenuIdMap[idCmd].helpText.c_str(); + TDEBUG_TRACE("CShellExt::GetCommandString: name = " << MenuIdMap[idCmdU].name); + psz = (char*)MenuIdMap[idCmdU].helpText.c_str();   }   else   {
 
79
80
81
82
 
83
84
85
 
79
80
81
 
82
83
84
85
@@ -79,7 +79,7 @@
  // IContextMenu3   STDMETHODIMP QueryContextMenu(HMENU hMenu, UINT indexMenu, UINT idCmdFirst, UINT idCmdLast, UINT uFlags);   STDMETHODIMP InvokeCommand(LPCMINVOKECOMMANDINFO lpcmi); - STDMETHODIMP GetCommandString(UINT idCmd, UINT uFlags, UINT FAR *reserved, LPSTR pszName, UINT cchMax); + STDMETHODIMP GetCommandString(UINT_PTR idCmd, UINT uFlags, UINT FAR *reserved, LPSTR pszName, UINT cchMax);   STDMETHODIMP HandleMenuMsg(UINT uMsg, WPARAM wParam, LPARAM lParam);   STDMETHODIMP HandleMenuMsg2(UINT uMsg, WPARAM wParam, LPARAM lParam, LRESULT *pResult);