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
IDS_CGCOFAIL, "CoGetClassObject failed."
IDS_ERROR_UNKN, "Unknown error"
IDS_TRUE "True"
IDS_FALSE "False"
IDS_BYTES "bytes"
}
DLG_CREATEINSTON DIALOG DISCARDABLE 0, 0, 250, 41
......
......@@ -43,9 +43,9 @@ void CreateRegRec(HKEY hKey, HTREEITEM parent, WCHAR *wszKeyName, BOOL addings)
TVINSERTSTRUCT tvis;
HTREEITEM addPlace = parent;
tvis.item.mask = TVIF_TEXT;
tvis.item.cchTextMax = MAX_LOAD_STRING;
tvis.item.pszText = wszTree;
U(tvis).item.mask = TVIF_TEXT;
U(tvis).item.cchTextMax = MAX_LOAD_STRING;
U(tvis).item.pszText = wszTree;
tvis.hInsertAfter = (HTREEITEM)TVI_LAST;
tvis.hParent = parent;
......@@ -61,9 +61,9 @@ void CreateRegRec(HKEY hKey, HTREEITEM parent, WCHAR *wszKeyName, BOOL addings)
{
if(!i && lstrlenW(wszKeyName) > 1)
{
tvis.item.pszText = (LPWSTR)wszKeyName;
U(tvis).item.pszText = (LPWSTR)wszKeyName;
addPlace = TreeView_InsertItem(details.hReg, &tvis);
tvis.item.pszText = wszTree;
U(tvis).item.pszText = wszTree;
}
break;
}
......@@ -210,9 +210,9 @@ void CreateReg(WCHAR *buffer)
TVINSERTSTRUCT tvis;
HTREEITEM addPlace = TVI_ROOT;
tvis.item.mask = TVIF_TEXT;
tvis.item.cchTextMax = MAX_LOAD_STRING;
tvis.item.pszText = wszTree;
U(tvis).item.mask = TVIF_TEXT;
U(tvis).item.cchTextMax = MAX_LOAD_STRING;
U(tvis).item.pszText = wszTree;
tvis.hInsertAfter = (HTREEITEM)TVI_LAST;
tvis.hParent = TVI_ROOT;
......
......@@ -72,9 +72,8 @@ INT_PTR CALLBACK InterfaceViewerProc(HWND hDlgWnd, UINT uMsg,
HRESULT hRes;
ULARGE_INTEGER size;
WCHAR wszSize[MAX_LOAD_STRING];
WCHAR wszTRUE[] = { 'T','R','U','E','\0' };
WCHAR wszFALSE[] = { 'F','A','L','S','E','\0' };
WCHAR wszFormat[] = { '%','d',' ','b','y','t','e','s','\0' };
WCHAR wszBuf[MAX_LOAD_STRING];
WCHAR wszFormat[] = { '%','d',' ','%','s','\0' };
switch(uMsg)
{
......@@ -94,14 +93,21 @@ INT_PTR CALLBACK InterfaceViewerProc(HWND hDlgWnd, UINT uMsg,
unk = GetInterface();
hRes = IPersistStream_IsDirty((IPersistStream *)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);
SetWindowText(hObject, hRes == S_OK ? wszFALSE : wszTRUE);
SetWindowText(hObject, wszBuf);
return TRUE;
case IDC_GETSIZEMAX_BUTTON:
unk = GetInterface();
IPersistStream_GetSizeMax((IPersistStream *)unk, &size);
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);
SetWindowText(hObject, wszSize);
return TRUE;
......
......@@ -20,6 +20,12 @@
#define COBJMACROS
#ifdef NONAMELESSUNION
# define U(x) (x).u
#else
# define U(x) (x)
#endif
#include <windows.h>
#include <winreg.h>
#include <commctrl.h>
......
......@@ -68,6 +68,10 @@
#define IDS_CGCOFAIL 300
#define IDS_ERROR_UNKN 301
#define IDS_TRUE 310
#define IDS_FALSE 311
#define IDS_BYTES 312
#define DLG_CREATEINSTON 1000
#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