2 * Active Template Library ActiveX functions (atl.dll)
4 * Copyright 2006 Andrey Turkin
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this library; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
30 #include "wine/debug.h"
41 WINE_DEFAULT_DEBUG_CHANNEL(atl
);
44 IOleClientSite IOleClientSite_iface
;
45 IOleContainer IOleContainer_iface
;
46 IOleInPlaceSiteWindowless IOleInPlaceSiteWindowless_iface
;
47 IOleInPlaceFrame IOleInPlaceFrame_iface
;
48 IOleControlSite IOleControlSite_iface
;
55 BOOL fActive
, fInPlace
, fWindowless
;
58 static const WCHAR wine_atl_iocsW
[] = {'_','_','W','I','N','E','_','A','T','L','_','I','O','C','S','\0'};
60 /**********************************************************************
61 * AtlAxWin class window procedure
63 static LRESULT CALLBACK
AtlAxWin_wndproc( HWND hWnd
, UINT wMsg
, WPARAM wParam
, LPARAM lParam
)
65 if ( wMsg
== WM_CREATE
)
67 DWORD len
= GetWindowTextLengthW( hWnd
) + 1;
68 WCHAR
*ptr
= HeapAlloc( GetProcessHeap(), 0, len
*sizeof(WCHAR
) );
71 GetWindowTextW( hWnd
, ptr
, len
);
72 AtlAxCreateControlEx( ptr
, hWnd
, NULL
, NULL
, NULL
, NULL
, NULL
);
73 HeapFree( GetProcessHeap(), 0, ptr
);
76 return DefWindowProcW( hWnd
, wMsg
, wParam
, lParam
);
79 /***********************************************************************
80 * AtlAxWinInit [atl100.@]
81 * Initializes the control-hosting code: registering the AtlAxWin,
82 * AtlAxWin7 and AtlAxWinLic7 window classes and some messages.
88 BOOL WINAPI
AtlAxWinInit(void)
92 #if _ATL_VER <= _ATL_VER_30
93 #define ATL_NAME_SUFFIX 0
94 #elif _ATL_VER == _ATL_VER_80
95 #define ATL_NAME_SUFFIX '8','0',0
96 #elif _ATL_VER == _ATL_VER_90
97 #define ATL_NAME_SUFFIX '9','0',0
98 #elif _ATL_VER == _ATL_VER_100
99 #define ATL_NAME_SUFFIX '1','0','0',0
100 #elif _ATL_VER == _ATL_VER_110
101 #define ATL_NAME_SUFFIX '1','1','0',0
103 #error Unsupported version
106 static const WCHAR AtlAxWinW
[] = {'A','t','l','A','x','W','i','n',ATL_NAME_SUFFIX
};
108 FIXME("version %04x semi-stub\n", _ATL_VER
);
110 if ( FAILED( OleInitialize(NULL
) ) )
113 wcex
.cbSize
= sizeof(wcex
);
114 wcex
.style
= CS_GLOBALCLASS
| (_ATL_VER
> _ATL_VER_30
? CS_DBLCLKS
: 0);
117 wcex
.hInstance
= GetModuleHandleW( NULL
);
120 wcex
.hbrBackground
= NULL
;
121 wcex
.lpszMenuName
= NULL
;
124 wcex
.lpfnWndProc
= AtlAxWin_wndproc
;
125 wcex
.lpszClassName
= AtlAxWinW
;
126 if ( !RegisterClassExW( &wcex
) )
129 if(_ATL_VER
> _ATL_VER_30
) {
130 static const WCHAR AtlAxWinLicW
[] = {'A','t','l','A','x','W','i','n','L','i','c',ATL_NAME_SUFFIX
};
132 wcex
.lpszClassName
= AtlAxWinLicW
;
133 if ( !RegisterClassExW( &wcex
) )
140 /***********************************************************************
141 * Atl container component implementation
144 /****** IOleClientSite *****/
145 static inline IOCS
*impl_from_IOleClientSite(IOleClientSite
*iface
)
147 return CONTAINING_RECORD(iface
, IOCS
, IOleClientSite_iface
);
150 static HRESULT
IOCS_Detach( IOCS
*This
) /* remove subclassing */
154 SetWindowLongPtrW( This
->hWnd
, GWLP_WNDPROC
, (ULONG_PTR
) This
->OrigWndProc
);
155 RemovePropW( This
->hWnd
, wine_atl_iocsW
);
160 IOleObject
*control
= This
->control
;
162 This
->control
= NULL
;
163 IOleObject_Close( control
, OLECLOSE_NOSAVE
);
164 IOleObject_SetClientSite( control
, NULL
);
165 IOleObject_Release( control
);
170 static HRESULT WINAPI
OleClientSite_QueryInterface(IOleClientSite
*iface
, REFIID riid
, void **ppv
)
172 IOCS
*This
= impl_from_IOleClientSite(iface
);
174 TRACE("(%p)->(%s %p)\n", This
, debugstr_guid(riid
), ppv
);
178 if (IsEqualIID(&IID_IUnknown
, riid
) ||
179 IsEqualIID(&IID_IOleClientSite
, riid
))
183 else if (IsEqualIID(&IID_IOleContainer
, riid
))
185 *ppv
= &This
->IOleContainer_iface
;
187 else if (IsEqualIID(&IID_IOleInPlaceSite
, riid
) ||
188 IsEqualIID(&IID_IOleInPlaceSiteEx
, riid
) ||
189 IsEqualIID(&IID_IOleInPlaceSiteWindowless
, riid
))
191 *ppv
= &This
->IOleInPlaceSiteWindowless_iface
;
193 else if (IsEqualIID(&IID_IOleInPlaceFrame
, riid
))
195 *ppv
= &This
->IOleInPlaceFrame_iface
;
197 else if (IsEqualIID(&IID_IOleControlSite
, riid
))
199 *ppv
= &This
->IOleControlSite_iface
;
204 IOleClientSite_AddRef(iface
);
208 WARN("unsupported interface %s\n", debugstr_guid(riid
));
209 return E_NOINTERFACE
;
212 static ULONG WINAPI
OleClientSite_AddRef(IOleClientSite
*iface
)
214 IOCS
*This
= impl_from_IOleClientSite(iface
);
215 ULONG ref
= InterlockedIncrement(&This
->ref
);
216 TRACE("(%p)->(%d)\n", This
, ref
);
220 static ULONG WINAPI
OleClientSite_Release(IOleClientSite
*iface
)
222 IOCS
*This
= impl_from_IOleClientSite(iface
);
223 ULONG ref
= InterlockedDecrement(&This
->ref
);
225 TRACE("(%p)->(%d)\n", This
, ref
);
230 HeapFree( GetProcessHeap(), 0, This
);
236 static HRESULT WINAPI
OleClientSite_SaveObject(IOleClientSite
*iface
)
238 IOCS
*This
= impl_from_IOleClientSite(iface
);
239 FIXME( "(%p) - stub\n", This
);
243 static HRESULT WINAPI
OleClientSite_GetMoniker(IOleClientSite
*iface
, DWORD dwAssign
, DWORD dwWhichMoniker
, IMoniker
**ppmk
)
245 IOCS
*This
= impl_from_IOleClientSite(iface
);
247 FIXME( "(%p, 0x%x, 0x%x, %p)\n", This
, dwAssign
, dwWhichMoniker
, ppmk
);
251 static HRESULT WINAPI
OleClientSite_GetContainer(IOleClientSite
*iface
, IOleContainer
**container
)
253 IOCS
*This
= impl_from_IOleClientSite(iface
);
254 TRACE("(%p, %p)\n", This
, container
);
255 return IOleClientSite_QueryInterface(iface
, &IID_IOleContainer
, (void**)container
);
258 static HRESULT WINAPI
OleClientSite_ShowObject(IOleClientSite
*iface
)
260 IOCS
*This
= impl_from_IOleClientSite(iface
);
261 FIXME( "(%p) - stub\n", This
);
265 static HRESULT WINAPI
OleClientSite_OnShowWindow(IOleClientSite
*iface
, BOOL fShow
)
267 IOCS
*This
= impl_from_IOleClientSite(iface
);
268 FIXME( "(%p, %s) - stub\n", This
, fShow
? "TRUE" : "FALSE" );
272 static HRESULT WINAPI
OleClientSite_RequestNewObjectLayout(IOleClientSite
*iface
)
274 IOCS
*This
= impl_from_IOleClientSite(iface
);
275 FIXME( "(%p) - stub\n", This
);
280 /****** IOleContainer *****/
281 static inline IOCS
*impl_from_IOleContainer(IOleContainer
*iface
)
283 return CONTAINING_RECORD(iface
, IOCS
, IOleContainer_iface
);
286 static HRESULT WINAPI
OleContainer_QueryInterface( IOleContainer
* iface
, REFIID riid
, void** ppv
)
288 IOCS
*This
= impl_from_IOleContainer(iface
);
289 return IOleClientSite_QueryInterface(&This
->IOleClientSite_iface
, riid
, ppv
);
292 static ULONG WINAPI
OleContainer_AddRef(IOleContainer
* iface
)
294 IOCS
*This
= impl_from_IOleContainer(iface
);
295 return IOleClientSite_AddRef(&This
->IOleClientSite_iface
);
298 static ULONG WINAPI
OleContainer_Release(IOleContainer
* iface
)
300 IOCS
*This
= impl_from_IOleContainer(iface
);
301 return IOleClientSite_Release(&This
->IOleClientSite_iface
);
304 static HRESULT WINAPI
OleContainer_ParseDisplayName(IOleContainer
* iface
, IBindCtx
* pbc
,
305 LPOLESTR pszDisplayName
, ULONG
* pchEaten
, IMoniker
** ppmkOut
)
307 IOCS
*This
= impl_from_IOleContainer(iface
);
308 FIXME( "(%p,%p,%s,%p,%p) - stub\n", This
, pbc
, debugstr_w(pszDisplayName
), pchEaten
, ppmkOut
);
312 static HRESULT WINAPI
OleContainer_EnumObjects(IOleContainer
* iface
, DWORD grfFlags
, IEnumUnknown
** ppenum
)
314 IOCS
*This
= impl_from_IOleContainer(iface
);
315 FIXME( "(%p, %u, %p) - stub\n", This
, grfFlags
, ppenum
);
319 static HRESULT WINAPI
OleContainer_LockContainer(IOleContainer
* iface
, BOOL fLock
)
321 IOCS
*This
= impl_from_IOleContainer(iface
);
322 FIXME( "(%p, %s) - stub\n", This
, fLock
?"TRUE":"FALSE" );
327 /****** IOleInPlaceSiteWindowless *******/
328 static inline IOCS
*impl_from_IOleInPlaceSiteWindowless(IOleInPlaceSiteWindowless
*iface
)
330 return CONTAINING_RECORD(iface
, IOCS
, IOleInPlaceSiteWindowless_iface
);
333 static HRESULT WINAPI
OleInPlaceSiteWindowless_QueryInterface(IOleInPlaceSiteWindowless
*iface
, REFIID riid
, void **ppv
)
335 IOCS
*This
= impl_from_IOleInPlaceSiteWindowless(iface
);
336 return IOleClientSite_QueryInterface(&This
->IOleClientSite_iface
, riid
, ppv
);
339 static ULONG WINAPI
OleInPlaceSiteWindowless_AddRef(IOleInPlaceSiteWindowless
*iface
)
341 IOCS
*This
= impl_from_IOleInPlaceSiteWindowless(iface
);
342 return IOleClientSite_AddRef(&This
->IOleClientSite_iface
);
345 static ULONG WINAPI
OleInPlaceSiteWindowless_Release(IOleInPlaceSiteWindowless
*iface
)
347 IOCS
*This
= impl_from_IOleInPlaceSiteWindowless(iface
);
348 return IOleClientSite_Release(&This
->IOleClientSite_iface
);
351 static HRESULT WINAPI
OleInPlaceSiteWindowless_GetWindow(IOleInPlaceSiteWindowless
* iface
, HWND
* phwnd
)
353 IOCS
*This
= impl_from_IOleInPlaceSiteWindowless(iface
);
355 TRACE("(%p,%p)\n", This
, phwnd
);
360 static HRESULT WINAPI
OleInPlaceSiteWindowless_ContextSensitiveHelp(IOleInPlaceSiteWindowless
* iface
, BOOL fEnterMode
)
362 IOCS
*This
= impl_from_IOleInPlaceSiteWindowless(iface
);
363 FIXME("(%p,%d) - stub\n", This
, fEnterMode
);
367 static HRESULT WINAPI
OleInPlaceSiteWindowless_CanInPlaceActivate(IOleInPlaceSiteWindowless
*iface
)
369 IOCS
*This
= impl_from_IOleInPlaceSiteWindowless(iface
);
370 TRACE("(%p)\n", This
);
374 static HRESULT WINAPI
OleInPlaceSiteWindowless_OnInPlaceActivate(IOleInPlaceSiteWindowless
*iface
)
376 IOCS
*This
= impl_from_IOleInPlaceSiteWindowless(iface
);
378 TRACE("(%p)\n", This
);
380 This
->fInPlace
= TRUE
;
384 static HRESULT WINAPI
OleInPlaceSiteWindowless_OnUIActivate(IOleInPlaceSiteWindowless
*iface
)
386 IOCS
*This
= impl_from_IOleInPlaceSiteWindowless(iface
);
388 TRACE("(%p)\n", This
);
392 static HRESULT WINAPI
OleInPlaceSiteWindowless_GetWindowContext(IOleInPlaceSiteWindowless
*iface
,
393 IOleInPlaceFrame
**frame
, IOleInPlaceUIWindow
**ppDoc
, LPRECT lprcPosRect
,
394 LPRECT lprcClipRect
, LPOLEINPLACEFRAMEINFO lpFrameInfo
)
396 IOCS
*This
= impl_from_IOleInPlaceSiteWindowless(iface
);
398 TRACE("(%p,%p,%p,%p,%p,%p)\n", This
, frame
, ppDoc
, lprcPosRect
, lprcClipRect
, lpFrameInfo
);
401 *lprcClipRect
= This
->size
;
403 *lprcPosRect
= This
->size
;
407 *frame
= &This
->IOleInPlaceFrame_iface
;
408 IOleInPlaceFrame_AddRef(*frame
);
416 lpFrameInfo
->fMDIApp
= FALSE
;
417 lpFrameInfo
->hwndFrame
= This
->hWnd
;
418 lpFrameInfo
->haccel
= NULL
;
419 lpFrameInfo
->cAccelEntries
= 0;
425 static HRESULT WINAPI
OleInPlaceSiteWindowless_Scroll(IOleInPlaceSiteWindowless
*iface
, SIZE scrollExtent
)
427 IOCS
*This
= impl_from_IOleInPlaceSiteWindowless(iface
);
428 FIXME("(%p) - stub\n", This
);
432 static HRESULT WINAPI
OleInPlaceSiteWindowless_OnUIDeactivate(IOleInPlaceSiteWindowless
*iface
, BOOL fUndoable
)
434 IOCS
*This
= impl_from_IOleInPlaceSiteWindowless(iface
);
435 FIXME("(%p,%d) - stub\n", This
, fUndoable
);
439 static HRESULT WINAPI
OleInPlaceSiteWindowless_OnInPlaceDeactivate(IOleInPlaceSiteWindowless
*iface
)
441 IOCS
*This
= impl_from_IOleInPlaceSiteWindowless(iface
);
443 TRACE("(%p)\n", This
);
445 This
->fInPlace
= This
->fWindowless
= FALSE
;
449 static HRESULT WINAPI
OleInPlaceSiteWindowless_DiscardUndoState(IOleInPlaceSiteWindowless
*iface
)
451 IOCS
*This
= impl_from_IOleInPlaceSiteWindowless(iface
);
452 FIXME("(%p) - stub\n", This
);
456 static HRESULT WINAPI
OleInPlaceSiteWindowless_DeactivateAndUndo(IOleInPlaceSiteWindowless
*iface
)
458 IOCS
*This
= impl_from_IOleInPlaceSiteWindowless(iface
);
459 FIXME("(%p) - stub\n", This
);
463 static HRESULT WINAPI
OleInPlaceSiteWindowless_OnPosRectChange(IOleInPlaceSiteWindowless
*iface
, LPCRECT lprcPosRect
)
465 IOCS
*This
= impl_from_IOleInPlaceSiteWindowless(iface
);
466 FIXME("(%p,%p) - stub\n", This
, lprcPosRect
);
470 static HRESULT WINAPI
OleInPlaceSiteWindowless_OnInPlaceActivateEx( IOleInPlaceSiteWindowless
*iface
, BOOL
* pfNoRedraw
, DWORD dwFlags
)
472 IOCS
*This
= impl_from_IOleInPlaceSiteWindowless(iface
);
476 This
->fActive
= This
->fInPlace
= TRUE
;
477 if ( dwFlags
& ACTIVATE_WINDOWLESS
)
478 This
->fWindowless
= TRUE
;
482 static HRESULT WINAPI
OleInPlaceSiteWindowless_OnInPlaceDeactivateEx( IOleInPlaceSiteWindowless
*iface
, BOOL fNoRedraw
)
484 IOCS
*This
= impl_from_IOleInPlaceSiteWindowless(iface
);
488 This
->fActive
= This
->fInPlace
= This
->fWindowless
= FALSE
;
491 static HRESULT WINAPI
OleInPlaceSiteWindowless_RequestUIActivate( IOleInPlaceSiteWindowless
*iface
)
496 static HRESULT WINAPI
OleInPlaceSiteWindowless_CanWindowlessActivate( IOleInPlaceSiteWindowless
*iface
)
501 static HRESULT WINAPI
OleInPlaceSiteWindowless_GetCapture( IOleInPlaceSiteWindowless
*iface
)
506 static HRESULT WINAPI
OleInPlaceSiteWindowless_SetCapture( IOleInPlaceSiteWindowless
*iface
, BOOL fCapture
)
511 static HRESULT WINAPI
OleInPlaceSiteWindowless_GetFocus( IOleInPlaceSiteWindowless
*iface
)
516 static HRESULT WINAPI
OleInPlaceSiteWindowless_SetFocus( IOleInPlaceSiteWindowless
*iface
, BOOL fFocus
)
521 static HRESULT WINAPI
OleInPlaceSiteWindowless_GetDC( IOleInPlaceSiteWindowless
*iface
, LPCRECT pRect
, DWORD grfFlags
, HDC
* phDC
)
526 static HRESULT WINAPI
OleInPlaceSiteWindowless_ReleaseDC( IOleInPlaceSiteWindowless
*iface
, HDC hDC
)
531 static HRESULT WINAPI
OleInPlaceSiteWindowless_InvalidateRect( IOleInPlaceSiteWindowless
*iface
, LPCRECT pRect
, BOOL fErase
)
536 static HRESULT WINAPI
OleInPlaceSiteWindowless_InvalidateRgn( IOleInPlaceSiteWindowless
*iface
, HRGN hRGN
, BOOL fErase
)
541 static HRESULT WINAPI
OleInPlaceSiteWindowless_ScrollRect( IOleInPlaceSiteWindowless
*iface
, INT dx
, INT dy
, LPCRECT pRectScroll
, LPCRECT pRectClip
)
546 static HRESULT WINAPI
OleInPlaceSiteWindowless_AdjustRect( IOleInPlaceSiteWindowless
*iface
, LPRECT prc
)
551 static HRESULT WINAPI
OleInPlaceSiteWindowless_OnDefWindowMessage( IOleInPlaceSiteWindowless
*iface
, UINT msg
, WPARAM wParam
, LPARAM lParam
, LRESULT
* plResult
)
558 /****** IOleInPlaceFrame *******/
559 static inline IOCS
*impl_from_IOleInPlaceFrame(IOleInPlaceFrame
*iface
)
561 return CONTAINING_RECORD(iface
, IOCS
, IOleInPlaceFrame_iface
);
564 static HRESULT WINAPI
OleInPlaceFrame_QueryInterface(IOleInPlaceFrame
*iface
, REFIID riid
, void **ppv
)
566 IOCS
*This
= impl_from_IOleInPlaceFrame(iface
);
567 return IOleClientSite_QueryInterface(&This
->IOleClientSite_iface
, riid
, ppv
);
570 static ULONG WINAPI
OleInPlaceFrame_AddRef(IOleInPlaceFrame
*iface
)
572 IOCS
*This
= impl_from_IOleInPlaceFrame(iface
);
573 return IOleClientSite_AddRef(&This
->IOleClientSite_iface
);
576 static ULONG WINAPI
OleInPlaceFrame_Release(IOleInPlaceFrame
*iface
)
578 IOCS
*This
= impl_from_IOleInPlaceFrame(iface
);
579 return IOleClientSite_Release(&This
->IOleClientSite_iface
);
582 static HRESULT WINAPI
OleInPlaceFrame_GetWindow(IOleInPlaceFrame
*iface
, HWND
*phWnd
)
584 IOCS
*This
= impl_from_IOleInPlaceFrame(iface
);
586 TRACE( "(%p,%p)\n", This
, phWnd
);
592 static HRESULT WINAPI
OleInPlaceFrame_ContextSensitiveHelp(IOleInPlaceFrame
*iface
, BOOL fEnterMode
)
594 IOCS
*This
= impl_from_IOleInPlaceFrame(iface
);
596 FIXME( "(%p,%d) - stub\n", This
, fEnterMode
);
600 static HRESULT WINAPI
OleInPlaceFrame_GetBorder(IOleInPlaceFrame
*iface
, LPRECT lprectBorder
)
602 IOCS
*This
= impl_from_IOleInPlaceFrame(iface
);
604 FIXME( "(%p,%p) - stub\n", This
, lprectBorder
);
608 static HRESULT WINAPI
OleInPlaceFrame_RequestBorderSpace(IOleInPlaceFrame
*iface
, LPCBORDERWIDTHS pborderwidths
)
610 IOCS
*This
= impl_from_IOleInPlaceFrame(iface
);
612 FIXME( "(%p,%p) - stub\n", This
, pborderwidths
);
616 static HRESULT WINAPI
OleInPlaceFrame_SetBorderSpace(IOleInPlaceFrame
*iface
, LPCBORDERWIDTHS pborderwidths
)
618 IOCS
*This
= impl_from_IOleInPlaceFrame(iface
);
620 FIXME( "(%p,%p) - stub\n", This
, pborderwidths
);
624 static HRESULT WINAPI
OleInPlaceFrame_SetActiveObject(IOleInPlaceFrame
*iface
, IOleInPlaceActiveObject
*pActiveObject
, LPCOLESTR pszObjName
)
626 IOCS
*This
= impl_from_IOleInPlaceFrame(iface
);
628 FIXME( "(%p,%p,%s) - stub\n", This
, pActiveObject
, debugstr_w(pszObjName
) );
632 static HRESULT WINAPI
OleInPlaceFrame_InsertMenus(IOleInPlaceFrame
*iface
, HMENU hmenuShared
, LPOLEMENUGROUPWIDTHS lpMenuWidths
)
634 IOCS
*This
= impl_from_IOleInPlaceFrame(iface
);
636 FIXME( "(%p,%p,%p) - stub\n", This
, hmenuShared
, lpMenuWidths
);
640 static HRESULT WINAPI
OleInPlaceFrame_SetMenu(IOleInPlaceFrame
*iface
, HMENU hmenuShared
, HOLEMENU holemenu
, HWND hwndActiveObject
)
642 IOCS
*This
= impl_from_IOleInPlaceFrame(iface
);
644 FIXME( "(%p,%p,%p,%p) - stub\n", This
, hmenuShared
, holemenu
, hwndActiveObject
);
648 static HRESULT WINAPI
OleInPlaceFrame_RemoveMenus(IOleInPlaceFrame
*iface
, HMENU hmenuShared
)
650 IOCS
*This
= impl_from_IOleInPlaceFrame(iface
);
652 FIXME( "(%p, %p) - stub\n", This
, hmenuShared
);
656 static HRESULT WINAPI
OleInPlaceFrame_SetStatusText(IOleInPlaceFrame
*iface
, LPCOLESTR pszStatusText
)
658 IOCS
*This
= impl_from_IOleInPlaceFrame(iface
);
660 FIXME( "(%p, %s) - stub\n", This
, debugstr_w( pszStatusText
) );
664 static HRESULT WINAPI
OleInPlaceFrame_EnableModeless(IOleInPlaceFrame
*iface
, BOOL fEnable
)
666 IOCS
*This
= impl_from_IOleInPlaceFrame(iface
);
668 FIXME( "(%p, %d) - stub\n", This
, fEnable
);
672 static HRESULT WINAPI
OleInPlaceFrame_TranslateAccelerator(IOleInPlaceFrame
*iface
, LPMSG lpmsg
, WORD wID
)
674 IOCS
*This
= impl_from_IOleInPlaceFrame(iface
);
676 FIXME( "(%p, %p, %x) - stub\n", This
, lpmsg
, wID
);
681 /****** IOleControlSite *******/
682 static inline IOCS
*impl_from_IOleControlSite(IOleControlSite
*iface
)
684 return CONTAINING_RECORD(iface
, IOCS
, IOleControlSite_iface
);
687 static HRESULT WINAPI
OleControlSite_QueryInterface(IOleControlSite
*iface
, REFIID riid
, void **ppv
)
689 IOCS
*This
= impl_from_IOleControlSite(iface
);
690 return IOleClientSite_QueryInterface(&This
->IOleClientSite_iface
, riid
, ppv
);
693 static ULONG WINAPI
OleControlSite_AddRef(IOleControlSite
*iface
)
695 IOCS
*This
= impl_from_IOleControlSite(iface
);
696 return IOleClientSite_AddRef(&This
->IOleClientSite_iface
);
699 static ULONG WINAPI
OleControlSite_Release(IOleControlSite
*iface
)
701 IOCS
*This
= impl_from_IOleControlSite(iface
);
702 return IOleClientSite_Release(&This
->IOleClientSite_iface
);
705 static HRESULT WINAPI
OleControlSite_OnControlInfoChanged( IOleControlSite
* This
)
710 static HRESULT WINAPI
OleControlSite_LockInPlaceActive( IOleControlSite
* This
, BOOL fLock
)
715 static HRESULT WINAPI
OleControlSite_GetExtendedControl( IOleControlSite
* This
, IDispatch
** ppDisp
)
720 static HRESULT WINAPI
OleControlSite_TransformCoords( IOleControlSite
* This
, POINTL
* pPtlHimetric
, POINTF
* pPtfContainer
, DWORD dwFlags
)
725 static HRESULT WINAPI
OleControlSite_TranslateAccelerator( IOleControlSite
* This
, MSG
* pMsg
, DWORD grfModifiers
)
730 static HRESULT WINAPI
OleControlSite_OnFocus( IOleControlSite
* This
, BOOL fGotFocus
)
735 static HRESULT WINAPI
OleControlSite_ShowPropertyFrame( IOleControlSite
* This
)
742 static const IOleClientSiteVtbl OleClientSite_vtbl
= {
743 OleClientSite_QueryInterface
,
744 OleClientSite_AddRef
,
745 OleClientSite_Release
,
746 OleClientSite_SaveObject
,
747 OleClientSite_GetMoniker
,
748 OleClientSite_GetContainer
,
749 OleClientSite_ShowObject
,
750 OleClientSite_OnShowWindow
,
751 OleClientSite_RequestNewObjectLayout
753 static const IOleContainerVtbl OleContainer_vtbl
= {
754 OleContainer_QueryInterface
,
756 OleContainer_Release
,
757 OleContainer_ParseDisplayName
,
758 OleContainer_EnumObjects
,
759 OleContainer_LockContainer
761 static const IOleInPlaceSiteWindowlessVtbl OleInPlaceSiteWindowless_vtbl
= {
762 OleInPlaceSiteWindowless_QueryInterface
,
763 OleInPlaceSiteWindowless_AddRef
,
764 OleInPlaceSiteWindowless_Release
,
765 OleInPlaceSiteWindowless_GetWindow
,
766 OleInPlaceSiteWindowless_ContextSensitiveHelp
,
767 OleInPlaceSiteWindowless_CanInPlaceActivate
,
768 OleInPlaceSiteWindowless_OnInPlaceActivate
,
769 OleInPlaceSiteWindowless_OnUIActivate
,
770 OleInPlaceSiteWindowless_GetWindowContext
,
771 OleInPlaceSiteWindowless_Scroll
,
772 OleInPlaceSiteWindowless_OnUIDeactivate
,
773 OleInPlaceSiteWindowless_OnInPlaceDeactivate
,
774 OleInPlaceSiteWindowless_DiscardUndoState
,
775 OleInPlaceSiteWindowless_DeactivateAndUndo
,
776 OleInPlaceSiteWindowless_OnPosRectChange
,
777 OleInPlaceSiteWindowless_OnInPlaceActivateEx
,
778 OleInPlaceSiteWindowless_OnInPlaceDeactivateEx
,
779 OleInPlaceSiteWindowless_RequestUIActivate
,
780 OleInPlaceSiteWindowless_CanWindowlessActivate
,
781 OleInPlaceSiteWindowless_GetCapture
,
782 OleInPlaceSiteWindowless_SetCapture
,
783 OleInPlaceSiteWindowless_GetFocus
,
784 OleInPlaceSiteWindowless_SetFocus
,
785 OleInPlaceSiteWindowless_GetDC
,
786 OleInPlaceSiteWindowless_ReleaseDC
,
787 OleInPlaceSiteWindowless_InvalidateRect
,
788 OleInPlaceSiteWindowless_InvalidateRgn
,
789 OleInPlaceSiteWindowless_ScrollRect
,
790 OleInPlaceSiteWindowless_AdjustRect
,
791 OleInPlaceSiteWindowless_OnDefWindowMessage
793 static const IOleInPlaceFrameVtbl OleInPlaceFrame_vtbl
=
795 OleInPlaceFrame_QueryInterface
,
796 OleInPlaceFrame_AddRef
,
797 OleInPlaceFrame_Release
,
798 OleInPlaceFrame_GetWindow
,
799 OleInPlaceFrame_ContextSensitiveHelp
,
800 OleInPlaceFrame_GetBorder
,
801 OleInPlaceFrame_RequestBorderSpace
,
802 OleInPlaceFrame_SetBorderSpace
,
803 OleInPlaceFrame_SetActiveObject
,
804 OleInPlaceFrame_InsertMenus
,
805 OleInPlaceFrame_SetMenu
,
806 OleInPlaceFrame_RemoveMenus
,
807 OleInPlaceFrame_SetStatusText
,
808 OleInPlaceFrame_EnableModeless
,
809 OleInPlaceFrame_TranslateAccelerator
811 static const IOleControlSiteVtbl OleControlSite_vtbl
=
813 OleControlSite_QueryInterface
,
814 OleControlSite_AddRef
,
815 OleControlSite_Release
,
816 OleControlSite_OnControlInfoChanged
,
817 OleControlSite_LockInPlaceActive
,
818 OleControlSite_GetExtendedControl
,
819 OleControlSite_TransformCoords
,
820 OleControlSite_TranslateAccelerator
,
821 OleControlSite_OnFocus
,
822 OleControlSite_ShowPropertyFrame
825 static void IOCS_OnSize( IOCS
* This
, LPCRECT rect
)
831 if ( !This
->control
)
834 inPix
.cx
= rect
->right
- rect
->left
;
835 inPix
.cy
= rect
->bottom
- rect
->top
;
836 AtlPixelToHiMetric( &inPix
, &inHi
);
837 IOleObject_SetExtent( This
->control
, DVASPECT_CONTENT
, &inHi
);
839 if ( This
->fInPlace
)
841 IOleInPlaceObject
*wl
;
843 if ( SUCCEEDED( IOleObject_QueryInterface( This
->control
, &IID_IOleInPlaceObject
, (void**)&wl
) ) )
845 IOleInPlaceObject_SetObjectRects( wl
, rect
, rect
);
846 IOleInPlaceObject_Release( wl
);
851 static void IOCS_OnShow( IOCS
*This
, BOOL fShow
)
853 if (!This
->control
|| This
->fActive
|| !fShow
)
856 This
->fActive
= TRUE
;
859 static void IOCS_OnDraw( IOCS
*This
)
863 if ( !This
->control
|| !This
->fWindowless
)
866 if ( SUCCEEDED( IOleObject_QueryInterface( This
->control
, &IID_IViewObject
, (void**)&view
) ) )
868 HDC dc
= GetDC( This
->hWnd
);
871 rect
.left
= This
->size
.left
; rect
.top
= This
->size
.top
;
872 rect
.bottom
= This
->size
.bottom
; rect
.right
= This
->size
.right
;
874 IViewObject_Draw( view
, DVASPECT_CONTENT
, ~0, NULL
, NULL
, 0, dc
, &rect
, &rect
, NULL
, 0 );
875 IViewObject_Release( view
);
876 ReleaseDC( This
->hWnd
, dc
);
880 static LRESULT
IOCS_OnWndProc( IOCS
*This
, HWND hWnd
, UINT uMsg
, WPARAM wParam
, LPARAM lParam
)
882 WNDPROC OrigWndProc
= This
->OrigWndProc
;
892 SetRect(&r
, 0, 0, LOWORD(lParam
), HIWORD(lParam
));
893 IOCS_OnSize( This
, &r
);
897 IOCS_OnShow( This
, (BOOL
) wParam
);
904 return CallWindowProcW( OrigWndProc
, hWnd
, uMsg
, wParam
, lParam
);
907 static LRESULT CALLBACK
AtlHost_wndproc( HWND hWnd
, UINT wMsg
, WPARAM wParam
, LPARAM lParam
)
909 IOCS
*This
= (IOCS
*) GetPropW( hWnd
, wine_atl_iocsW
);
910 return IOCS_OnWndProc( This
, hWnd
, wMsg
, wParam
, lParam
);
913 static HRESULT
IOCS_Attach( IOCS
*This
, HWND hWnd
, IUnknown
*pUnkControl
) /* subclass hWnd */
916 IUnknown_QueryInterface( pUnkControl
, &IID_IOleObject
, (void**)&This
->control
);
917 IOleObject_SetClientSite( This
->control
, &This
->IOleClientSite_iface
);
918 SetPropW( hWnd
, wine_atl_iocsW
, This
);
919 This
->OrigWndProc
= (WNDPROC
)SetWindowLongPtrW( hWnd
, GWLP_WNDPROC
, (ULONG_PTR
) AtlHost_wndproc
);
924 static HRESULT
IOCS_Init( IOCS
*This
)
927 static const WCHAR AXWIN
[] = {'A','X','W','I','N',0};
929 IOleObject_SetHostNames( This
->control
, AXWIN
, AXWIN
);
931 GetClientRect( This
->hWnd
, &rect
);
932 IOCS_OnSize( This
, &rect
);
933 IOleObject_DoVerb( This
->control
, OLEIVERB_INPLACEACTIVATE
, NULL
, &This
->IOleClientSite_iface
,
934 0, This
->hWnd
, &rect
);
939 /**********************************************************************
940 * Create new instance of Atl host component and attach it to window *
942 static HRESULT
IOCS_Create( HWND hWnd
, IUnknown
*pUnkControl
, IUnknown
**container
)
951 This
= HeapAlloc(GetProcessHeap(), 0, sizeof(IOCS
));
954 return E_OUTOFMEMORY
;
956 This
->IOleClientSite_iface
.lpVtbl
= &OleClientSite_vtbl
;
957 This
->IOleContainer_iface
.lpVtbl
= &OleContainer_vtbl
;
958 This
->IOleInPlaceSiteWindowless_iface
.lpVtbl
= &OleInPlaceSiteWindowless_vtbl
;
959 This
->IOleInPlaceFrame_iface
.lpVtbl
= &OleInPlaceFrame_vtbl
;
960 This
->IOleControlSite_iface
.lpVtbl
= &OleControlSite_vtbl
;
963 This
->OrigWndProc
= NULL
;
965 This
->fWindowless
= This
->fActive
= This
->fInPlace
= FALSE
;
967 hr
= IOCS_Attach( This
, hWnd
, pUnkControl
);
968 if ( SUCCEEDED( hr
) )
969 hr
= IOCS_Init( This
);
970 if ( SUCCEEDED( hr
) )
971 *container
= (IUnknown
*)&This
->IOleClientSite_iface
;
975 HeapFree(GetProcessHeap(), 0, This
);
982 /***********************************************************************
983 * AtlAxCreateControl [atl100.@]
985 HRESULT WINAPI
AtlAxCreateControl(LPCOLESTR lpszName
, HWND hWnd
,
986 IStream
*pStream
, IUnknown
**ppUnkContainer
)
988 return AtlAxCreateControlEx( lpszName
, hWnd
, pStream
, ppUnkContainer
,
1001 static enum content
get_content_type(LPCOLESTR name
, CLSID
*control_id
)
1003 static const WCHAR mshtml_prefixW
[] = {'m','s','h','t','m','l',':',0};
1004 WCHAR new_urlW
[MAX_PATH
];
1005 DWORD size
= MAX_PATH
;
1007 if (!name
|| !name
[0])
1009 WARN("name %s\n", wine_dbgstr_w(name
));
1013 if (CLSIDFromString(name
, control_id
) == S_OK
||
1014 CLSIDFromProgID(name
, control_id
) == S_OK
)
1017 if (PathIsURLW (name
) ||
1018 UrlApplySchemeW(name
, new_urlW
, &size
, URL_APPLY_GUESSSCHEME
|URL_APPLY_GUESSFILE
) == S_OK
)
1020 *control_id
= CLSID_WebBrowser
;
1024 if (!wcsnicmp(name
, mshtml_prefixW
, 7))
1026 FIXME("mshtml prefix not implemented\n");
1027 *control_id
= CLSID_WebBrowser
;
1034 /***********************************************************************
1035 * AtlAxCreateControlLicEx [atl100.@]
1038 * See http://www.codeproject.com/com/cwebpage.asp for some background
1041 HRESULT WINAPI
AtlAxCreateControlLicEx(LPCOLESTR lpszName
, HWND hWnd
,
1042 IStream
*pStream
, IUnknown
**ppUnkContainer
, IUnknown
**ppUnkControl
,
1043 REFIID iidSink
, IUnknown
*punkSink
, BSTR lic
)
1047 IOleObject
*pControl
;
1048 IUnknown
*pUnkControl
= NULL
;
1049 IPersistStreamInit
*pPSInit
;
1050 IUnknown
*pContainer
= NULL
;
1051 enum content content
;
1053 TRACE("(%s %p %p %p %p %p %p %s)\n", debugstr_w(lpszName
), hWnd
, pStream
,
1054 ppUnkContainer
, ppUnkControl
, iidSink
, punkSink
, debugstr_w(lic
));
1057 FIXME("semi stub\n");
1059 if (ppUnkContainer
) *ppUnkContainer
= NULL
;
1060 if (ppUnkControl
) *ppUnkControl
= NULL
;
1062 content
= get_content_type(lpszName
, &controlId
);
1064 if (content
== IsEmpty
)
1067 if (content
== IsUnknown
)
1068 return CO_E_CLASSSTRING
;
1070 hRes
= CoCreateInstance( &controlId
, 0, CLSCTX_ALL
, &IID_IOleObject
,
1071 (void**) &pControl
);
1072 if ( FAILED( hRes
) )
1074 WARN( "cannot create ActiveX control %s instance - error 0x%08x\n",
1075 debugstr_guid( &controlId
), hRes
);
1079 hRes
= IOleObject_QueryInterface( pControl
, &IID_IPersistStreamInit
, (void**) &pPSInit
);
1080 if ( SUCCEEDED( hRes
) )
1083 IPersistStreamInit_InitNew( pPSInit
);
1085 IPersistStreamInit_Load( pPSInit
, pStream
);
1086 IPersistStreamInit_Release( pPSInit
);
1088 WARN("cannot get IID_IPersistStreamInit out of control\n");
1090 IOleObject_QueryInterface( pControl
, &IID_IUnknown
, (void**) &pUnkControl
);
1091 IOleObject_Release( pControl
);
1094 hRes
= AtlAxAttachControl( pUnkControl
, hWnd
, &pContainer
);
1095 if ( FAILED( hRes
) )
1096 WARN("cannot attach control to window\n");
1098 if ( content
== IsURL
)
1100 IWebBrowser2
*browser
;
1102 hRes
= IOleObject_QueryInterface( pControl
, &IID_IWebBrowser2
, (void**) &browser
);
1104 WARN( "Cannot query IWebBrowser2 interface: %08x\n", hRes
);
1108 IWebBrowser2_put_Visible( browser
, VARIANT_TRUE
); /* it seems that native does this on URL (but do not on MSHTML:! why? */
1110 V_VT(&url
) = VT_BSTR
;
1111 V_BSTR(&url
) = SysAllocString( lpszName
);
1113 hRes
= IWebBrowser2_Navigate2( browser
, &url
, NULL
, NULL
, NULL
, NULL
);
1114 if ( FAILED( hRes
) )
1115 WARN( "IWebBrowser2::Navigate2 failed: %08x\n", hRes
);
1116 SysFreeString( V_BSTR(&url
) );
1118 IWebBrowser2_Release( browser
);
1124 *ppUnkContainer
= pContainer
;
1126 IUnknown_AddRef( pContainer
);
1130 *ppUnkControl
= pUnkControl
;
1132 IUnknown_AddRef( pUnkControl
);
1136 IUnknown_Release( pUnkControl
);
1138 IUnknown_Release( pContainer
);
1143 /***********************************************************************
1144 * AtlAxAttachControl [atl100.@]
1146 HRESULT WINAPI
AtlAxAttachControl(IUnknown
*control
, HWND hWnd
, IUnknown
**container
)
1150 TRACE("(%p %p %p)\n", control
, hWnd
, container
);
1153 return E_INVALIDARG
;
1155 hr
= IOCS_Create( hWnd
, control
, container
);
1156 return hWnd
? hr
: S_FALSE
;
1159 /**********************************************************************
1160 * Helper function for AX_ConvertDialogTemplate
1162 static inline BOOL
advance_array(WORD
**pptr
, DWORD
*palloc
, DWORD
*pfilled
, const WORD
*data
, DWORD size
)
1164 if ( (*pfilled
+ size
) > *palloc
)
1166 *palloc
= ((*pfilled
+size
) + 0xFF) & ~0xFF;
1167 *pptr
= HeapReAlloc( GetProcessHeap(), 0, *pptr
, *palloc
* sizeof(WORD
) );
1171 RtlMoveMemory( *pptr
+*pfilled
, data
, size
* sizeof(WORD
) );
1176 /**********************************************************************
1177 * Convert ActiveX control templates to AtlAxWin class instances
1179 static LPDLGTEMPLATEW
AX_ConvertDialogTemplate(LPCDLGTEMPLATEW src_tmpl
)
1181 #define GET_WORD(x) (*(const WORD *)(x))
1182 #define GET_DWORD(x) (*(const DWORD *)(x))
1183 #define PUT_BLOCK(x,y) do {if (!advance_array(&output, &allocated, &filled, (x), (y))) return NULL;} while (0)
1184 #define PUT_WORD(x) do {WORD w = (x);PUT_BLOCK(&w, 1);} while(0)
1185 const WORD
*tmp
, *src
= (const WORD
*)src_tmpl
;
1187 DWORD allocated
, filled
; /* in WORDs */
1189 WORD signature
, dlgver
, rescount
;
1192 filled
= 0; allocated
= 256;
1193 output
= HeapAlloc( GetProcessHeap(), 0, allocated
* sizeof(WORD
) );
1199 signature
= GET_WORD(src
);
1200 dlgver
= GET_WORD(src
+ 1);
1201 if (signature
== 1 && dlgver
== 0xFFFF)
1205 style
= GET_DWORD(src
);
1207 rescount
= GET_WORD(src
++);
1209 if ( GET_WORD(src
) == 0xFFFF ) /* menu */
1212 src
+= lstrlenW(src
) + 1;
1213 if ( GET_WORD(src
) == 0xFFFF ) /* class */
1216 src
+= lstrlenW(src
) + 1;
1217 src
+= lstrlenW(src
) + 1; /* title */
1218 if ( style
& (DS_SETFONT
| DS_SHELLFONT
) )
1221 src
+= lstrlenW(src
) + 1;
1225 style
= GET_DWORD(src
);
1227 rescount
= GET_WORD(src
++);
1229 if ( GET_WORD(src
) == 0xFFFF ) /* menu */
1232 src
+= lstrlenW(src
) + 1;
1233 if ( GET_WORD(src
) == 0xFFFF ) /* class */
1236 src
+= lstrlenW(src
) + 1;
1237 src
+= lstrlenW(src
) + 1; /* title */
1238 if ( style
& DS_SETFONT
)
1241 src
+= lstrlenW(src
) + 1;
1244 PUT_BLOCK(tmp
, src
-tmp
);
1248 src
= (const WORD
*)( ( ((ULONG_PTR
)src
) + 3) & ~3); /* align on DWORD boundary */
1249 filled
= (filled
+ 1) & ~1; /* depends on DWORD-aligned allocation unit */
1256 PUT_BLOCK(tmp
, src
-tmp
);
1259 if ( GET_WORD(src
) == 0xFFFF ) /* class */
1264 src
+= lstrlenW(src
) + 1;
1266 src
+= lstrlenW(src
) + 1; /* title */
1267 if ( GET_WORD(tmp
) == '{' ) /* all this mess created because of this line */
1269 static const WCHAR AtlAxWin
[] = {'A','t','l','A','x','W','i','n', 0};
1270 PUT_BLOCK(AtlAxWin
, ARRAY_SIZE(AtlAxWin
));
1271 PUT_BLOCK(tmp
, lstrlenW(tmp
)+1);
1273 PUT_BLOCK(tmp
, src
-tmp
);
1275 if ( GET_WORD(src
) )
1277 WORD size
= (GET_WORD(src
)+sizeof(WORD
)-1) / sizeof(WORD
); /* quite ugly :( Maybe use BYTE* instead of WORD* everywhere ? */
1278 PUT_BLOCK(src
, size
);
1287 return (LPDLGTEMPLATEW
) output
;
1290 /***********************************************************************
1291 * AtlAxCreateDialogA [atl100.@]
1293 * Creates a dialog window
1296 * hInst [I] Application instance
1297 * name [I] Dialog box template name
1298 * owner [I] Dialog box parent HWND
1299 * dlgProc [I] Dialog box procedure
1300 * param [I] This value will be passed to dlgProc as WM_INITDIALOG's message lParam
1303 * Window handle of dialog window.
1305 HWND WINAPI
AtlAxCreateDialogA(HINSTANCE hInst
, LPCSTR name
, HWND owner
, DLGPROC dlgProc
,LPARAM param
)
1311 if (IS_INTRESOURCE(name
))
1312 return AtlAxCreateDialogW( hInst
, (LPCWSTR
) name
, owner
, dlgProc
, param
);
1314 length
= MultiByteToWideChar( CP_ACP
, 0, name
, -1, NULL
, 0 );
1315 nameW
= HeapAlloc( GetProcessHeap(), 0, length
* sizeof(WCHAR
) );
1318 MultiByteToWideChar( CP_ACP
, 0, name
, -1, nameW
, length
);
1319 res
= AtlAxCreateDialogW( hInst
, nameW
, owner
, dlgProc
, param
);
1320 HeapFree( GetProcessHeap(), 0, nameW
);
1325 /***********************************************************************
1326 * AtlAxCreateDialogW [atl100.@]
1328 * See AtlAxCreateDialogA
1331 HWND WINAPI
AtlAxCreateDialogW(HINSTANCE hInst
, LPCWSTR name
, HWND owner
, DLGPROC dlgProc
,LPARAM param
)
1335 LPCDLGTEMPLATEW ptr
;
1336 LPDLGTEMPLATEW newptr
;
1339 TRACE("(%p %s %p %p %lx)\n", hInst
, debugstr_w(name
), owner
, dlgProc
, param
);
1341 hrsrc
= FindResourceW( hInst
, name
, (LPWSTR
)RT_DIALOG
);
1344 hgl
= LoadResource (hInst
, hrsrc
);
1347 ptr
= LockResource ( hgl
);
1350 FreeResource( hgl
);
1353 newptr
= AX_ConvertDialogTemplate( ptr
);
1356 res
= CreateDialogIndirectParamW( hInst
, newptr
, owner
, dlgProc
, param
);
1357 HeapFree( GetProcessHeap(), 0, newptr
);
1360 FreeResource ( hrsrc
);
1364 /***********************************************************************
1365 * AtlAxGetHost [atl100.@]
1368 HRESULT WINAPI
AtlAxGetHost(HWND hWnd
, IUnknown
**host
)
1372 TRACE("(%p, %p)\n", hWnd
, host
);
1376 This
= (IOCS
*) GetPropW( hWnd
, wine_atl_iocsW
);
1379 WARN("No container attached to %p\n", hWnd
);
1383 return IOleClientSite_QueryInterface(&This
->IOleClientSite_iface
, &IID_IUnknown
, (void**)host
);
1386 /***********************************************************************
1387 * AtlAxGetControl [atl100.@]
1390 HRESULT WINAPI
AtlAxGetControl(HWND hWnd
, IUnknown
**pUnk
)
1394 TRACE( "(%p, %p)\n", hWnd
, pUnk
);
1398 This
= (IOCS
*) GetPropW( hWnd
, wine_atl_iocsW
);
1399 if ( !This
|| !This
->control
)
1401 WARN("No control attached to %p\n", hWnd
);
1405 return IOleObject_QueryInterface( This
->control
, &IID_IUnknown
, (void**) pUnk
);
1408 /***********************************************************************
1409 * AtlAxDialogBoxW [atl100.35]
1412 INT_PTR WINAPI
AtlAxDialogBoxW(HINSTANCE hInstance
, LPCWSTR lpTemplateName
, HWND hWndParent
, DLGPROC lpDialogProc
,
1415 FIXME("(%p %s %p %p %lx)\n", hInstance
, debugstr_w(lpTemplateName
), hWndParent
, lpDialogProc
, dwInitParam
);
1419 /***********************************************************************
1420 * AtlAxDialogBoxA [atl100.36]
1423 INT_PTR WINAPI
AtlAxDialogBoxA(HINSTANCE hInstance
, LPCSTR lpTemplateName
, HWND hWndParent
, DLGPROC lpDialogProc
,
1426 FIXME("(%p %s %p %p %lx)\n", hInstance
, debugstr_a(lpTemplateName
), hWndParent
, lpDialogProc
, dwInitParam
);
1430 /***********************************************************************
1431 * AtlAxCreateControlLic [atl100.59]
1434 HRESULT WINAPI
AtlAxCreateControlLic(const WCHAR
*lpTricsData
, HWND hwnd
, IStream
*stream
, IUnknown
**container
, BSTR lic
)
1436 return AtlAxCreateControlLicEx(lpTricsData
, hwnd
, stream
, container
, NULL
, NULL
, NULL
, lic
);
1439 /***********************************************************************
1440 * AtlAxCreateControlEx [atl100.@]
1443 HRESULT WINAPI
AtlAxCreateControlEx(const WCHAR
*lpTricsData
, HWND hwnd
, IStream
*stream
,
1444 IUnknown
**container
, IUnknown
**control
, REFIID iidSink
, IUnknown
*punkSink
)
1446 return AtlAxCreateControlLicEx(lpTricsData
, hwnd
, stream
, container
, control
, iidSink
, punkSink
, NULL
);