Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
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-winehq
Commits
b2d91368
Commit
b2d91368
authored
Jun 22, 2006
by
Piotr Caban
Committed by
Alexandre Julliard
Jun 23, 2006
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
oleview: Added CreateInstanceOn functionality.
parent
566beb78
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
69 additions
and
5 deletions
+69
-5
En.rc
programs/oleview/En.rc
+11
-0
main.h
programs/oleview/main.h
+2
-1
oleview.c
programs/oleview/oleview.c
+34
-1
resource.h
programs/oleview/resource.h
+3
-0
tree.c
programs/oleview/tree.c
+19
-3
No files found.
programs/oleview/En.rc
View file @
b2d91368
...
...
@@ -117,3 +117,14 @@ STRINGTABLE
IDS_CGCOFAIL, "CoGetClassObject failed."
IDS_ERROR_UNKN, "Unknown error"
}
DLG_CREATEINSTON DIALOG DISCARDABLE 0, 0, 250, 41
STYLE DS_MODALFRAME | DS_NOIDLEMSG | WS_CAPTION | WS_SYSMENU
CAPTION "Connect to another machine"
FONT 8, "MS Shell Dlg"
{
LTEXT "&Machine name:", IDIGNORE, 5, 6, 190, 8
EDITTEXT IDC_MACHINE, 5, 16, 190, 12, WS_BORDER | WS_TABSTOP | ES_AUTOHSCROLL
DEFPUSHBUTTON "&OK", IDOK, 200, 5, 45, 14
PUSHBUTTON "&Cancel", IDCANCEL, 200, 22, 45, 14
}
programs/oleview/main.h
View file @
b2d91368
...
...
@@ -51,6 +51,7 @@ typedef struct
HINSTANCE
hMainInst
;
BOOL
bExpert
;
DWORD
dwClsCtx
;
WCHAR
wszMachineName
[
MAX_LOAD_STRING
];
}
GLOBALS
;
typedef
struct
...
...
@@ -115,5 +116,5 @@ void AddTreeEx(void);
void
AddTree
(
void
);
HWND
CreateTreeWindow
(
HINSTANCE
hInst
);
BOOL
CreateRegPath
(
HTREEITEM
item
,
WCHAR
*
buffer
,
int
bufSize
);
void
CreateInst
(
HTREEITEM
item
);
void
CreateInst
(
HTREEITEM
item
,
WCHAR
*
wszMachineName
);
void
ReleaseInst
(
HTREEITEM
item
);
programs/oleview/oleview.c
View file @
b2d91368
...
...
@@ -23,6 +23,32 @@
GLOBALS
globals
;
static
WCHAR
wszRegEdit
[]
=
{
'r'
,
'e'
,
'g'
,
'e'
,
'd'
,
'i'
,
't'
,
'.'
,
'e'
,
'x'
,
'e'
,
'\0'
};
INT_PTR
CALLBACK
CreateInstOnProc
(
HWND
hDlgWnd
,
UINT
uMsg
,
WPARAM
wParam
,
LPARAM
lParam
)
{
HWND
hEdit
;
switch
(
uMsg
)
{
case
WM_COMMAND
:
switch
(
LOWORD
(
wParam
))
{
case
IDOK
:
memset
(
globals
.
wszMachineName
,
0
,
sizeof
(
WCHAR
[
MAX_LOAD_STRING
]));
hEdit
=
GetDlgItem
(
hDlgWnd
,
IDC_MACHINE
);
if
(
GetWindowTextLength
(
hEdit
)
>
0
)
GetWindowText
(
hEdit
,
globals
.
wszMachineName
,
MAX_LOAD_STRING
);
EndDialog
(
hDlgWnd
,
IDOK
);
return
TRUE
;
case
IDCANCEL
:
EndDialog
(
hDlgWnd
,
IDCANCEL
);
return
TRUE
;
}
}
return
FALSE
;
}
void
ResizeChild
(
void
)
{
RECT
client
,
stat
,
tool
;
...
...
@@ -125,7 +151,14 @@ int MenuCommand(WPARAM wParam, HWND hWnd)
break
;
case
IDM_CREATEINST
:
hSelect
=
TreeView_GetSelection
(
globals
.
hTree
);
CreateInst
(
hSelect
);
CreateInst
(
hSelect
,
NULL
);
SendMessage
(
globals
.
hTree
,
TVM_EXPAND
,
TVE_EXPAND
,
(
LPARAM
)
hSelect
);
break
;
case
IDM_CREATEINSTON
:
if
(
DialogBox
(
0
,
MAKEINTRESOURCE
(
DLG_CREATEINSTON
),
hWnd
,
CreateInstOnProc
)
==
IDCANCEL
)
break
;
hSelect
=
TreeView_GetSelection
(
globals
.
hTree
);
CreateInst
(
hSelect
,
globals
.
wszMachineName
);
SendMessage
(
globals
.
hTree
,
TVM_EXPAND
,
TVE_EXPAND
,
(
LPARAM
)
hSelect
);
break
;
case
IDM_RELEASEINST
:
...
...
programs/oleview/resource.h
View file @
b2d91368
...
...
@@ -67,3 +67,6 @@
#define IDS_CGCOFAIL 300
#define IDS_ERROR_UNKN 301
#define DLG_CREATEINSTON 1000
#define IDC_MACHINE 1001
programs/oleview/tree.c
View file @
b2d91368
...
...
@@ -50,7 +50,7 @@ LPARAM CreateITEM_INFO(INT flag, const WCHAR *info, const WCHAR *clsid)
return
(
LPARAM
)
reg
;
}
void
CreateInst
(
HTREEITEM
item
)
void
CreateInst
(
HTREEITEM
item
,
WCHAR
*
wszMachineName
)
{
TVITEM
tvi
;
HTREEITEM
hCur
;
...
...
@@ -62,6 +62,8 @@ void CreateInst(HTREEITEM item)
WCHAR
wszRegPath
[
MAX_LOAD_STRING
];
const
WCHAR
wszFormat
[]
=
{
'\n'
,
'%'
,
's'
,
' '
,
'('
,
'$'
,
'%'
,
'x'
,
')'
,
'\n'
,
'\0'
};
CLSID
clsid
;
COSERVERINFO
remoteInfo
;
MULTI_QI
qi
;
IUnknown
*
obj
,
*
unk
;
HRESULT
hRes
;
...
...
@@ -86,7 +88,21 @@ void CreateInst(HTREEITEM item)
if
(
FAILED
(
CLSIDFromString
(((
ITEM_INFO
*
)
tvi
.
lParam
)
->
clsid
,
&
clsid
)))
return
;
hRes
=
CoCreateInstance
(
&
clsid
,
NULL
,
globals
.
dwClsCtx
,
if
(
wszMachineName
)
{
remoteInfo
.
dwReserved1
=
0
;
remoteInfo
.
dwReserved2
=
0
;
remoteInfo
.
pAuthInfo
=
NULL
;
remoteInfo
.
pwszName
=
wszMachineName
;
qi
.
pIID
=
&
IID_IUnknown
;
CoCreateInstanceEx
(
&
clsid
,
NULL
,
globals
.
dwClsCtx
|
CLSCTX_REMOTE_SERVER
,
&
remoteInfo
,
1
,
&
qi
);
hRes
=
qi
.
hr
;
obj
=
qi
.
pItf
;
}
else
hRes
=
CoCreateInstance
(
&
clsid
,
NULL
,
globals
.
dwClsCtx
,
&
IID_IUnknown
,
(
void
**
)
&
obj
);
if
(
FAILED
(
hRes
))
...
...
@@ -637,7 +653,7 @@ LRESULT CALLBACK TreeProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
switch
(((
LPNMHDR
)
lParam
)
->
code
)
{
case
TVN_ITEMEXPANDING
:
CreateInst
(((
NMTREEVIEW
*
)
lParam
)
->
itemNew
.
hItem
);
CreateInst
(((
NMTREEVIEW
*
)
lParam
)
->
itemNew
.
hItem
,
NULL
);
break
;
case
TVN_SELCHANGED
:
RefreshMenu
(((
NMTREEVIEW
*
)
lParam
)
->
itemNew
.
hItem
);
...
...
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