Commit 33d0216b authored by Piotr Caban's avatar Piotr Caban Committed by Alexandre Julliard

oleview: Fix compilation with gcc 2.95.

- patch based on Francois Gouget Fix compilation with gcc 2.95 patch - moved some string to resources - fixed implementation of IPersistStream interface viewer
parent c3e5807b
...@@ -116,6 +116,9 @@ STRINGTABLE ...@@ -116,6 +116,9 @@ STRINGTABLE
IDS_CGCOFAIL, "CoGetClassObject failed." IDS_CGCOFAIL, "CoGetClassObject failed."
IDS_ERROR_UNKN, "Unknown error" IDS_ERROR_UNKN, "Unknown error"
IDS_TRUE "True"
IDS_FALSE "False"
IDS_BYTES "bytes"
} }
DLG_CREATEINSTON DIALOG DISCARDABLE 0, 0, 250, 41 DLG_CREATEINSTON DIALOG DISCARDABLE 0, 0, 250, 41
......
...@@ -43,9 +43,9 @@ void CreateRegRec(HKEY hKey, HTREEITEM parent, WCHAR *wszKeyName, BOOL addings) ...@@ -43,9 +43,9 @@ void CreateRegRec(HKEY hKey, HTREEITEM parent, WCHAR *wszKeyName, BOOL addings)
TVINSERTSTRUCT tvis; TVINSERTSTRUCT tvis;
HTREEITEM addPlace = parent; HTREEITEM addPlace = parent;
tvis.item.mask = TVIF_TEXT; U(tvis).item.mask = TVIF_TEXT;
tvis.item.cchTextMax = MAX_LOAD_STRING; U(tvis).item.cchTextMax = MAX_LOAD_STRING;
tvis.item.pszText = wszTree; U(tvis).item.pszText = wszTree;
tvis.hInsertAfter = (HTREEITEM)TVI_LAST; tvis.hInsertAfter = (HTREEITEM)TVI_LAST;
tvis.hParent = parent; tvis.hParent = parent;
...@@ -61,9 +61,9 @@ void CreateRegRec(HKEY hKey, HTREEITEM parent, WCHAR *wszKeyName, BOOL addings) ...@@ -61,9 +61,9 @@ void CreateRegRec(HKEY hKey, HTREEITEM parent, WCHAR *wszKeyName, BOOL addings)
{ {
if(!i && lstrlenW(wszKeyName) > 1) if(!i && lstrlenW(wszKeyName) > 1)
{ {
tvis.item.pszText = (LPWSTR)wszKeyName; U(tvis).item.pszText = (LPWSTR)wszKeyName;
addPlace = TreeView_InsertItem(details.hReg, &tvis); addPlace = TreeView_InsertItem(details.hReg, &tvis);
tvis.item.pszText = wszTree; U(tvis).item.pszText = wszTree;
} }
break; break;
} }
...@@ -210,9 +210,9 @@ void CreateReg(WCHAR *buffer) ...@@ -210,9 +210,9 @@ void CreateReg(WCHAR *buffer)
TVINSERTSTRUCT tvis; TVINSERTSTRUCT tvis;
HTREEITEM addPlace = TVI_ROOT; HTREEITEM addPlace = TVI_ROOT;
tvis.item.mask = TVIF_TEXT; U(tvis).item.mask = TVIF_TEXT;
tvis.item.cchTextMax = MAX_LOAD_STRING; U(tvis).item.cchTextMax = MAX_LOAD_STRING;
tvis.item.pszText = wszTree; U(tvis).item.pszText = wszTree;
tvis.hInsertAfter = (HTREEITEM)TVI_LAST; tvis.hInsertAfter = (HTREEITEM)TVI_LAST;
tvis.hParent = TVI_ROOT; tvis.hParent = TVI_ROOT;
......
...@@ -72,9 +72,8 @@ INT_PTR CALLBACK InterfaceViewerProc(HWND hDlgWnd, UINT uMsg, ...@@ -72,9 +72,8 @@ INT_PTR CALLBACK InterfaceViewerProc(HWND hDlgWnd, UINT uMsg,
HRESULT hRes; HRESULT hRes;
ULARGE_INTEGER size; ULARGE_INTEGER size;
WCHAR wszSize[MAX_LOAD_STRING]; WCHAR wszSize[MAX_LOAD_STRING];
WCHAR wszTRUE[] = { 'T','R','U','E','\0' }; WCHAR wszBuf[MAX_LOAD_STRING];
WCHAR wszFALSE[] = { 'F','A','L','S','E','\0' }; WCHAR wszFormat[] = { '%','d',' ','%','s','\0' };
WCHAR wszFormat[] = { '%','d',' ','b','y','t','e','s','\0' };
switch(uMsg) switch(uMsg)
{ {
...@@ -94,14 +93,21 @@ INT_PTR CALLBACK InterfaceViewerProc(HWND hDlgWnd, UINT uMsg, ...@@ -94,14 +93,21 @@ INT_PTR CALLBACK InterfaceViewerProc(HWND hDlgWnd, UINT uMsg,
unk = GetInterface(); unk = GetInterface();
hRes = IPersistStream_IsDirty((IPersistStream *)unk); hRes = IPersistStream_IsDirty((IPersistStream *)unk);
IUnknown_Release(unk); IUnknown_Release(unk);
if(hRes == S_OK)
LoadString(globals.hMainInst, IDS_FALSE, wszBuf,
sizeof(WCHAR[MAX_LOAD_STRING]));
else LoadString(globals.hMainInst, IDS_TRUE, wszBuf,
sizeof(WCHAR[MAX_LOAD_STRING]));
hObject = GetDlgItem(hDlgWnd, IDC_ISDIRTY); hObject = GetDlgItem(hDlgWnd, IDC_ISDIRTY);
SetWindowText(hObject, hRes == S_OK ? wszFALSE : wszTRUE); SetWindowText(hObject, wszBuf);
return TRUE; return TRUE;
case IDC_GETSIZEMAX_BUTTON: case IDC_GETSIZEMAX_BUTTON:
unk = GetInterface(); unk = GetInterface();
IPersistStream_GetSizeMax((IPersistStream *)unk, &size); IPersistStream_GetSizeMax((IPersistStream *)unk, &size);
IUnknown_Release(unk); IUnknown_Release(unk);
wsprintfW(wszSize, wszFormat, size); LoadString(globals.hMainInst, IDS_BYTES, wszBuf,
sizeof(WCHAR[MAX_LOAD_STRING]));
wsprintfW(wszSize, wszFormat, U(size).LowPart, wszBuf);
hObject = GetDlgItem(hDlgWnd, IDC_GETSIZEMAX); hObject = GetDlgItem(hDlgWnd, IDC_GETSIZEMAX);
SetWindowText(hObject, wszSize); SetWindowText(hObject, wszSize);
return TRUE; return TRUE;
......
...@@ -20,6 +20,12 @@ ...@@ -20,6 +20,12 @@
#define COBJMACROS #define COBJMACROS
#ifdef NONAMELESSUNION
# define U(x) (x).u
#else
# define U(x) (x)
#endif
#include <windows.h> #include <windows.h>
#include <winreg.h> #include <winreg.h>
#include <commctrl.h> #include <commctrl.h>
......
...@@ -68,6 +68,10 @@ ...@@ -68,6 +68,10 @@
#define IDS_CGCOFAIL 300 #define IDS_CGCOFAIL 300
#define IDS_ERROR_UNKN 301 #define IDS_ERROR_UNKN 301
#define IDS_TRUE 310
#define IDS_FALSE 311
#define IDS_BYTES 312
#define DLG_CREATEINSTON 1000 #define DLG_CREATEINSTON 1000
#define IDC_MACHINE 1001 #define IDC_MACHINE 1001
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment