oleview: Use the explicit W types/functions in typelib.c.
This commit is contained in:
parent
488baebd8f
commit
2bce56c94e
|
@ -104,11 +104,11 @@ static void ShowLastError(void)
|
||||||
LPWSTR lpMsgBuf;
|
LPWSTR lpMsgBuf;
|
||||||
WCHAR wszTitle[MAX_LOAD_STRING];
|
WCHAR wszTitle[MAX_LOAD_STRING];
|
||||||
|
|
||||||
LoadString(globals.hMainInst, IDS_TYPELIBTITLE, wszTitle,
|
LoadStringW(globals.hMainInst, IDS_TYPELIBTITLE, wszTitle,
|
||||||
sizeof(wszTitle)/sizeof(wszTitle[0]));
|
sizeof(wszTitle)/sizeof(wszTitle[0]));
|
||||||
FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM,
|
FormatMessageW(FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM,
|
||||||
NULL, error, 0, (LPTSTR) &lpMsgBuf, 0, NULL);
|
NULL, error, 0, (LPWSTR)&lpMsgBuf, 0, NULL);
|
||||||
MessageBox(NULL, lpMsgBuf, wszTitle, MB_OK | MB_ICONERROR);
|
MessageBoxW(NULL, lpMsgBuf, wszTitle, MB_OK | MB_ICONERROR);
|
||||||
LocalFree(lpMsgBuf);
|
LocalFree(lpMsgBuf);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -116,7 +116,7 @@ static void ShowLastError(void)
|
||||||
static void SaveIdl(WCHAR *wszFileName)
|
static void SaveIdl(WCHAR *wszFileName)
|
||||||
{
|
{
|
||||||
HTREEITEM hIDL;
|
HTREEITEM hIDL;
|
||||||
TVITEM tvi;
|
TVITEMW tvi;
|
||||||
HANDLE hFile;
|
HANDLE hFile;
|
||||||
DWORD len, dwNumWrite;
|
DWORD len, dwNumWrite;
|
||||||
char *wszIdl;
|
char *wszIdl;
|
||||||
|
@ -125,13 +125,13 @@ static void SaveIdl(WCHAR *wszFileName)
|
||||||
hIDL = (HTREEITEM)SendMessageW(typelib.hTree, TVM_GETNEXTITEM,
|
hIDL = (HTREEITEM)SendMessageW(typelib.hTree, TVM_GETNEXTITEM,
|
||||||
TVGN_CHILD, (LPARAM)TVI_ROOT);
|
TVGN_CHILD, (LPARAM)TVI_ROOT);
|
||||||
|
|
||||||
memset(&tvi, 0, sizeof(TVITEM));
|
memset(&tvi, 0, sizeof(TVITEMW));
|
||||||
tvi.hItem = hIDL;
|
tvi.hItem = hIDL;
|
||||||
|
|
||||||
SendMessage(typelib.hTree, TVM_GETITEM, 0, (LPARAM)&tvi);
|
SendMessageW(typelib.hTree, TVM_GETITEMW, 0, (LPARAM)&tvi);
|
||||||
data = (TYPELIB_DATA *)tvi.lParam;
|
data = (TYPELIB_DATA *)tvi.lParam;
|
||||||
|
|
||||||
hFile = CreateFile(wszFileName, GENERIC_WRITE, FILE_SHARE_WRITE,
|
hFile = CreateFileW(wszFileName, GENERIC_WRITE, FILE_SHARE_WRITE,
|
||||||
NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL);
|
NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL);
|
||||||
if(hFile == INVALID_HANDLE_VALUE)
|
if(hFile == INVALID_HANDLE_VALUE)
|
||||||
{
|
{
|
||||||
|
@ -152,7 +152,7 @@ static void SaveIdl(WCHAR *wszFileName)
|
||||||
|
|
||||||
static void GetSaveIdlAsPath(void)
|
static void GetSaveIdlAsPath(void)
|
||||||
{
|
{
|
||||||
OPENFILENAME saveidl;
|
OPENFILENAMEW saveidl;
|
||||||
WCHAR *pFileName;
|
WCHAR *pFileName;
|
||||||
WCHAR wszPath[MAX_LOAD_STRING];
|
WCHAR wszPath[MAX_LOAD_STRING];
|
||||||
WCHAR wszDir[MAX_LOAD_STRING];
|
WCHAR wszDir[MAX_LOAD_STRING];
|
||||||
|
@ -174,9 +174,9 @@ static void GetSaveIdlAsPath(void)
|
||||||
if(*pFileName == '\\' || *pFileName == '/') pFileName += 1;
|
if(*pFileName == '\\' || *pFileName == '/') pFileName += 1;
|
||||||
lstrcpyW(wszPath, pFileName);
|
lstrcpyW(wszPath, pFileName);
|
||||||
|
|
||||||
GetCurrentDirectory(MAX_LOAD_STRING, wszDir);
|
GetCurrentDirectoryW(MAX_LOAD_STRING, wszDir);
|
||||||
|
|
||||||
saveidl.lStructSize = sizeof(OPENFILENAME);
|
saveidl.lStructSize = sizeof(OPENFILENAMEW);
|
||||||
saveidl.hwndOwner = globals.hTypeLibWnd;
|
saveidl.hwndOwner = globals.hTypeLibWnd;
|
||||||
saveidl.hInstance = globals.hMainInst;
|
saveidl.hInstance = globals.hMainInst;
|
||||||
saveidl.lpstrFilter = wszIdlFiles;
|
saveidl.lpstrFilter = wszIdlFiles;
|
||||||
|
@ -186,7 +186,7 @@ static void GetSaveIdlAsPath(void)
|
||||||
saveidl.Flags = OFN_PATHMUSTEXIST | OFN_OVERWRITEPROMPT | OFN_HIDEREADONLY;
|
saveidl.Flags = OFN_PATHMUSTEXIST | OFN_OVERWRITEPROMPT | OFN_HIDEREADONLY;
|
||||||
saveidl.lpstrDefExt = wszDefaultExt;
|
saveidl.lpstrDefExt = wszDefaultExt;
|
||||||
|
|
||||||
if (GetSaveFileName(&saveidl))
|
if (GetSaveFileNameW(&saveidl))
|
||||||
SaveIdl(wszPath);
|
SaveIdl(wszPath);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -277,7 +277,7 @@ static void AddSpaces(TYPELIB_DATA *pTLData, int tabSize)
|
||||||
static void AddChildrenData(HTREEITEM hParent, TYPELIB_DATA *pData)
|
static void AddChildrenData(HTREEITEM hParent, TYPELIB_DATA *pData)
|
||||||
{
|
{
|
||||||
HTREEITEM hCur;
|
HTREEITEM hCur;
|
||||||
TVITEM tvi;
|
TVITEMW tvi;
|
||||||
|
|
||||||
memset(&tvi, 0, sizeof(tvi));
|
memset(&tvi, 0, sizeof(tvi));
|
||||||
|
|
||||||
|
@ -288,7 +288,7 @@ static void AddChildrenData(HTREEITEM hParent, TYPELIB_DATA *pData)
|
||||||
do
|
do
|
||||||
{
|
{
|
||||||
tvi.hItem = hCur;
|
tvi.hItem = hCur;
|
||||||
SendMessage(typelib.hTree, TVM_GETITEM, 0, (LPARAM)&tvi);
|
SendMessageW(typelib.hTree, TVM_GETITEMW, 0, (LPARAM)&tvi);
|
||||||
if(tvi.lParam && ((TYPELIB_DATA *)(tvi.lParam))->idlLen)
|
if(tvi.lParam && ((TYPELIB_DATA *)(tvi.lParam))->idlLen)
|
||||||
AddToTLDataStrWithTabsW(pData, ((TYPELIB_DATA *)(tvi.lParam))->idl);
|
AddToTLDataStrWithTabsW(pData, ((TYPELIB_DATA *)(tvi.lParam))->idl);
|
||||||
} while((hCur = (HTREEITEM)SendMessageW(typelib.hTree, TVM_GETNEXTITEM,
|
} while((hCur = (HTREEITEM)SendMessageW(typelib.hTree, TVM_GETNEXTITEM,
|
||||||
|
@ -373,7 +373,7 @@ static void CreateTypeInfo(WCHAR *wszAddTo, WCHAR *wszAddAfter, TYPEDESC tdesc,
|
||||||
static int EnumVars(ITypeInfo *pTypeInfo, int cVars, HTREEITEM hParent)
|
static int EnumVars(ITypeInfo *pTypeInfo, int cVars, HTREEITEM hParent)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
TVINSERTSTRUCT tvis;
|
TVINSERTSTRUCTW tvis;
|
||||||
VARDESC *pVarDesc;
|
VARDESC *pVarDesc;
|
||||||
BSTR bstrName;
|
BSTR bstrName;
|
||||||
WCHAR wszText[MAX_LOAD_STRING];
|
WCHAR wszText[MAX_LOAD_STRING];
|
||||||
|
@ -426,7 +426,7 @@ static int EnumVars(ITypeInfo *pTypeInfo, int cVars, HTREEITEM hParent)
|
||||||
AddToTLDataStrW(tld, wszSemicolon);
|
AddToTLDataStrW(tld, wszSemicolon);
|
||||||
AddToTLDataStrW(tld, wszNewLine);
|
AddToTLDataStrW(tld, wszNewLine);
|
||||||
|
|
||||||
SendMessage(typelib.hTree, TVM_INSERTITEM, 0, (LPARAM)&tvis);
|
SendMessageW(typelib.hTree, TVM_INSERTITEMW, 0, (LPARAM)&tvis);
|
||||||
SysFreeString(bstrName);
|
SysFreeString(bstrName);
|
||||||
ITypeInfo_ReleaseVarDesc(pTypeInfo, pVarDesc);
|
ITypeInfo_ReleaseVarDesc(pTypeInfo, pVarDesc);
|
||||||
}
|
}
|
||||||
|
@ -437,7 +437,7 @@ static int EnumVars(ITypeInfo *pTypeInfo, int cVars, HTREEITEM hParent)
|
||||||
static int EnumEnums(ITypeInfo *pTypeInfo, int cVars, HTREEITEM hParent)
|
static int EnumEnums(ITypeInfo *pTypeInfo, int cVars, HTREEITEM hParent)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
TVINSERTSTRUCT tvis;
|
TVINSERTSTRUCTW tvis;
|
||||||
VARDESC *pVarDesc;
|
VARDESC *pVarDesc;
|
||||||
BSTR bstrName;
|
BSTR bstrName;
|
||||||
WCHAR wszText[MAX_LOAD_STRING];
|
WCHAR wszText[MAX_LOAD_STRING];
|
||||||
|
@ -488,7 +488,7 @@ static int EnumEnums(ITypeInfo *pTypeInfo, int cVars, HTREEITEM hParent)
|
||||||
AddToTLDataStrW(tld, wszComa);
|
AddToTLDataStrW(tld, wszComa);
|
||||||
AddToTLDataStrW(tld, wszNewLine);
|
AddToTLDataStrW(tld, wszNewLine);
|
||||||
|
|
||||||
SendMessage(typelib.hTree, TVM_INSERTITEM, 0, (LPARAM)&tvis);
|
SendMessageW(typelib.hTree, TVM_INSERTITEMW, 0, (LPARAM)&tvis);
|
||||||
SysFreeString(bstrName);
|
SysFreeString(bstrName);
|
||||||
ITypeInfo_ReleaseVarDesc(pTypeInfo, pVarDesc);
|
ITypeInfo_ReleaseVarDesc(pTypeInfo, pVarDesc);
|
||||||
}
|
}
|
||||||
|
@ -501,7 +501,7 @@ static int EnumFuncs(ITypeInfo *pTypeInfo, TYPEATTR *pTypeAttr, HTREEITEM hParen
|
||||||
int i, j;
|
int i, j;
|
||||||
int cFuncs;
|
int cFuncs;
|
||||||
unsigned namesNo;
|
unsigned namesNo;
|
||||||
TVINSERTSTRUCT tvis;
|
TVINSERTSTRUCTW tvis;
|
||||||
FUNCDESC *pFuncDesc;
|
FUNCDESC *pFuncDesc;
|
||||||
BSTR bstrName, bstrHelpString, *bstrParamNames;
|
BSTR bstrName, bstrHelpString, *bstrParamNames;
|
||||||
WCHAR wszText[MAX_LOAD_STRING];
|
WCHAR wszText[MAX_LOAD_STRING];
|
||||||
|
@ -711,7 +711,7 @@ static int EnumFuncs(ITypeInfo *pTypeInfo, TYPEATTR *pTypeAttr, HTREEITEM hParen
|
||||||
AddToTLDataStrW(tld, wszSemicolon);
|
AddToTLDataStrW(tld, wszSemicolon);
|
||||||
AddToTLDataStrW(tld, wszNewLine);
|
AddToTLDataStrW(tld, wszNewLine);
|
||||||
|
|
||||||
SendMessage(typelib.hTree, TVM_INSERTITEM, 0, (LPARAM)&tvis);
|
SendMessageW(typelib.hTree, TVM_INSERTITEMW, 0, (LPARAM)&tvis);
|
||||||
HeapFree(GetProcessHeap(), 0, bstrParamNames);
|
HeapFree(GetProcessHeap(), 0, bstrParamNames);
|
||||||
SysFreeString(bstrName);
|
SysFreeString(bstrName);
|
||||||
SysFreeString(bstrHelpString);
|
SysFreeString(bstrHelpString);
|
||||||
|
@ -724,7 +724,7 @@ static int EnumFuncs(ITypeInfo *pTypeInfo, TYPEATTR *pTypeAttr, HTREEITEM hParen
|
||||||
static int EnumImplTypes(ITypeInfo *pTypeInfo, int cImplTypes, HTREEITEM hParent)
|
static int EnumImplTypes(ITypeInfo *pTypeInfo, int cImplTypes, HTREEITEM hParent)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
TVINSERTSTRUCT tvis;
|
TVINSERTSTRUCTW tvis;
|
||||||
ITypeInfo *pRefTypeInfo;
|
ITypeInfo *pRefTypeInfo;
|
||||||
HREFTYPE hRefType;
|
HREFTYPE hRefType;
|
||||||
TYPEATTR *pTypeAttr;
|
TYPEATTR *pTypeAttr;
|
||||||
|
@ -733,7 +733,7 @@ static int EnumImplTypes(ITypeInfo *pTypeInfo, int cImplTypes, HTREEITEM hParent
|
||||||
|
|
||||||
if(!cImplTypes) return 0;
|
if(!cImplTypes) return 0;
|
||||||
|
|
||||||
LoadString(globals.hMainInst, IDS_INHERITINTERFACES, wszInheritedInterfaces,
|
LoadStringW(globals.hMainInst, IDS_INHERITINTERFACES, wszInheritedInterfaces,
|
||||||
sizeof(wszInheritedInterfaces)/sizeof(wszInheritedInterfaces[0]));
|
sizeof(wszInheritedInterfaces)/sizeof(wszInheritedInterfaces[0]));
|
||||||
|
|
||||||
U(tvis).item.mask = TVIF_TEXT;
|
U(tvis).item.mask = TVIF_TEXT;
|
||||||
|
@ -742,7 +742,7 @@ static int EnumImplTypes(ITypeInfo *pTypeInfo, int cImplTypes, HTREEITEM hParent
|
||||||
tvis.hInsertAfter = TVI_LAST;
|
tvis.hInsertAfter = TVI_LAST;
|
||||||
tvis.hParent = hParent;
|
tvis.hParent = hParent;
|
||||||
|
|
||||||
tvis.hParent = TreeView_InsertItem(typelib.hTree, &tvis);
|
tvis.hParent = TreeView_InsertItemW(typelib.hTree, &tvis);
|
||||||
|
|
||||||
for(i=0; i<cImplTypes; i++)
|
for(i=0; i<cImplTypes; i++)
|
||||||
{
|
{
|
||||||
|
@ -764,7 +764,7 @@ static int EnumImplTypes(ITypeInfo *pTypeInfo, int cImplTypes, HTREEITEM hParent
|
||||||
U(tvis).item.cchTextMax = SysStringLen(bstrName);
|
U(tvis).item.cchTextMax = SysStringLen(bstrName);
|
||||||
U(tvis).item.pszText = bstrName;
|
U(tvis).item.pszText = bstrName;
|
||||||
|
|
||||||
hParent = TreeView_InsertItem(typelib.hTree, &tvis);
|
hParent = TreeView_InsertItemW(typelib.hTree, &tvis);
|
||||||
EnumVars(pRefTypeInfo, pTypeAttr->cVars, hParent);
|
EnumVars(pRefTypeInfo, pTypeAttr->cVars, hParent);
|
||||||
EnumFuncs(pRefTypeInfo, pTypeAttr, hParent);
|
EnumFuncs(pRefTypeInfo, pTypeAttr, hParent);
|
||||||
EnumImplTypes(pRefTypeInfo, pTypeAttr->cImplTypes, hParent);
|
EnumImplTypes(pRefTypeInfo, pTypeAttr->cImplTypes, hParent);
|
||||||
|
@ -858,17 +858,17 @@ static void EnumCoclassImplTypes(ITypeInfo *pTypeInfo,
|
||||||
|
|
||||||
static void AddIdlData(HTREEITEM hCur, TYPELIB_DATA *pTLData)
|
static void AddIdlData(HTREEITEM hCur, TYPELIB_DATA *pTLData)
|
||||||
{
|
{
|
||||||
TVITEM tvi;
|
TVITEMW tvi;
|
||||||
|
|
||||||
hCur = (HTREEITEM)SendMessageW(typelib.hTree, TVM_GETNEXTITEM,
|
hCur = (HTREEITEM)SendMessageW(typelib.hTree, TVM_GETNEXTITEM,
|
||||||
TVGN_CHILD, (LPARAM)hCur);
|
TVGN_CHILD, (LPARAM)hCur);
|
||||||
memset(&tvi, 0, sizeof(TVITEM));
|
memset(&tvi, 0, sizeof(TVITEMW));
|
||||||
tvi.mask = TVIF_PARAM;
|
tvi.mask = TVIF_PARAM;
|
||||||
|
|
||||||
while(hCur)
|
while(hCur)
|
||||||
{
|
{
|
||||||
tvi.hItem = hCur;
|
tvi.hItem = hCur;
|
||||||
SendMessage(typelib.hTree, TVM_GETITEM, 0, (LPARAM)&tvi);
|
SendMessageW(typelib.hTree, TVM_GETITEMW, 0, (LPARAM)&tvi);
|
||||||
if(!((TYPELIB_DATA*)(tvi.lParam))->bHide) {
|
if(!((TYPELIB_DATA*)(tvi.lParam))->bHide) {
|
||||||
AddToTLDataStrW(pTLData, wszNewLine);
|
AddToTLDataStrW(pTLData, wszNewLine);
|
||||||
AddToTLDataStrWithTabsW(pTLData, ((TYPELIB_DATA*)(tvi.lParam))->idl);
|
AddToTLDataStrWithTabsW(pTLData, ((TYPELIB_DATA*)(tvi.lParam))->idl);
|
||||||
|
@ -881,7 +881,7 @@ static void AddIdlData(HTREEITEM hCur, TYPELIB_DATA *pTLData)
|
||||||
static void AddPredefinitions(HTREEITEM hFirst, TYPELIB_DATA *pTLData)
|
static void AddPredefinitions(HTREEITEM hFirst, TYPELIB_DATA *pTLData)
|
||||||
{
|
{
|
||||||
HTREEITEM hCur;
|
HTREEITEM hCur;
|
||||||
TVITEM tvi;
|
TVITEMW tvi;
|
||||||
WCHAR wszText[MAX_LOAD_STRING];
|
WCHAR wszText[MAX_LOAD_STRING];
|
||||||
WCHAR wszPredefinition[] = { '/','/',' ','T','L','i','b',' ',':','\n',
|
WCHAR wszPredefinition[] = { '/','/',' ','T','L','i','b',' ',':','\n',
|
||||||
'/','/',' ','F','o','r','w','a','r','d',' ','d','e','c','l','a','r','e',' ',
|
'/','/',' ','F','o','r','w','a','r','d',' ','d','e','c','l','a','r','e',' ',
|
||||||
|
@ -895,14 +895,14 @@ static void AddPredefinitions(HTREEITEM hFirst, TYPELIB_DATA *pTLData)
|
||||||
AddToTLDataStrW(pTLData, wszNewLine);
|
AddToTLDataStrW(pTLData, wszNewLine);
|
||||||
|
|
||||||
hCur = hFirst;
|
hCur = hFirst;
|
||||||
memset(&tvi, 0, sizeof(TVITEM));
|
memset(&tvi, 0, sizeof(TVITEMW));
|
||||||
tvi.mask = TVIF_TEXT|TVIF_PARAM;
|
tvi.mask = TVIF_TEXT|TVIF_PARAM;
|
||||||
tvi.cchTextMax = MAX_LOAD_STRING;
|
tvi.cchTextMax = MAX_LOAD_STRING;
|
||||||
tvi.pszText = wszText;
|
tvi.pszText = wszText;
|
||||||
while(hCur)
|
while(hCur)
|
||||||
{
|
{
|
||||||
tvi.hItem = hCur;
|
tvi.hItem = hCur;
|
||||||
SendMessage(typelib.hTree, TVM_GETITEM, 0, (LPARAM)&tvi);
|
SendMessageW(typelib.hTree, TVM_GETITEMW, 0, (LPARAM)&tvi);
|
||||||
if(((TYPELIB_DATA*)(tvi.lParam))->bPredefine &&
|
if(((TYPELIB_DATA*)(tvi.lParam))->bPredefine &&
|
||||||
!((TYPELIB_DATA*)(tvi.lParam))->bHide)
|
!((TYPELIB_DATA*)(tvi.lParam))->bHide)
|
||||||
{
|
{
|
||||||
|
@ -1137,8 +1137,8 @@ static void CreateCoclassHeader(ITypeInfo *pTypeInfo,
|
||||||
|
|
||||||
static int PopulateTree(void)
|
static int PopulateTree(void)
|
||||||
{
|
{
|
||||||
TVINSERTSTRUCT tvis;
|
TVINSERTSTRUCTW tvis;
|
||||||
TVITEM tvi;
|
TVITEMW tvi;
|
||||||
ITypeLib *pTypeLib;
|
ITypeLib *pTypeLib;
|
||||||
TLIBATTR *pTLibAttr;
|
TLIBATTR *pTLibAttr;
|
||||||
ITypeInfo *pTypeInfo, *pRefTypeInfo;
|
ITypeInfo *pTypeInfo, *pRefTypeInfo;
|
||||||
|
@ -1196,10 +1196,10 @@ static int PopulateTree(void)
|
||||||
WCHAR wszMessage[MAX_LOAD_STRING];
|
WCHAR wszMessage[MAX_LOAD_STRING];
|
||||||
WCHAR wszError[MAX_LOAD_STRING];
|
WCHAR wszError[MAX_LOAD_STRING];
|
||||||
|
|
||||||
LoadString(globals.hMainInst, IDS_ERROR_LOADTYPELIB,
|
LoadStringW(globals.hMainInst, IDS_ERROR_LOADTYPELIB,
|
||||||
wszError, sizeof(wszError)/sizeof(wszError[0]));
|
wszError, sizeof(wszError)/sizeof(wszError[0]));
|
||||||
wsprintfW(wszMessage, wszError, typelib.wszFileName, hRes);
|
wsprintfW(wszMessage, wszError, typelib.wszFileName, hRes);
|
||||||
MessageBox(globals.hMainWnd, wszMessage, NULL, MB_OK|MB_ICONEXCLAMATION);
|
MessageBoxW(globals.hMainWnd, wszMessage, NULL, MB_OK|MB_ICONEXCLAMATION);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
count = ITypeLib_GetTypeInfoCount(pTypeLib);
|
count = ITypeLib_GetTypeInfoCount(pTypeLib);
|
||||||
|
@ -1251,8 +1251,8 @@ static int PopulateTree(void)
|
||||||
wsprintfW(wszText, wszFormat, bstrName, bstrData);
|
wsprintfW(wszText, wszFormat, bstrName, bstrData);
|
||||||
SysFreeString(bstrName);
|
SysFreeString(bstrName);
|
||||||
SysFreeString(bstrData);
|
SysFreeString(bstrData);
|
||||||
tvis.hParent = (HTREEITEM)SendMessage(typelib.hTree,
|
tvis.hParent = (HTREEITEM)SendMessageW(typelib.hTree,
|
||||||
TVM_INSERTITEM, 0, (LPARAM)&tvis);
|
TVM_INSERTITEMW, 0, (LPARAM)&tvis);
|
||||||
|
|
||||||
for(i=0; i<count; i++)
|
for(i=0; i<count; i++)
|
||||||
{
|
{
|
||||||
|
@ -1284,7 +1284,7 @@ static int PopulateTree(void)
|
||||||
AddToStrW(tld->wszInsertAfter, wszNewLine);
|
AddToStrW(tld->wszInsertAfter, wszNewLine);
|
||||||
|
|
||||||
bInsert = FALSE;
|
bInsert = FALSE;
|
||||||
hParent = TreeView_InsertItem(typelib.hTree, &tvis);
|
hParent = TreeView_InsertItemW(typelib.hTree, &tvis);
|
||||||
EnumEnums(pTypeInfo, pTypeAttr->cVars, hParent);
|
EnumEnums(pTypeInfo, pTypeAttr->cVars, hParent);
|
||||||
AddChildrenData(hParent, tld);
|
AddChildrenData(hParent, tld);
|
||||||
AddToTLDataStrW(tld, tld->wszInsertAfter);
|
AddToTLDataStrW(tld, tld->wszInsertAfter);
|
||||||
|
@ -1336,7 +1336,7 @@ static int PopulateTree(void)
|
||||||
AddToStrW(tld->wszInsertAfter, wszNewLine);
|
AddToStrW(tld->wszInsertAfter, wszNewLine);
|
||||||
|
|
||||||
bInsert = FALSE;
|
bInsert = FALSE;
|
||||||
hParent = TreeView_InsertItem(typelib.hTree, &tvis);
|
hParent = TreeView_InsertItemW(typelib.hTree, &tvis);
|
||||||
AddToTLDataStrW(tld, tld->wszInsertAfter);
|
AddToTLDataStrW(tld, tld->wszInsertAfter);
|
||||||
break;
|
break;
|
||||||
case TKIND_UNION:
|
case TKIND_UNION:
|
||||||
|
@ -1352,7 +1352,7 @@ static int PopulateTree(void)
|
||||||
AddToStrW(wszText, wszTKIND_DISPATCH);
|
AddToStrW(wszText, wszTKIND_DISPATCH);
|
||||||
AddToStrW(wszText, bstrName);
|
AddToStrW(wszText, bstrName);
|
||||||
|
|
||||||
hParent = TreeView_InsertItem(typelib.hTree, &tvis);
|
hParent = TreeView_InsertItemW(typelib.hTree, &tvis);
|
||||||
hMain = tvis.hParent;
|
hMain = tvis.hParent;
|
||||||
tldDispatch = tld;
|
tldDispatch = tld;
|
||||||
|
|
||||||
|
@ -1363,7 +1363,7 @@ static int PopulateTree(void)
|
||||||
AddToTLDataStrW(tld, wszProperties);
|
AddToTLDataStrW(tld, wszProperties);
|
||||||
AddToTLDataStrW(tld, wszColon);
|
AddToTLDataStrW(tld, wszColon);
|
||||||
AddToTLDataStrW(tld, wszNewLine);
|
AddToTLDataStrW(tld, wszNewLine);
|
||||||
tvis.hParent = TreeView_InsertItem(typelib.hTree, &tvis);
|
tvis.hParent = TreeView_InsertItemW(typelib.hTree, &tvis);
|
||||||
EnumVars(pTypeInfo, pTypeAttr->cVars, tvis.hParent);
|
EnumVars(pTypeInfo, pTypeAttr->cVars, tvis.hParent);
|
||||||
AddChildrenData(tvis.hParent, tld);
|
AddChildrenData(tvis.hParent, tld);
|
||||||
|
|
||||||
|
@ -1374,7 +1374,7 @@ static int PopulateTree(void)
|
||||||
AddToTLDataStrW(tld, wszMethods);
|
AddToTLDataStrW(tld, wszMethods);
|
||||||
AddToTLDataStrW(tld, wszColon);
|
AddToTLDataStrW(tld, wszColon);
|
||||||
AddToTLDataStrW(tld, wszNewLine);
|
AddToTLDataStrW(tld, wszNewLine);
|
||||||
tvis.hParent = TreeView_InsertItem(typelib.hTree, &tvis);
|
tvis.hParent = TreeView_InsertItemW(typelib.hTree, &tvis);
|
||||||
EnumFuncs(pTypeInfo, pTypeAttr, tvis.hParent);
|
EnumFuncs(pTypeInfo, pTypeAttr, tvis.hParent);
|
||||||
AddChildrenData(tvis.hParent, tld);
|
AddChildrenData(tvis.hParent, tld);
|
||||||
|
|
||||||
|
@ -1431,7 +1431,7 @@ static int PopulateTree(void)
|
||||||
|
|
||||||
if(bInsert)
|
if(bInsert)
|
||||||
{
|
{
|
||||||
hParent = TreeView_InsertItem(typelib.hTree, &tvis);
|
hParent = TreeView_InsertItemW(typelib.hTree, &tvis);
|
||||||
|
|
||||||
EnumVars(pTypeInfo, pTypeAttr->cVars, hParent);
|
EnumVars(pTypeInfo, pTypeAttr->cVars, hParent);
|
||||||
EnumFuncs(pTypeInfo, pTypeAttr, hParent);
|
EnumFuncs(pTypeInfo, pTypeAttr, hParent);
|
||||||
|
@ -1447,13 +1447,13 @@ static int PopulateTree(void)
|
||||||
SysFreeString(bstrName);
|
SysFreeString(bstrName);
|
||||||
SysFreeString(bstrData);
|
SysFreeString(bstrData);
|
||||||
}
|
}
|
||||||
SendMessage(typelib.hTree, TVM_EXPAND, TVE_EXPAND, (LPARAM)tvis.hParent);
|
SendMessageW(typelib.hTree, TVM_EXPAND, TVE_EXPAND, (LPARAM)tvis.hParent);
|
||||||
|
|
||||||
memset(&tvi, 0, sizeof(TVITEM));
|
memset(&tvi, 0, sizeof(TVITEMW));
|
||||||
tvi.mask = TVIF_PARAM;
|
tvi.mask = TVIF_PARAM;
|
||||||
tvi.hItem = tvis.hParent;
|
tvi.hItem = tvis.hParent;
|
||||||
|
|
||||||
SendMessage(typelib.hTree, TVM_GETITEM, 0, (LPARAM)&tvi);
|
SendMessageW(typelib.hTree, TVM_GETITEMW, 0, (LPARAM)&tvi);
|
||||||
AddPredefinitions(tvi.hItem, (TYPELIB_DATA*)(tvi.lParam));
|
AddPredefinitions(tvi.hItem, (TYPELIB_DATA*)(tvi.lParam));
|
||||||
AddIdlData(tvi.hItem, (TYPELIB_DATA*)(tvi.lParam));
|
AddIdlData(tvi.hItem, (TYPELIB_DATA*)(tvi.lParam));
|
||||||
AddToTLDataStrW((TYPELIB_DATA*)(tvi.lParam),
|
AddToTLDataStrW((TYPELIB_DATA*)(tvi.lParam),
|
||||||
|
@ -1465,20 +1465,20 @@ static int PopulateTree(void)
|
||||||
|
|
||||||
void UpdateData(HTREEITEM item)
|
void UpdateData(HTREEITEM item)
|
||||||
{
|
{
|
||||||
TVITEM tvi;
|
TVITEMW tvi;
|
||||||
|
|
||||||
memset(&tvi, 0, sizeof(TVITEM));
|
memset(&tvi, 0, sizeof(TVITEMW));
|
||||||
tvi.mask = TVIF_PARAM;
|
tvi.mask = TVIF_PARAM;
|
||||||
tvi.hItem = item;
|
tvi.hItem = item;
|
||||||
|
|
||||||
SendMessage(typelib.hTree, TVM_GETITEM, 0, (LPARAM)&tvi);
|
SendMessageW(typelib.hTree, TVM_GETITEMW, 0, (LPARAM)&tvi);
|
||||||
if(!tvi.lParam)
|
if(!tvi.lParam)
|
||||||
{
|
{
|
||||||
SetWindowText(typelib.hEdit, wszSpace);
|
SetWindowTextW(typelib.hEdit, wszSpace);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
SetWindowText(typelib.hEdit, ((TYPELIB_DATA*)tvi.lParam)->idl);
|
SetWindowTextW(typelib.hEdit, ((TYPELIB_DATA*)tvi.lParam)->idl);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void TypeLibResizeChild(void)
|
static void TypeLibResizeChild(void)
|
||||||
|
@ -1522,16 +1522,16 @@ static void UpdateTypeLibStatusBar(int itemID)
|
||||||
{
|
{
|
||||||
WCHAR info[MAX_LOAD_STRING];
|
WCHAR info[MAX_LOAD_STRING];
|
||||||
|
|
||||||
if(!LoadString(globals.hMainInst, itemID, info, sizeof(info)/sizeof(info[0])))
|
if(!LoadStringW(globals.hMainInst, itemID, info, sizeof(info)/sizeof(info[0])))
|
||||||
LoadString(globals.hMainInst, IDS_READY, info, sizeof(info)/sizeof(info[0]));
|
LoadStringW(globals.hMainInst, IDS_READY, info, sizeof(info)/sizeof(info[0]));
|
||||||
|
|
||||||
SendMessage(typelib.hStatusBar, SB_SETTEXT, 0, (LPARAM)info);
|
SendMessageW(typelib.hStatusBar, SB_SETTEXTW, 0, (LPARAM)info);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void EmptyTLTree(void)
|
static void EmptyTLTree(void)
|
||||||
{
|
{
|
||||||
HTREEITEM cur, del;
|
HTREEITEM cur, del;
|
||||||
TVITEM tvi;
|
TVITEMW tvi;
|
||||||
|
|
||||||
tvi.mask = TVIF_PARAM;
|
tvi.mask = TVIF_PARAM;
|
||||||
cur = (HTREEITEM)SendMessageW(typelib.hTree, TVM_GETNEXTITEM,
|
cur = (HTREEITEM)SendMessageW(typelib.hTree, TVM_GETNEXTITEM,
|
||||||
|
@ -1549,14 +1549,14 @@ static void EmptyTLTree(void)
|
||||||
TVM_GETNEXTITEM, TVGN_PARENT, (LPARAM)del);
|
TVM_GETNEXTITEM, TVGN_PARENT, (LPARAM)del);
|
||||||
|
|
||||||
tvi.hItem = del;
|
tvi.hItem = del;
|
||||||
SendMessage(typelib.hTree, TVM_GETITEM, 0, (LPARAM)&tvi);
|
SendMessageW(typelib.hTree, TVM_GETITEMW, 0, (LPARAM)&tvi);
|
||||||
if(tvi.lParam)
|
if(tvi.lParam)
|
||||||
{
|
{
|
||||||
HeapFree(GetProcessHeap(), 0, ((TYPELIB_DATA *)tvi.lParam)->idl);
|
HeapFree(GetProcessHeap(), 0, ((TYPELIB_DATA *)tvi.lParam)->idl);
|
||||||
HeapFree(GetProcessHeap(), 0, (TYPELIB_DATA *)tvi.lParam);
|
HeapFree(GetProcessHeap(), 0, (TYPELIB_DATA *)tvi.lParam);
|
||||||
}
|
}
|
||||||
|
|
||||||
SendMessage(typelib.hTree, TVM_DELETEITEM, 0, (LPARAM)del);
|
SendMessageW(typelib.hTree, TVM_DELETEITEM, 0, (LPARAM)del);
|
||||||
|
|
||||||
if(!cur) break;
|
if(!cur) break;
|
||||||
}
|
}
|
||||||
|
@ -1570,11 +1570,11 @@ static LRESULT CALLBACK TypeLibProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM
|
||||||
{
|
{
|
||||||
if(!CreatePanedWindow(hWnd, &typelib.hPaneWnd, globals.hMainInst))
|
if(!CreatePanedWindow(hWnd, &typelib.hPaneWnd, globals.hMainInst))
|
||||||
DestroyWindow(hWnd);
|
DestroyWindow(hWnd);
|
||||||
typelib.hTree = CreateWindowEx(WS_EX_CLIENTEDGE, WC_TREEVIEW, NULL,
|
typelib.hTree = CreateWindowExW(WS_EX_CLIENTEDGE, WC_TREEVIEWW, NULL,
|
||||||
WS_CHILD|WS_VISIBLE|TVS_HASLINES|TVS_HASBUTTONS|TVS_LINESATROOT,
|
WS_CHILD|WS_VISIBLE|TVS_HASLINES|TVS_HASBUTTONS|TVS_LINESATROOT,
|
||||||
0, 0, 0, 0, typelib.hPaneWnd, (HMENU)TYPELIB_TREE,
|
0, 0, 0, 0, typelib.hPaneWnd, (HMENU)TYPELIB_TREE,
|
||||||
globals.hMainInst, NULL);
|
globals.hMainInst, NULL);
|
||||||
typelib.hEdit = CreateWindowEx(WS_EX_CLIENTEDGE, WC_EDIT, NULL,
|
typelib.hEdit = CreateWindowExW(WS_EX_CLIENTEDGE, WC_EDITW, NULL,
|
||||||
WS_CHILD|WS_VISIBLE|ES_MULTILINE|ES_READONLY|WS_HSCROLL|WS_VSCROLL,
|
WS_CHILD|WS_VISIBLE|ES_MULTILINE|ES_READONLY|WS_HSCROLL|WS_VSCROLL,
|
||||||
0, 0, 0, 0, typelib.hPaneWnd, NULL, globals.hMainInst, NULL);
|
0, 0, 0, 0, typelib.hPaneWnd, NULL, globals.hMainInst, NULL);
|
||||||
|
|
||||||
|
@ -1601,22 +1601,22 @@ static LRESULT CALLBACK TypeLibProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM
|
||||||
EmptyTLTree();
|
EmptyTLTree();
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
return DefWindowProc(hWnd, uMsg, wParam, lParam);
|
return DefWindowProcW(hWnd, uMsg, wParam, lParam);
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
BOOL TypeLibRegisterClass(void)
|
BOOL TypeLibRegisterClassW(void)
|
||||||
{
|
{
|
||||||
WNDCLASS wcc;
|
WNDCLASSW wcc;
|
||||||
|
|
||||||
memset(&wcc, 0, sizeof(WNDCLASS));
|
memset(&wcc, 0, sizeof(WNDCLASSW));
|
||||||
wcc.lpfnWndProc = TypeLibProc;
|
wcc.lpfnWndProc = TypeLibProc;
|
||||||
wcc.hbrBackground = (HBRUSH)(COLOR_WINDOW+1);
|
wcc.hbrBackground = (HBRUSH)(COLOR_WINDOW+1);
|
||||||
wcc.lpszMenuName = MAKEINTRESOURCE(IDM_TYPELIB);
|
wcc.lpszMenuName = MAKEINTRESOURCEW(IDM_TYPELIB);
|
||||||
wcc.lpszClassName = wszTypeLib;
|
wcc.lpszClassName = wszTypeLib;
|
||||||
|
|
||||||
if(!RegisterClass(&wcc))
|
if(!RegisterClassW(&wcc))
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
@ -1625,27 +1625,27 @@ BOOL TypeLibRegisterClass(void)
|
||||||
BOOL CreateTypeLibWindow(HINSTANCE hInst, WCHAR *wszFileName)
|
BOOL CreateTypeLibWindow(HINSTANCE hInst, WCHAR *wszFileName)
|
||||||
{
|
{
|
||||||
WCHAR wszTitle[MAX_LOAD_STRING];
|
WCHAR wszTitle[MAX_LOAD_STRING];
|
||||||
LoadString(hInst, IDS_TYPELIBTITLE, wszTitle, sizeof(wszTitle)/sizeof(wszTitle[0]));
|
LoadStringW(hInst, IDS_TYPELIBTITLE, wszTitle, sizeof(wszTitle)/sizeof(wszTitle[0]));
|
||||||
|
|
||||||
if(wszFileName) lstrcpyW(typelib.wszFileName, wszFileName);
|
if(wszFileName) lstrcpyW(typelib.wszFileName, wszFileName);
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
TVITEM tvi;
|
TVITEMW tvi;
|
||||||
|
|
||||||
memset(&tvi, 0, sizeof(TVITEM));
|
memset(&tvi, 0, sizeof(TVITEMW));
|
||||||
tvi.hItem = (HTREEITEM)SendMessageW(globals.hTree, TVM_GETNEXTITEM,
|
tvi.hItem = (HTREEITEM)SendMessageW(globals.hTree, TVM_GETNEXTITEM,
|
||||||
TVGN_CARET, 0);
|
TVGN_CARET, 0);
|
||||||
|
|
||||||
SendMessage(globals.hTree, TVM_GETITEM, 0, (LPARAM)&tvi);
|
SendMessageW(globals.hTree, TVM_GETITEMW, 0, (LPARAM)&tvi);
|
||||||
lstrcpyW(typelib.wszFileName, ((ITEM_INFO*)tvi.lParam)->path);
|
lstrcpyW(typelib.wszFileName, ((ITEM_INFO*)tvi.lParam)->path);
|
||||||
}
|
}
|
||||||
|
|
||||||
globals.hTypeLibWnd = CreateWindow(wszTypeLib, wszTitle,
|
globals.hTypeLibWnd = CreateWindowW(wszTypeLib, wszTitle,
|
||||||
WS_OVERLAPPEDWINDOW|WS_VISIBLE,
|
WS_OVERLAPPEDWINDOW|WS_VISIBLE,
|
||||||
CW_USEDEFAULT, CW_USEDEFAULT, 800, 600, NULL, NULL, hInst, NULL);
|
CW_USEDEFAULT, CW_USEDEFAULT, 800, 600, NULL, NULL, hInst, NULL);
|
||||||
if(!globals.hTypeLibWnd) return FALSE;
|
if(!globals.hTypeLibWnd) return FALSE;
|
||||||
|
|
||||||
typelib.hStatusBar = CreateStatusWindow(WS_VISIBLE|WS_CHILD,
|
typelib.hStatusBar = CreateStatusWindowW(WS_VISIBLE|WS_CHILD,
|
||||||
wszTitle, globals.hTypeLibWnd, 0);
|
wszTitle, globals.hTypeLibWnd, 0);
|
||||||
|
|
||||||
TypeLibResizeChild();
|
TypeLibResizeChild();
|
||||||
|
|
Loading…
Reference in New Issue