Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-cw
Commits
ecd514d5
Commit
ecd514d5
authored
Jul 02, 2006
by
Piotr Caban
Committed by
Alexandre Julliard
Jul 03, 2006
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
oleview: Added open TypeLib file functionality.
parent
fa7e97e8
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
56 additions
and
11 deletions
+56
-11
En.rc
programs/oleview/En.rc
+1
-0
Makefile.in
programs/oleview/Makefile.in
+1
-1
main.h
programs/oleview/main.h
+2
-1
oleview.c
programs/oleview/oleview.c
+35
-1
resource.h
programs/oleview/resource.h
+2
-0
typelib.c
programs/oleview/typelib.c
+15
-8
No files found.
programs/oleview/En.rc
View file @
ecd514d5
...
...
@@ -95,6 +95,7 @@ STRINGTABLE
IDS_ABOUT "OleView - OLE/COM Object Viewer"
IDS_ABOUTVER "version 1.0"
IDS_TYPELIBTITLE "ITypeLib viewer"
IDS_OPEN "Open"
IDM_BIND, "Bind to file via a File Moniker"
IDM_TYPELIB, "Open a TypeLib file and view the contents"
...
...
programs/oleview/Makefile.in
View file @
ecd514d5
...
...
@@ -4,7 +4,7 @@ SRCDIR = @srcdir@
VPATH
=
@srcdir@
MODULE
=
oleview.exe
APPMODE
=
-mwindows
-municode
IMPORTS
=
comctl32 shell32 oleaut32 ole32 user32 advapi32 kernel32
IMPORTS
=
com
dlg32 com
ctl32 shell32 oleaut32 ole32 user32 advapi32 kernel32
EXTRALIBS
=
-luuid
EXTRADEFS
=
-DUNICODE
...
...
programs/oleview/main.h
View file @
ecd514d5
...
...
@@ -108,6 +108,7 @@ typedef struct
HWND
hTree
;
HWND
hEdit
;
HWND
hStatusBar
;
WCHAR
wszFileName
[
MAX_LOAD_STRING
];
}
TYPELIB
;
extern
GLOBALS
globals
;
...
...
@@ -138,7 +139,7 @@ void CreateInst(HTREEITEM item, WCHAR *wszMachineName);
void
ReleaseInst
(
HTREEITEM
item
);
/* typelib.c */
BOOL
CreateTypeLibWindow
(
HINSTANCE
hInst
);
BOOL
CreateTypeLibWindow
(
HINSTANCE
hInst
,
WCHAR
*
wszFileName
);
BOOL
TypeLibRegisterClass
(
void
);
/* interface.c */
...
...
programs/oleview/oleview.c
View file @
ecd514d5
...
...
@@ -25,6 +25,13 @@ static WCHAR wszRegEdit[] = { 'r','e','g','e','d','i','t','.','e','x','e','\0' }
static
WCHAR
wszFormat
[]
=
{
'<'
,
'o'
,
'b'
,
'j'
,
'e'
,
'c'
,
't'
,
'\n'
,
' '
,
' '
,
' '
,
'c'
,
'l'
,
'a'
,
's'
,
's'
,
'i'
,
'd'
,
'='
,
'\"'
,
'c'
,
'l'
,
's'
,
'i'
,
'd'
,
':'
,
'%'
,
's'
,
'\"'
,
'\n'
,
'>'
,
'\n'
,
'<'
,
'/'
,
'o'
,
'b'
,
'j'
,
'e'
,
'c'
,
't'
,
'>'
,
'\0'
};
WCHAR
wszFilter
[]
=
{
'T'
,
'y'
,
'p'
,
'e'
,
'L'
,
'i'
,
'b'
,
' '
,
'F'
,
'i'
,
'l'
,
'e'
,
's'
,
' '
,
'('
,
'*'
,
't'
,
'l'
,
'b'
,
';'
,
'*'
,
'o'
,
'l'
,
'b'
,
';'
,
'*'
,
'.'
,
'd'
,
'l'
,
'l'
,
';'
,
'*'
,
'.'
,
'o'
,
'c'
,
'x'
,
';'
,
'*'
,
'.'
,
'e'
,
'x'
,
'e'
,
')'
,
'\0'
,
'*'
,
'.'
,
't'
,
'l'
,
'b'
,
';'
,
'*'
,
'.'
,
'o'
,
'l'
,
'b'
,
';'
,
'*'
,
'.'
,
'd'
,
'l'
,
'l'
,
';'
,
'*'
,
'.'
,
'o'
,
'c'
,
'x'
,
'*'
,
'.'
,
'e'
,
'x'
,
'e'
,
'\0'
,
'A'
,
'l'
,
'l'
,
' '
,
'F'
,
'i'
,
'l'
,
'e'
,
's'
,
' '
,
'('
,
'*'
,
'.'
,
'*'
,
')'
,
'\0'
,
'*'
,
'.'
,
'*'
,
'\0'
,
'\0'
};
INT_PTR
CALLBACK
SysConfProc
(
HWND
hDlgWnd
,
UINT
uMsg
,
WPARAM
wParam
,
LPARAM
lParam
)
{
...
...
@@ -124,6 +131,22 @@ INT_PTR CALLBACK CreateInstOnProc(HWND hDlgWnd, UINT uMsg, WPARAM wParam, LPARAM
return
FALSE
;
}
void
InitOpenFileName
(
HWND
hWnd
,
OPENFILENAME
*
pofn
,
WCHAR
*
wszFilter
,
WCHAR
*
wszTitle
,
WCHAR
*
wszFileName
)
{
memset
(
pofn
,
0
,
sizeof
(
OPENFILENAME
));
pofn
->
lStructSize
=
sizeof
(
OPENFILENAME
);
pofn
->
hwndOwner
=
hWnd
;
pofn
->
hInstance
=
globals
.
hMainInst
;
pofn
->
lpstrTitle
=
wszTitle
;
pofn
->
lpstrFilter
=
wszFilter
;
pofn
->
nFilterIndex
=
0
;
pofn
->
lpstrFile
=
wszFileName
;
pofn
->
nMaxFile
=
MAX_LOAD_STRING
;
pofn
->
Flags
=
OFN_HIDEREADONLY
;
}
void
CopyClsid
(
HTREEITEM
item
)
{
TVITEM
tvi
;
...
...
@@ -380,10 +403,21 @@ int MenuCommand(WPARAM wParam, HWND hWnd)
vis
?
MF_UNCHECKED
:
MF_CHECKED
);
ResizeChild
();
break
;
case
IDM_TYPELIB
:
{
OPENFILENAME
ofn
;
static
WCHAR
wszTitle
[
MAX_LOAD_STRING
];
static
WCHAR
wszName
[
MAX_LOAD_STRING
];
LoadString
(
globals
.
hMainInst
,
IDS_OPEN
,
wszTitle
,
sizeof
(
wszTitle
));
InitOpenFileName
(
hWnd
,
&
ofn
,
wszFilter
,
wszTitle
,
wszName
);
if
(
GetOpenFileName
(
&
ofn
))
CreateTypeLibWindow
(
globals
.
hMainInst
,
wszName
);
break
;
}
case
IDM_VIEW
:
hSelect
=
TreeView_GetSelection
(
globals
.
hTree
);
if
(
IsInterface
(
hSelect
))
InterfaceViewer
(
hSelect
);
else
CreateTypeLibWindow
(
globals
.
hMainInst
);
else
CreateTypeLibWindow
(
globals
.
hMainInst
,
NULL
);
break
;
case
IDM_EXIT
:
DestroyWindow
(
hWnd
);
...
...
programs/oleview/resource.h
View file @
ecd514d5
...
...
@@ -29,6 +29,8 @@
#define IDS_ABOUT 20
#define IDS_ABOUTVER 21
#define IDS_OPEN 30
#define IDM_BIND 100
#define IDM_TYPELIB 101
#define IDM_SYSCONF 102
...
...
programs/oleview/typelib.c
View file @
ecd514d5
...
...
@@ -30,7 +30,6 @@ void AddToStrW(WCHAR *wszDest, const WCHAR *wszSource)
int
PopulateTree
(
void
)
{
TVITEM
tvi
;
TVINSERTSTRUCT
tvis
;
ITypeLib
*
pTypeLib
;
ITypeInfo
*
pTypeInfo
,
*
pRefTypeInfo
;
...
...
@@ -64,9 +63,6 @@ int PopulateTree(void)
const
WCHAR
wszVT_BSTR
[]
=
{
'B'
,
'S'
,
'T'
,
'R'
,
' '
,
'\0'
};
const
WCHAR
wszVT_CY
[]
=
{
'C'
,
'U'
,
'R'
,
'R'
,
'E'
,
'N'
,
'C'
,
'Y'
,
' '
,
'\0'
};
memset
(
&
tvi
,
0
,
sizeof
(
TVITEM
));
tvi
.
hItem
=
TreeView_GetSelection
(
globals
.
hTree
);
U
(
tvis
).
item
.
mask
=
TVIF_TEXT
|
TVIF_CHILDREN
;
U
(
tvis
).
item
.
cchTextMax
=
MAX_LOAD_STRING
;
U
(
tvis
).
item
.
pszText
=
wszText
;
...
...
@@ -74,15 +70,14 @@ int PopulateTree(void)
tvis
.
hInsertAfter
=
(
HTREEITEM
)
TVI_LAST
;
tvis
.
hParent
=
TVI_ROOT
;
SendMessage
(
globals
.
hTree
,
TVM_GETITEM
,
0
,
(
LPARAM
)
&
tvi
);
if
(
FAILED
((
hRes
=
LoadTypeLib
(((
ITEM_INFO
*
)
tvi
.
lParam
)
->
path
,
&
pTypeLib
))))
if
(
FAILED
((
hRes
=
LoadTypeLib
(
typelib
.
wszFileName
,
&
pTypeLib
))))
{
WCHAR
wszMessage
[
MAX_LOAD_STRING
];
WCHAR
wszError
[
MAX_LOAD_STRING
];
LoadString
(
globals
.
hMainInst
,
IDS_ERROR_LOADTYPELIB
,
wszError
,
sizeof
(
WCHAR
[
MAX_LOAD_STRING
]));
wsprintfW
(
wszMessage
,
wszError
,
((
ITEM_INFO
*
)
tvi
.
lParam
)
->
path
,
hRes
);
wsprintfW
(
wszMessage
,
wszError
,
typelib
.
wszFileName
,
hRes
);
MessageBox
(
globals
.
hMainWnd
,
wszMessage
,
NULL
,
MB_OK
|
MB_ICONEXCLAMATION
);
return
1
;
}
...
...
@@ -261,11 +256,23 @@ BOOL TypeLibRegisterClass(void)
return
TRUE
;
}
BOOL
CreateTypeLibWindow
(
HINSTANCE
hInst
)
BOOL
CreateTypeLibWindow
(
HINSTANCE
hInst
,
WCHAR
*
wszFileName
)
{
WCHAR
wszTitle
[
MAX_LOAD_STRING
];
LoadString
(
hInst
,
IDS_TYPELIBTITLE
,
wszTitle
,
sizeof
(
WCHAR
[
MAX_LOAD_STRING
]));
if
(
wszFileName
)
lstrcpyW
(
typelib
.
wszFileName
,
wszFileName
);
else
{
TVITEM
tvi
;
memset
(
&
tvi
,
0
,
sizeof
(
TVITEM
));
tvi
.
hItem
=
TreeView_GetSelection
(
globals
.
hTree
);
SendMessage
(
globals
.
hTree
,
TVM_GETITEM
,
0
,
(
LPARAM
)
&
tvi
);
lstrcpyW
(
typelib
.
wszFileName
,
((
ITEM_INFO
*
)
tvi
.
lParam
)
->
path
);
}
globals
.
hTypeLibWnd
=
CreateWindow
(
wszTypeLib
,
wszTitle
,
WS_OVERLAPPEDWINDOW
|
WS_VISIBLE
,
CW_USEDEFAULT
,
CW_USEDEFAULT
,
800
,
600
,
NULL
,
NULL
,
hInst
,
NULL
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment