Author: tfaber
Date: Sat Jan 26 15:06:49 2013
New Revision: 58224
URL:
http://svn.reactos.org/svn/reactos?rev=58224&view=rev
Log:
[EXPLORER]
- Use set_cpp instead of hand-coding all the parameters
- Use comutil.h and link with comsupp unconditionally, since we now have them
- Use STLPort-compatible filebuf constructor for TCHAR iostreams
- Fix a few MSVC and GCC 4.7 errors/warnings
Modified:
trunk/reactos/base/shell/explorer/CMakeLists.txt
trunk/reactos/base/shell/explorer/desktop/desktop.cpp
trunk/reactos/base/shell/explorer/desktop/desktop.h
trunk/reactos/base/shell/explorer/explorer.cpp
trunk/reactos/base/shell/explorer/shell/webchild.cpp
trunk/reactos/base/shell/explorer/taskbar/startmenu.cpp
trunk/reactos/base/shell/explorer/utility/treedroptarget.h
trunk/reactos/base/shell/explorer/utility/utility.h
trunk/reactos/base/shell/explorer/utility/xmlstorage.h
trunk/reactos/include/crt/comutil.h
Modified: trunk/reactos/base/shell/explorer/CMakeLists.txt
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/shell/explorer/CMakeL…
==============================================================================
--- trunk/reactos/base/shell/explorer/CMakeLists.txt [iso-8859-1] (original)
+++ trunk/reactos/base/shell/explorer/CMakeLists.txt [iso-8859-1] Sat Jan 26 15:06:49
2013
@@ -1,15 +1,11 @@
add_subdirectory(notifyhook)
-#NOTE : explorer doesn't follow standard c++, and so doesn't compile with stlport
headers
-#I'm not willing to do it if explorer_new is hanging around.
-#jgardou
-#set_cpp()
+set_cpp()
add_definitions(
-DWIN32
- -D__WINDRES__
- -DUNICODE -D_UNICODE)
+ -D__WINDRES__)
#add_pch(explorer precomp.h)
include_directories(${CMAKE_CURRENT_SOURCE_DIR})
@@ -51,20 +47,10 @@
utility/shellbrowserimpl.cpp) # utility/shelltests.cpp
add_executable(explorer ${SOURCE})
-set_subsystem(explorer windows)
-set_entrypoint(explorer wWinMainCRTStartup)
-
-target_link_libraries(explorer
- -lsupc++
- -lstdc++
- -lgcc
- -lmingwex
- -lmingw32
- wine
- uuid)
+target_link_libraries(explorer comsupp wine uuid)
+set_module_type(explorer win32gui UNICODE)
add_importlibs(explorer advapi32 gdi32 user32 ws2_32 msimg32 comctl32 ole32 oleaut32
shell32 shlwapi notifyhook msvcrt kernel32 ntdll)
-set_image_base(explorer 0x00400000)
add_dependencies(explorer psdk)
add_cd_file(TARGET explorer DESTINATION reactos FOR all)
add_cd_file(FILE ${CMAKE_CURRENT_SOURCE_DIR}/explorer-cfg-template.xml DESTINATION
reactos FOR all)
Modified: trunk/reactos/base/shell/explorer/desktop/desktop.cpp
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/shell/explorer/deskto…
==============================================================================
--- trunk/reactos/base/shell/explorer/desktop/desktop.cpp [iso-8859-1] (original)
+++ trunk/reactos/base/shell/explorer/desktop/desktop.cpp [iso-8859-1] Sat Jan 26 15:06:49
2013
@@ -235,8 +235,9 @@
if (minimized.empty()) {
EnumWindows(MinimizeDesktopEnumFct, (LPARAM)&minimized);
} else {
- for(list<MinimizeStruct>::const_reverse_iterator it=minimized.rbegin();
- it!=minimized.rend(); ++it) {
+ const list<MinimizeStruct>& cminimized = minimized;
+ for(list<MinimizeStruct>::const_reverse_iterator it=cminimized.rbegin();
+ it!=cminimized.rend(); ++it) {
ShowWindowAsync(it->first, it->second&WS_MAXIMIZE? SW_MAXIMIZE:
SW_RESTORE);
Sleep(20);
}
Modified: trunk/reactos/base/shell/explorer/desktop/desktop.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/shell/explorer/deskto…
==============================================================================
--- trunk/reactos/base/shell/explorer/desktop/desktop.h [iso-8859-1] (original)
+++ trunk/reactos/base/shell/explorer/desktop/desktop.h [iso-8859-1] Sat Jan 26 15:06:49
2013
@@ -141,7 +141,8 @@
/* [out][in] */ DWORD __RPC_FAR *pdwEffect)
{
TVHITTESTINFO hit;
- hit.pt = (POINT&)pt;
+ hit.pt.x = pt.x;
+ hit.pt.y = pt.y;
ScreenToClient(m_hTargetWnd, &hit.pt);
hit.flags = TVHT_ONITEM;
Modified: trunk/reactos/base/shell/explorer/explorer.cpp
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/shell/explorer/explor…
==============================================================================
--- trunk/reactos/base/shell/explorer/explorer.cpp [iso-8859-1] (original)
+++ trunk/reactos/base/shell/explorer/explorer.cpp [iso-8859-1] Sat Jan 26 15:06:49 2013
@@ -32,7 +32,7 @@
#include "resource.h"
-//#include <locale.h> // for setlocale()
+#include <locale.h> // for setlocale()
#include <wincon.h>
Modified: trunk/reactos/base/shell/explorer/shell/webchild.cpp
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/shell/explorer/shell/…
==============================================================================
--- trunk/reactos/base/shell/explorer/shell/webchild.cpp [iso-8859-1] (original)
+++ trunk/reactos/base/shell/explorer/shell/webchild.cpp [iso-8859-1] Sat Jan 26 15:06:49
2013
@@ -33,20 +33,7 @@
#include "webchild.h"
-#ifdef _MSC_VER
-
-#if _MSC_VER>=1300 // vtMissing for
VS.Net
#include <comutil.h>
-#pragma comment(lib, "comsupp")
-#endif
-
-#else
-
-#ifdef __MINGW32__ // MinGW is lacking vtMissing (as of 07.02.2004)
-static Variant vtMissing;
-#endif
-
-#endif
//#include <mshtml.h>
Modified: trunk/reactos/base/shell/explorer/taskbar/startmenu.cpp
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/shell/explorer/taskba…
==============================================================================
--- trunk/reactos/base/shell/explorer/taskbar/startmenu.cpp [iso-8859-1] (original)
+++ trunk/reactos/base/shell/explorer/taskbar/startmenu.cpp [iso-8859-1] Sat Jan 26
15:06:49 2013
@@ -1874,7 +1874,7 @@
bool StartMenuRoot::IsStartMenuVisible() const
{
- return IsWindowVisible(_hwnd);
+ return IsWindowVisible(_hwnd) != FALSE;
}
void StartMenuRoot::ProcessKey(int vk)
Modified: trunk/reactos/base/shell/explorer/utility/treedroptarget.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/shell/explorer/utilit…
==============================================================================
--- trunk/reactos/base/shell/explorer/utility/treedroptarget.h [iso-8859-1] (original)
+++ trunk/reactos/base/shell/explorer/utility/treedroptarget.h [iso-8859-1] Sat Jan 26
15:06:49 2013
@@ -61,7 +61,8 @@
/* [out][in] */ DWORD __RPC_FAR *pdwEffect)
{
TVHITTESTINFO hit;
- hit.pt = (POINT&)pt;
+ hit.pt.x = pt.x;
+ hit.pt.y = pt.y;
ScreenToClient(m_hTargetWnd, &hit.pt);
hit.flags = TVHT_ONITEM;
HTREEITEM hItem = TreeView_HitTest(m_hTargetWnd,&hit);
Modified: trunk/reactos/base/shell/explorer/utility/utility.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/shell/explorer/utilit…
==============================================================================
--- trunk/reactos/base/shell/explorer/utility/utility.h [iso-8859-1] (original)
+++ trunk/reactos/base/shell/explorer/utility/utility.h [iso-8859-1] Sat Jan 26 15:06:49
2013
@@ -53,7 +53,7 @@
//#include <malloc.h> // for alloca()
#include <assert.h>
//#include <stdlib.h> // for _MAX_DIR, ...
-//#include <stdio.h> // for sprintf()
+#include <stdio.h> // for sprintf()
//#include <time.h>
#ifdef __cplusplus
Modified: trunk/reactos/base/shell/explorer/utility/xmlstorage.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/shell/explorer/utilit…
==============================================================================
--- trunk/reactos/base/shell/explorer/utility/xmlstorage.h [iso-8859-1] (original)
+++ trunk/reactos/base/shell/explorer/utility/xmlstorage.h [iso-8859-1] Sat Jan 26
15:06:49 2013
@@ -548,11 +548,15 @@
#ifdef __GNUC__
_buf(_pfile, std::ios::in)
#else
- _buf(_pfile)
+ _buf()
#endif
{
if (!_pfile)
setstate(badbit);
+#ifdef _MSC_VER
+ else
+ _buf.open(fileno(_pfile));
+#endif
}
protected:
@@ -570,11 +574,15 @@
#ifdef __GNUC__
_buf(_pfile, std::ios::out)
#else
- _buf(_pfile)
+ _buf()
#endif
{
if (!_pfile)
setstate(badbit);
+#ifdef _MSC_VER
+ else
+ _buf.open(fileno(_pfile));
+#endif
}
~tofstream()
Modified: trunk/reactos/include/crt/comutil.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/crt/comutil.h?rev=…
==============================================================================
--- trunk/reactos/include/crt/comutil.h [iso-8859-1] (original)
+++ trunk/reactos/include/crt/comutil.h [iso-8859-1] Sat Jan 26 15:06:49 2013
@@ -15,7 +15,7 @@
#define _COM_MEMCPY_S(dest,destsize,src,count) memcpy(dest,src,count)
/* Use of wsprintf might be impossible, if strsafe.h is included. */
-#ifndef __STDC_SECURE_LIB__
+#if !defined(__STDC_SECURE_LIB__) || defined(__REACTOS__)
#define _COM_PRINTF_S_1(dest,destsize,format,arg1) wsprintf(dest,format,arg1)
#elif defined(UNICODE)
#define _COM_PRINTF_S_1(dest,destsize,format,arg1) swprintf_s(dest,destsize,format,arg1)