ReactOS 0.4.15-dev-5666-gc548b97
atliface.idl File Reference

Go to the source code of this file.

Classes

class  IRegistrarBase
 
interface  IRegistrar
 
interface  IDocHostUIHandlerDispatch
 
interface  IAxWinAmbientDispatch
 
interface  IAxWinAmbientDispatchEx
 

Functions

 DEFINE_GUID (CLSID_Registrar, 0x44ec053a, 0x400f, 0x11d0, 0x9d, 0xcd, 0x00, 0xa0, 0xc9, 0x03, 0x91, 0xd3)
 
HRESULT WINAPI AtlAxCreateControl (LPCOLESTR, HWND, IStream *, IUnknown **)
 
HRESULT WINAPI AtlAxCreateControlEx (LPCOLESTR, HWND, IStream *, IUnknown **, IUnknown **, REFIID, IUnknown *)
 
HRESULT WINAPI AtlAxCreateControlLic (LPCOLESTR, HWND, IStream *, IUnknown **, BSTR)
 
HRESULT WINAPI AtlAxCreateControlLicEx (LPCOLESTR, HWND, IStream *, IUnknown **, IUnknown **, REFIID, IUnknown *, BSTR)
 
BOOL WINAPI AtlAxWinInit (void)
 
HRESULT WINAPI AtlAxGetControl (HWND, IUnknown **)
 
HRESULT WINAPI AtlAxGetHost (HWND, IUnknown **)
 
HWND WINAPI AtlAxCreateDialogW (HINSTANCE, LPCWSTR, HWND, DLGPROC, LPARAM)
 
HWND WINAPI AtlAxCreateDialogA (HINSTANCE, LPCSTR, HWND, DLGPROC, LPARAM)
 
INT_PTR WINAPI AtlAxDialogBoxW (HINSTANCE, LPCWSTR, HWND, DLGPROC, LPARAM)
 
INT_PTR WINAPI AtlAxDialogBoxA (HINSTANCE, LPCSTR, HWND, DLGPROC, LPARAM)
 

Function Documentation

◆ AtlAxCreateControl()

HRESULT WINAPI AtlAxCreateControl ( LPCOLESTR  lpszName,
HWND  hWnd,
IStream pStream,
IUnknown **  ppUnkContainer 
)

Definition at line 986 of file atl_ax.c.

988{
989 return AtlAxCreateControlEx( lpszName, hWnd, pStream, ppUnkContainer,
990 NULL, NULL, NULL );
991}
HWND hWnd
Definition: settings.c:17
#define NULL
Definition: types.h:112
HRESULT WINAPI AtlAxCreateControlEx(const WCHAR *lpTricsData, HWND hwnd, IStream *stream, IUnknown **container, IUnknown **control, REFIID iidSink, IUnknown *punkSink)
Definition: atl_ax.c:1483

◆ AtlAxCreateControlEx()

HRESULT WINAPI AtlAxCreateControlEx ( LPCOLESTR  ,
HWND  ,
IStream ,
IUnknown **  ,
IUnknown **  ,
REFIID  ,
IUnknown  
)

◆ AtlAxCreateControlLic()

HRESULT WINAPI AtlAxCreateControlLic ( LPCOLESTR  ,
HWND  ,
IStream ,
IUnknown **  ,
BSTR   
)

◆ AtlAxCreateControlLicEx()

HRESULT WINAPI AtlAxCreateControlLicEx ( LPCOLESTR  lpszName,
HWND  hWnd,
IStream pStream,
IUnknown **  ppUnkContainer,
IUnknown **  ppUnkControl,
REFIID  iidSink,
IUnknown punkSink,
BSTR  lic 
)

Definition at line 1042 of file atl_ax.c.

1045{
1046 CLSID controlId;
1047 HRESULT hRes;
1048 IOleObject *pControl;
1049 IUnknown *pUnkControl = NULL;
1050 IPersistStreamInit *pPSInit;
1051 IUnknown *pContainer = NULL;
1052 enum content content;
1053
1054 TRACE("(%s %p %p %p %p %p %p %s)\n", debugstr_w(lpszName), hWnd, pStream,
1055 ppUnkContainer, ppUnkControl, iidSink, punkSink, debugstr_w(lic));
1056
1057 if (lic)
1058 FIXME("semi stub\n");
1059
1060 if (ppUnkContainer) *ppUnkContainer = NULL;
1061 if (ppUnkControl) *ppUnkControl = NULL;
1062
1063 content = get_content_type(lpszName, &controlId);
1064
1065 if (content == IsEmpty)
1066 return S_OK;
1067
1068 if (content == IsUnknown)
1069 return CO_E_CLASSSTRING;
1070
1071 hRes = CoCreateInstance( &controlId, 0, CLSCTX_ALL, &IID_IOleObject,
1072 (void**) &pControl );
1073 if ( FAILED( hRes ) )
1074 {
1075 WARN( "cannot create ActiveX control %s instance - error 0x%08x\n",
1076 debugstr_guid( &controlId ), hRes );
1077 return hRes;
1078 }
1079
1080 hRes = IOleObject_QueryInterface( pControl, &IID_IPersistStreamInit, (void**) &pPSInit );
1081 if ( SUCCEEDED( hRes ) )
1082 {
1083 if (!pStream)
1084 IPersistStreamInit_InitNew( pPSInit );
1085 else
1086 IPersistStreamInit_Load( pPSInit, pStream );
1087 IPersistStreamInit_Release( pPSInit );
1088 } else
1089 WARN("cannot get IID_IPersistStreamInit out of control\n");
1090
1091 IOleObject_QueryInterface( pControl, &IID_IUnknown, (void**) &pUnkControl );
1092 IOleObject_Release( pControl );
1093
1094
1095 hRes = AtlAxAttachControl( pUnkControl, hWnd, &pContainer );
1096 if ( FAILED( hRes ) )
1097 WARN("cannot attach control to window\n");
1098
1099 if ( content == IsURL )
1100 {
1101 IWebBrowser2 *browser;
1102
1103 hRes = IOleObject_QueryInterface( pControl, &IID_IWebBrowser2, (void**) &browser );
1104 if ( !browser )
1105 WARN( "Cannot query IWebBrowser2 interface: %08x\n", hRes );
1106 else {
1107 VARIANT url;
1108
1109 IWebBrowser2_put_Visible( browser, VARIANT_TRUE ); /* it seems that native does this on URL (but do not on MSHTML:! why? */
1110
1111 V_VT(&url) = VT_BSTR;
1112 V_BSTR(&url) = SysAllocString( lpszName );
1113
1114 hRes = IWebBrowser2_Navigate2( browser, &url, NULL, NULL, NULL, NULL );
1115 if ( FAILED( hRes ) )
1116 WARN( "IWebBrowser2::Navigate2 failed: %08x\n", hRes );
1118
1119 IWebBrowser2_Release( browser );
1120 }
1121 }
1122
1123 if (ppUnkContainer)
1124 {
1125 *ppUnkContainer = pContainer;
1126 if ( pContainer )
1127 IUnknown_AddRef( pContainer );
1128 }
1129 if (ppUnkControl)
1130 {
1131 *ppUnkControl = pUnkControl;
1132 if ( pUnkControl )
1133 IUnknown_AddRef( pUnkControl );
1134 }
1135
1136 if ( pUnkControl )
1137 IUnknown_Release( pUnkControl );
1138 if ( pContainer )
1139 IUnknown_Release( pContainer );
1140
1141 return S_OK;
1142}
const GUID IID_IUnknown
#define FIXME(fmt,...)
Definition: debug.h:111
#define WARN(fmt,...)
Definition: debug.h:112
HRESULT WINAPI AtlAxAttachControl(IUnknown *control, HWND hWnd, IUnknown **container)
Definition: atl_ax.c:1147
content
Definition: atl_ax.c:994
@ IsURL
Definition: atl_ax.c:998
@ IsUnknown
Definition: atl_ax.c:999
@ IsEmpty
Definition: atl_ax.c:995
static enum content get_content_type(LPCOLESTR name, CLSID *control_id)
Definition: atl_ax.c:1002
@ VT_BSTR
Definition: compat.h:2303
HRESULT WINAPI DECLSPEC_HOTPATCH CoCreateInstance(REFCLSID rclsid, LPUNKNOWN pUnkOuter, DWORD dwClsContext, REFIID iid, LPVOID *ppv)
Definition: compobj.c:3325
#define S_OK
Definition: intsafe.h:52
#define SUCCEEDED(hr)
Definition: intsafe.h:50
#define FAILED(hr)
Definition: intsafe.h:51
#define debugstr_guid
Definition: kernel32.h:35
#define debugstr_w
Definition: kernel32.h:32
static const WCHAR url[]
Definition: encode.c:1432
BSTR WINAPI SysAllocString(LPCOLESTR str)
Definition: oleaut.c:238
void WINAPI DECLSPEC_HOTPATCH SysFreeString(BSTR str)
Definition: oleaut.c:271
#define V_VT(A)
Definition: oleauto.h:211
#define V_BSTR(A)
Definition: oleauto.h:226
const GUID IID_IOleObject
const GUID IID_IPersistStreamInit
#define TRACE(s)
Definition: solgame.cpp:4
#define CO_E_CLASSSTRING
Definition: winerror.h:2806

Referenced by AtlAxCreateControlEx(), and AtlAxCreateControlLic().

◆ AtlAxCreateDialogA()

HWND WINAPI AtlAxCreateDialogA ( HINSTANCE  hInst,
LPCSTR  name,
HWND  owner,
DLGPROC  dlgProc,
LPARAM  param 
)

Definition at line 1306 of file atl_ax.c.

1307{
1308 HWND res = NULL;
1309 int length;
1310 WCHAR *nameW;
1311
1312 if (IS_INTRESOURCE(name))
1313 return AtlAxCreateDialogW( hInst, (LPCWSTR) name, owner, dlgProc, param );
1314
1315 length = MultiByteToWideChar( CP_ACP, 0, name, -1, NULL, 0 );
1316 nameW = HeapAlloc( GetProcessHeap(), 0, length * sizeof(WCHAR) );
1317 if (nameW)
1318 {
1320 res = AtlAxCreateDialogW( hInst, nameW, owner, dlgProc, param );
1321 HeapFree( GetProcessHeap(), 0, nameW );
1322 }
1323 return res;
1324}
static const WCHAR nameW[]
Definition: main.c:46
HWND WINAPI AtlAxCreateDialogW(HINSTANCE hInst, LPCWSTR name, HWND owner, DLGPROC dlgProc, LPARAM param)
Definition: atl_ax.c:1332
#define GetProcessHeap()
Definition: compat.h:736
#define CP_ACP
Definition: compat.h:109
#define HeapAlloc
Definition: compat.h:733
#define HeapFree(x, y, z)
Definition: compat.h:735
#define MultiByteToWideChar
Definition: compat.h:110
HINSTANCE hInst
Definition: dxdiag.c:13
GLuint res
Definition: glext.h:9613
GLuint GLsizei GLsizei * length
Definition: glext.h:6040
GLfloat param
Definition: glext.h:5796
Definition: name.c:39
#define IS_INTRESOURCE(i)
Definition: winuser.h:580
__wchar_t WCHAR
Definition: xmlstorage.h:180
const WCHAR * LPCWSTR
Definition: xmlstorage.h:185

◆ AtlAxCreateDialogW()

HWND WINAPI AtlAxCreateDialogW ( HINSTANCE  hInst,
LPCWSTR  name,
HWND  owner,
DLGPROC  dlgProc,
LPARAM  param 
)

Definition at line 1332 of file atl_ax.c.

1333{
1334 HRSRC hrsrc;
1335 HGLOBAL hgl;
1337 LPDLGTEMPLATEW newptr;
1338 HWND res;
1339
1340 TRACE("(%p %s %p %p %lx)\n", hInst, debugstr_w(name), owner, dlgProc, param);
1341
1342 hrsrc = FindResourceW( hInst, name, (LPWSTR)RT_DIALOG );
1343 if ( !hrsrc )
1344 return NULL;
1345 hgl = LoadResource (hInst, hrsrc);
1346 if ( !hgl )
1347 return NULL;
1348 ptr = LockResource ( hgl );
1349 if (!ptr)
1350 {
1351 FreeResource( hgl );
1352 return NULL;
1353 }
1354 newptr = AX_ConvertDialogTemplate( ptr );
1355 if ( newptr )
1356 {
1357 res = CreateDialogIndirectParamW( hInst, newptr, owner, dlgProc, param );
1358 HeapFree( GetProcessHeap(), 0, newptr );
1359 } else
1360 res = NULL;
1361 FreeResource ( hrsrc );
1362 return res;
1363}
static LPDLGTEMPLATEW AX_ConvertDialogTemplate(LPCDLGTEMPLATEW src_tmpl)
Definition: atl_ax.c:1180
BOOL WINAPI FreeResource(HGLOBAL handle)
Definition: res.c:559
HRSRC WINAPI FindResourceW(HINSTANCE hModule, LPCWSTR name, LPCWSTR type)
Definition: res.c:176
LPVOID WINAPI LockResource(HGLOBAL handle)
Definition: res.c:550
HGLOBAL WINAPI LoadResource(HINSTANCE hModule, HRSRC hRsrc)
Definition: res.c:532
static PVOID ptr
Definition: dispmode.c:27
#define RT_DIALOG
Definition: pedump.c:367
HWND WINAPI CreateDialogIndirectParamW(_In_opt_ HINSTANCE, _In_ LPCDLGTEMPLATE, _In_opt_ HWND, _In_opt_ DLGPROC, _In_ LPARAM)
WCHAR * LPWSTR
Definition: xmlstorage.h:184

Referenced by AtlAxCreateDialogA().

◆ AtlAxDialogBoxA()

INT_PTR WINAPI AtlAxDialogBoxA ( HINSTANCE  hInst,
LPCSTR  name,
HWND  owner,
DLGPROC  dlgProc,
LPARAM  param 
)

Definition at line 1413 of file atl_ax.c.

1414{
1415 INT_PTR res = 0;
1416 int length;
1417 WCHAR *nameW;
1418
1419 if (IS_INTRESOURCE(name))
1420 return AtlAxDialogBoxW( hInst, (LPCWSTR) name, owner, dlgProc, param );
1421
1422 length = MultiByteToWideChar( CP_ACP, 0, name, -1, NULL, 0 );
1423 nameW = heap_alloc( length * sizeof(WCHAR) );
1424 if (nameW)
1425 {
1427 res = AtlAxDialogBoxW( hInst, nameW, owner, dlgProc, param );
1428 heap_free( nameW );
1429 }
1430 return res;
1431}
static void * heap_alloc(size_t len)
Definition: appwiz.h:65
static BOOL heap_free(void *mem)
Definition: appwiz.h:75
INT_PTR WINAPI AtlAxDialogBoxW(HINSTANCE hInst, LPCWSTR name, HWND owner, DLGPROC dlgProc, LPARAM param)
Definition: atl_ax.c:1437
int32_t INT_PTR
Definition: typedefs.h:64

◆ AtlAxDialogBoxW()

INT_PTR WINAPI AtlAxDialogBoxW ( HINSTANCE  hInst,
LPCWSTR  name,
HWND  owner,
DLGPROC  dlgProc,
LPARAM  param 
)

Definition at line 1437 of file atl_ax.c.

1438{
1439 HRSRC hrsrc;
1440 HGLOBAL hgl;
1442 LPDLGTEMPLATEW newptr;
1443 INT_PTR res;
1444
1445 TRACE("(%p %s %p %p %lx)\n", hInst, debugstr_w(name), owner, dlgProc, param);
1446
1447 hrsrc = FindResourceW( hInst, name, (LPWSTR)RT_DIALOG );
1448 if ( !hrsrc )
1449 return 0;
1450 hgl = LoadResource (hInst, hrsrc);
1451 if ( !hgl )
1452 return 0;
1453 ptr = LockResource ( hgl );
1454 if (!ptr)
1455 {
1456 FreeResource( hgl );
1457 return 0;
1458 }
1459 newptr = AX_ConvertDialogTemplate( ptr );
1460 if ( newptr )
1461 {
1462 res = DialogBoxIndirectParamW( hInst, newptr, owner, dlgProc, param );
1463 heap_free( newptr );
1464 } else
1465 res = 0;
1466 FreeResource ( hrsrc );
1467 return res;
1468}
INT_PTR WINAPI DialogBoxIndirectParamW(_In_opt_ HINSTANCE, _In_ LPCDLGTEMPLATE, _In_opt_ HWND, _In_opt_ DLGPROC, _In_ LPARAM)

Referenced by AtlAxDialogBoxA().

◆ AtlAxGetControl()

HRESULT WINAPI AtlAxGetControl ( HWND  hWnd,
IUnknown **  pUnk 
)

Definition at line 1391 of file atl_ax.c.

1392{
1393 IOCS *This;
1394
1395 TRACE( "(%p, %p)\n", hWnd, pUnk );
1396
1397 *pUnk = NULL;
1398
1400 if ( !This || !This->control )
1401 {
1402 WARN("No control attached to %p\n", hWnd );
1403 return E_FAIL;
1404 }
1405
1406 return IOleObject_QueryInterface( This->control, &IID_IUnknown, (void**) pUnk );
1407}
#define E_FAIL
Definition: ddrawi.h:102
static const WCHAR wine_atl_iocsW[]
Definition: atl_ax.c:59
static void *static void *static LPDIRECTPLAY IUnknown * pUnk
Definition: dplayx.c:30
Definition: atl_ax.c:44
HANDLE WINAPI GetPropW(_In_ HWND, _In_ LPCWSTR)

Referenced by test_ax_win().

◆ AtlAxGetHost()

HRESULT WINAPI AtlAxGetHost ( HWND  hWnd,
IUnknown **  host 
)

Definition at line 1369 of file atl_ax.c.

1370{
1371 IOCS *This;
1372
1373 TRACE("(%p, %p)\n", hWnd, host);
1374
1375 *host = NULL;
1376
1378 if ( !This )
1379 {
1380 WARN("No container attached to %p\n", hWnd );
1381 return E_FAIL;
1382 }
1383
1384 return IOleClientSite_QueryInterface(&This->IOleClientSite_iface, &IID_IUnknown, (void**)host);
1385}
char * host
Definition: whois.c:55

◆ AtlAxWinInit()

BOOL WINAPI AtlAxWinInit ( void  )

Definition at line 89 of file atl_ax.c.

90{
91 WNDCLASSEXW wcex;
92
93#if _ATL_VER <= _ATL_VER_30
94#define ATL_NAME_SUFFIX 0
95#elif _ATL_VER == _ATL_VER_80
96#define ATL_NAME_SUFFIX '8','0',0
97#elif _ATL_VER == _ATL_VER_90
98#define ATL_NAME_SUFFIX '9','0',0
99#elif _ATL_VER == _ATL_VER_100
100#define ATL_NAME_SUFFIX '1','0','0',0
101#elif _ATL_VER == _ATL_VER_110
102#define ATL_NAME_SUFFIX '1','1','0',0
103#else
104#error Unsupported version
105#endif
106
107 static const WCHAR AtlAxWinW[] = {'A','t','l','A','x','W','i','n',ATL_NAME_SUFFIX};
108
109 FIXME("version %04x semi-stub\n", _ATL_VER);
110
111 if ( FAILED( OleInitialize(NULL) ) )
112 return FALSE;
113
114 wcex.cbSize = sizeof(wcex);
116 wcex.cbClsExtra = 0;
117 wcex.cbWndExtra = 0;
119 wcex.hIcon = NULL;
120 wcex.hCursor = NULL;
121 wcex.hbrBackground = NULL;
122 wcex.lpszMenuName = NULL;
123 wcex.hIconSm = 0;
124
126 wcex.lpszClassName = AtlAxWinW;
127 if ( !RegisterClassExW( &wcex ) )
128 return FALSE;
129
130 if(_ATL_VER > _ATL_VER_30) {
131 static const WCHAR AtlAxWinLicW[] = {'A','t','l','A','x','W','i','n','L','i','c',ATL_NAME_SUFFIX};
132
133 wcex.lpszClassName = AtlAxWinLicW;
134 if ( !RegisterClassExW( &wcex ) )
135 return FALSE;
136 }
137
138 return TRUE;
139}
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
#define ATL_NAME_SUFFIX
static LRESULT CALLBACK AtlAxWin_wndproc(HWND hWnd, UINT wMsg, WPARAM wParam, LPARAM lParam)
Definition: atl_ax.c:64
HMODULE WINAPI GetModuleHandleW(LPCWSTR lpModuleName)
Definition: loader.c:838
HRESULT WINAPI DECLSPEC_HOTPATCH OleInitialize(LPVOID reserved)
Definition: ole2.c:169
#define _ATL_VER_30
Definition: atlbase.h:28
#define _ATL_VER
Definition: atlbase.h:36
LPCWSTR lpszClassName
Definition: winuser.h:3216
LPCWSTR lpszMenuName
Definition: winuser.h:3215
HBRUSH hbrBackground
Definition: winuser.h:3214
WNDPROC lpfnWndProc
Definition: winuser.h:3208
UINT cbSize
Definition: winuser.h:3206
int cbWndExtra
Definition: winuser.h:3210
HCURSOR hCursor
Definition: winuser.h:3213
HICON hIconSm
Definition: winuser.h:3217
HINSTANCE hInstance
Definition: winuser.h:3211
UINT style
Definition: winuser.h:3207
int cbClsExtra
Definition: winuser.h:3209
HICON hIcon
Definition: winuser.h:3212
#define CS_DBLCLKS
Definition: winuser.h:646
ATOM WINAPI RegisterClassExW(_In_ CONST WNDCLASSEXW *)
#define CS_GLOBALCLASS
Definition: winuser.h:647

Referenced by test_ax_win().

◆ DEFINE_GUID()

DEFINE_GUID ( CLSID_Registrar  ,
0x44ec053a  ,
0x400f  ,
0x11d0  ,
0x9d  ,
0xcd  ,
0x00  ,
0xa0  ,
0xc9  ,
0x03  ,
0x91  ,
0xd3   
)