Commit c34c6ac2 authored by Michael Stefaniuc's avatar Michael Stefaniuc Committed by Alexandre Julliard

oleview: Switch the rest to use the explicit W-types/functions.

Compile with -DWINE_NO_UNICODE_MACROS.
parent 12be9c39
......@@ -5,7 +5,7 @@ VPATH = @srcdir@
MODULE = oleview.exe
APPMODE = -mwindows
IMPORTS = uuid comdlg32 comctl32 shell32 oleaut32 ole32 user32 advapi32 kernel32
EXTRADEFS = -DUNICODE
EXTRADEFS = -DWINE_NO_UNICODE_MACROS
C_SRCS = \
details.c \
......
......@@ -28,12 +28,12 @@ typedef struct
BOOL IsInterface(HTREEITEM item)
{
TVITEM tvi;
TVITEMW tvi;
memset(&tvi, 0, sizeof(TVITEM));
memset(&tvi, 0, sizeof(TVITEMW));
tvi.hItem = item;
SendMessage(globals.hTree, TVM_GETITEM, 0, (LPARAM)&tvi);
SendMessageW(globals.hTree, TVM_GETITEMW, 0, (LPARAM)&tvi);
if(!tvi.lParam) return FALSE;
if(((ITEM_INFO*)tvi.lParam)->cFlag & INTERFACE) return TRUE;
......@@ -43,22 +43,22 @@ BOOL IsInterface(HTREEITEM item)
static IUnknown *GetInterface(void)
{
HTREEITEM hSelect;
TVITEM tvi;
TVITEMW tvi;
CLSID clsid;
IUnknown *unk;
hSelect = (HTREEITEM)SendMessageW(globals.hTree, TVM_GETNEXTITEM,
TVGN_CARET, 0);
memset(&tvi, 0, sizeof(TVITEM));
memset(&tvi, 0, sizeof(TVITEMW));
tvi.hItem = hSelect;
SendMessage(globals.hTree, TVM_GETITEM, 0, (LPARAM)&tvi);
SendMessageW(globals.hTree, TVM_GETITEMW, 0, (LPARAM)&tvi);
CLSIDFromString(((ITEM_INFO *)tvi.lParam)->clsid, &clsid);
memset(&tvi, 0, sizeof(TVITEM));
memset(&tvi, 0, sizeof(TVITEMW));
tvi.hItem = (HTREEITEM)SendMessageW(globals.hTree, TVM_GETNEXTITEM,
TVGN_PARENT, (LPARAM)hSelect);
SendMessage(globals.hTree, TVM_GETITEM, 0, (LPARAM)&tvi);
SendMessageW(globals.hTree, TVM_GETITEMW, 0, (LPARAM)&tvi);
IUnknown_QueryInterface(((ITEM_INFO *)tvi.lParam)->pU, &clsid, (void *)&unk);
......@@ -82,9 +82,9 @@ static INT_PTR CALLBACK InterfaceViewerProc(HWND hDlgWnd, UINT uMsg,
case WM_INITDIALOG:
di = (DIALOG_INFO *)lParam;
hObject = GetDlgItem(hDlgWnd, IDC_LABEL);
SetWindowText(hObject, di->wszLabel);
SetWindowTextW(hObject, di->wszLabel);
hObject = GetDlgItem(hDlgWnd, IDC_IDENTIFIER);
SetWindowText(hObject, di->wszIdentifier);
SetWindowTextW(hObject, di->wszIdentifier);
return TRUE;
case WM_COMMAND:
switch(LOWORD(wParam)) {
......@@ -96,22 +96,22 @@ static INT_PTR CALLBACK InterfaceViewerProc(HWND hDlgWnd, UINT uMsg,
hRes = IPersistStream_IsDirty((IPersistStream *)unk);
IUnknown_Release(unk);
if(hRes == S_OK)
LoadString(globals.hMainInst, IDS_FALSE, wszBuf,
LoadStringW(globals.hMainInst, IDS_FALSE, wszBuf,
sizeof(wszBuf)/sizeof(wszBuf[0]));
else LoadString(globals.hMainInst, IDS_TRUE, wszBuf,
else LoadStringW(globals.hMainInst, IDS_TRUE, wszBuf,
sizeof(wszBuf)/sizeof(wszBuf[0]));
hObject = GetDlgItem(hDlgWnd, IDC_ISDIRTY);
SetWindowText(hObject, wszBuf);
SetWindowTextW(hObject, wszBuf);
return TRUE;
case IDC_GETSIZEMAX_BUTTON:
unk = GetInterface();
IPersistStream_GetSizeMax((IPersistStream *)unk, &size);
IUnknown_Release(unk);
LoadString(globals.hMainInst, IDS_BYTES, wszBuf,
LoadStringW(globals.hMainInst, IDS_BYTES, wszBuf,
sizeof(wszBuf)/sizeof(wszBuf[0]));
wsprintfW(wszSize, wszFormat, U(size).LowPart, wszBuf);
hObject = GetDlgItem(hDlgWnd, IDC_GETSIZEMAX);
SetWindowText(hObject, wszSize);
SetWindowTextW(hObject, wszSize);
return TRUE;
}
}
......@@ -128,7 +128,7 @@ static void IPersistStreamInterfaceViewer(WCHAR *clsid, WCHAR *wszName)
else di.wszLabel = wszName;
di.wszIdentifier = clsid;
DialogBoxParam(0, MAKEINTRESOURCE(DLG_IPERSISTSTREAM_IV),
DialogBoxParamW(0, MAKEINTRESOURCEW(DLG_IPERSISTSTREAM_IV),
globals.hMainWnd, InterfaceViewerProc, (LPARAM)&di);
}
......@@ -142,7 +142,7 @@ static void IPersistInterfaceViewer(WCHAR *clsid, WCHAR *wszName)
else di.wszLabel = wszName;
di.wszIdentifier = clsid;
DialogBoxParam(0, MAKEINTRESOURCE(DLG_IPERSIST_IV),
DialogBoxParamW(0, MAKEINTRESOURCEW(DLG_IPERSIST_IV),
globals.hMainWnd, InterfaceViewerProc, (LPARAM)&di);
}
......@@ -153,13 +153,13 @@ static void DefaultInterfaceViewer(WCHAR *clsid, WCHAR *wszName)
di.wszLabel = wszName;
di.wszIdentifier = clsid;
DialogBoxParam(0, MAKEINTRESOURCE(DLG_DEFAULT_IV),
DialogBoxParamW(0, MAKEINTRESOURCEW(DLG_DEFAULT_IV),
globals.hMainWnd, InterfaceViewerProc, (LPARAM)&di);
}
void InterfaceViewer(HTREEITEM item)
{
TVITEM tvi;
TVITEMW tvi;
WCHAR *clsid;
WCHAR wszName[MAX_LOAD_STRING];
WCHAR wszParent[MAX_LOAD_STRING];
......@@ -170,23 +170,23 @@ void InterfaceViewer(HTREEITEM item)
'0','0','0','0','-','0','0','0','0','-','C','0','0','0','-',
'0','0','0','0','0','0','0','0','0','0','4','6','}','\0' };
memset(&tvi, 0, sizeof(TVITEM));
memset(&tvi, 0, sizeof(TVITEMW));
tvi.mask = TVIF_TEXT;
tvi.hItem = item;
tvi.cchTextMax = MAX_LOAD_STRING;
tvi.pszText = wszName;
SendMessage(globals.hTree, TVM_GETITEM, 0, (LPARAM)&tvi);
SendMessageW(globals.hTree, TVM_GETITEMW, 0, (LPARAM)&tvi);
clsid = ((ITEM_INFO*)tvi.lParam)->clsid;
memset(&tvi, 0, sizeof(TVITEM));
memset(&tvi, 0, sizeof(TVITEMW));
tvi.mask = TVIF_TEXT;
tvi.hItem = (HTREEITEM)SendMessageW(globals.hTree, TVM_GETNEXTITEM,
TVGN_PARENT, (LPARAM)item);
tvi.cchTextMax = MAX_LOAD_STRING;
tvi.pszText = wszParent;
SendMessage(globals.hTree, TVM_GETITEM, 0, (LPARAM)&tvi);
SendMessageW(globals.hTree, TVM_GETITEMW, 0, (LPARAM)&tvi);
if(!memcmp(clsid, wszIPersistStream, sizeof(wszIPersistStream)))
IPersistStreamInterfaceViewer(clsid, wszParent);
......
......@@ -138,7 +138,7 @@ void RefreshMenu(HTREEITEM item);
/* pane.c */
BOOL CreatePanedWindow(HWND hWnd, HWND *hWndCreated, HINSTANCE hInst);
BOOL PaneRegisterClass(void);
BOOL PaneRegisterClassW(void);
void SetLeft(HWND hParent, HWND hWnd);
void SetRight(HWND hParent, HWND hWnd);
......@@ -153,7 +153,7 @@ void ReleaseInst(HTREEITEM item);
/* typelib.c */
BOOL CreateTypeLibWindow(HINSTANCE hInst, WCHAR *wszFileName);
BOOL TypeLibRegisterClass(void);
BOOL TypeLibRegisterClassW(void);
void UpdateData(HTREEITEM item);
/* interface.c */
......
......@@ -70,7 +70,7 @@ static LRESULT CALLBACK PaneProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lPa
if(pt.x >= GetSplitPos(hWnd)-pane->size/2 &&
pt.x <= GetSplitPos(hWnd)+pane->size/2)
SetCursor(LoadCursor(0, IDC_SIZEWE));
SetCursor(LoadCursorW(0, (LPWSTR)IDC_SIZEWE));
break;
case WM_LBUTTONDOWN:
if((short)LOWORD(lParam) >= GetSplitPos(hWnd)-pane->size/2 &&
......@@ -103,8 +103,8 @@ static LRESULT CALLBACK PaneProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lPa
if((int)wParam != TYPELIB_TREE) break;
switch(((LPNMHDR)lParam)->code)
{
case TVN_SELCHANGED:
UpdateData(((NMTREEVIEW *)lParam)->itemNew.hItem);
case TVN_SELCHANGEDW:
UpdateData(((NMTREEVIEWW *)lParam)->itemNew.hItem);
break;
}
break;
......@@ -123,22 +123,22 @@ static LRESULT CALLBACK PaneProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lPa
HeapFree(GetProcessHeap(), 0, pane);
break;
default:
return DefWindowProc(hWnd, uMsg, wParam, lParam);
return DefWindowProcW(hWnd, uMsg, wParam, lParam);
}
return 0;
}
BOOL PaneRegisterClass(void)
BOOL PaneRegisterClassW(void)
{
WNDCLASS wcc;
WNDCLASSW wcc;
const WCHAR wszPaneClass[] = { 'P','A','N','E','\0' };
memset(&wcc, 0, sizeof(WNDCLASS));
memset(&wcc, 0, sizeof(WNDCLASSW));
wcc.lpfnWndProc = PaneProc;
wcc.hbrBackground = (HBRUSH)(COLOR_WINDOW);
wcc.lpszClassName = wszPaneClass;
if(!RegisterClass(&wcc))
if(!RegisterClassW(&wcc))
return FALSE;
return TRUE;
}
......@@ -149,7 +149,7 @@ BOOL CreatePanedWindow(HWND hWnd, HWND *hWndCreated, HINSTANCE hInst)
PANE *pane;
pane = HeapAlloc(GetProcessHeap(), 0, sizeof(PANE));
*hWndCreated = CreateWindow(wszPaneClass, NULL, WS_CHILD|WS_VISIBLE,
*hWndCreated = CreateWindowW(wszPaneClass, NULL, WS_CHILD|WS_VISIBLE,
CW_USEDEFAULT, CW_USEDEFAULT, 0, 0, hWnd, (HMENU)pane, hInst, NULL);
if(!*hWndCreated)
{
......
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