Commit 383cacea authored by Jacek Caban's avatar Jacek Caban Committed by Alexandre Julliard

atl: Share atl_ax.c with atl100.

parent 29de4d98
...@@ -2,7 +2,10 @@ MODULE = atl.dll ...@@ -2,7 +2,10 @@ MODULE = atl.dll
IMPORTLIB = atl IMPORTLIB = atl
IMPORTS = uuid atl80 atl100 oleaut32 ole32 user32 IMPORTS = uuid atl80 atl100 oleaut32 ole32 user32
EXTRADEFS = -D_ATL_VER=_ATL_VER_30 EXTRADEFS = -D_ATL_VER=_ATL_VER_30
PARENTSRC = ../atl100
C_SRCS = atl_main.c C_SRCS = \
atl_ax.c \
atl_main.c
IDL_SRCS = atl_classes.idl IDL_SRCS = atl_classes.idl
...@@ -26,20 +26,20 @@ ...@@ -26,20 +26,20 @@
31 stdcall AtlComQIPtrAssign(ptr ptr ptr) atl100.AtlComQIPtrAssign 31 stdcall AtlComQIPtrAssign(ptr ptr ptr) atl100.AtlComQIPtrAssign
32 stdcall AtlInternalQueryInterface(ptr ptr ptr ptr) atl100.AtlInternalQueryInterface 32 stdcall AtlInternalQueryInterface(ptr ptr ptr ptr) atl100.AtlInternalQueryInterface
34 stdcall AtlGetVersion(ptr) 34 stdcall AtlGetVersion(ptr)
35 stdcall AtlAxDialogBoxW(long wstr long ptr long) atl100.AtlAxDialogBoxW 35 stdcall AtlAxDialogBoxW(long wstr long ptr long)
36 stdcall AtlAxDialogBoxA(long str long ptr long) atl100.AtlAxDialogBoxA 36 stdcall AtlAxDialogBoxA(long str long ptr long)
37 stdcall AtlAxCreateDialogW(long wstr long ptr long) atl100.AtlAxCreateDialogW 37 stdcall AtlAxCreateDialogW(long wstr long ptr long)
38 stdcall AtlAxCreateDialogA(long str long ptr long) atl100.AtlAxCreateDialogA 38 stdcall AtlAxCreateDialogA(long str long ptr long)
39 stdcall AtlAxCreateControl(ptr ptr ptr ptr) atl100.AtlAxCreateControl 39 stdcall AtlAxCreateControl(ptr ptr ptr ptr)
40 stdcall AtlAxCreateControlEx(ptr ptr ptr ptr ptr ptr ptr) atl100.AtlAxCreateControlEx 40 stdcall AtlAxCreateControlEx(ptr ptr ptr ptr ptr ptr ptr)
41 stdcall AtlAxAttachControl(ptr ptr ptr) atl100.AtlAxAttachControl 41 stdcall AtlAxAttachControl(ptr ptr ptr)
42 stdcall AtlAxWinInit() 42 stdcall AtlAxWinInit()
43 stdcall AtlModuleAddCreateWndData(ptr ptr ptr) 43 stdcall AtlModuleAddCreateWndData(ptr ptr ptr)
44 stdcall AtlModuleExtractCreateWndData(ptr) 44 stdcall AtlModuleExtractCreateWndData(ptr)
45 stdcall AtlModuleRegisterWndClassInfoW(ptr ptr ptr) 45 stdcall AtlModuleRegisterWndClassInfoW(ptr ptr ptr)
46 stdcall AtlModuleRegisterWndClassInfoA(ptr ptr ptr) 46 stdcall AtlModuleRegisterWndClassInfoA(ptr ptr ptr)
47 stdcall AtlAxGetControl(long ptr) atl100.AtlAxGetControl 47 stdcall AtlAxGetControl(long ptr)
48 stdcall AtlAxGetHost(long ptr) atl100.AtlAxGetHost 48 stdcall AtlAxGetHost(long ptr)
49 stdcall AtlRegisterClassCategoriesHelper(ptr ptr long) atl100.AtlRegisterClassCategoriesHelper 49 stdcall AtlRegisterClassCategoriesHelper(ptr ptr long) atl100.AtlRegisterClassCategoriesHelper
50 stdcall AtlIPersistStreamInit_Load(ptr ptr ptr ptr) atl100.AtlIPersistStreamInit_Load 50 stdcall AtlIPersistStreamInit_Load(ptr ptr ptr ptr) atl100.AtlIPersistStreamInit_Load
51 stdcall AtlIPersistStreamInit_Save(ptr long ptr ptr ptr) atl100.AtlIPersistStreamInit_Save 51 stdcall AtlIPersistStreamInit_Save(ptr long ptr ptr ptr) atl100.AtlIPersistStreamInit_Save
......
...@@ -593,51 +593,3 @@ DWORD WINAPI AtlGetVersion(void *pReserved) ...@@ -593,51 +593,3 @@ DWORD WINAPI AtlGetVersion(void *pReserved)
TRACE("version %04x (%p)\n", _ATL_VER, pReserved); TRACE("version %04x (%p)\n", _ATL_VER, pReserved);
return _ATL_VER; return _ATL_VER;
} }
/**********************************************************************
* AtlAxWin class window procedure
*/
static LRESULT CALLBACK AtlAxWin_wndproc( HWND hWnd, UINT wMsg, WPARAM wParam, LPARAM lParam )
{
if ( wMsg == WM_CREATE )
{
DWORD len = GetWindowTextLengthW( hWnd ) + 1;
WCHAR *ptr = HeapAlloc( GetProcessHeap(), 0, len*sizeof(WCHAR) );
if (!ptr)
return 1;
GetWindowTextW( hWnd, ptr, len );
AtlAxCreateControlEx( ptr, hWnd, NULL, NULL, NULL, NULL, NULL );
HeapFree( GetProcessHeap(), 0, ptr );
return 0;
}
return DefWindowProcW( hWnd, wMsg, wParam, lParam );
}
BOOL WINAPI AtlAxWinInit(void)
{
WNDCLASSEXW wcex;
const WCHAR AtlAxWin[] = {'A','t','l','A','x','W','i','n',0};
FIXME("version %04x semi-stub\n", _ATL_VER);
if ( FAILED( OleInitialize(NULL) ) )
return FALSE;
wcex.cbSize = sizeof(wcex);
wcex.style = CS_GLOBALCLASS;
wcex.cbClsExtra = 0;
wcex.cbWndExtra = 0;
wcex.hInstance = GetModuleHandleW( NULL );
wcex.hIcon = NULL;
wcex.hCursor = NULL;
wcex.hbrBackground = NULL;
wcex.lpszMenuName = NULL;
wcex.hIconSm = 0;
wcex.lpfnWndProc = AtlAxWin_wndproc;
wcex.lpszClassName = AtlAxWin;
if ( !RegisterClassExW( &wcex ) )
return FALSE;
return TRUE;
}
...@@ -87,7 +87,9 @@ BOOL WINAPI AtlAxWinInit(void) ...@@ -87,7 +87,9 @@ BOOL WINAPI AtlAxWinInit(void)
{ {
WNDCLASSEXW wcex; WNDCLASSEXW wcex;
#if _ATL_VER == _ATL_VER_80 #if _ATL_VER <= _ATL_VER_30
#define ATL_NAME_SUFFIX 0
#elif _ATL_VER == _ATL_VER_80
#define ATL_NAME_SUFFIX '8','0',0 #define ATL_NAME_SUFFIX '8','0',0
#elif _ATL_VER == _ATL_VER_90 #elif _ATL_VER == _ATL_VER_90
#define ATL_NAME_SUFFIX '9','0',0 #define ATL_NAME_SUFFIX '9','0',0
...@@ -100,7 +102,6 @@ BOOL WINAPI AtlAxWinInit(void) ...@@ -100,7 +102,6 @@ BOOL WINAPI AtlAxWinInit(void)
#endif #endif
const WCHAR AtlAxWinW[] = {'A','t','l','A','x','W','i','n',ATL_NAME_SUFFIX}; const WCHAR AtlAxWinW[] = {'A','t','l','A','x','W','i','n',ATL_NAME_SUFFIX};
const WCHAR AtlAxWinLicW[] = {'A','t','l','A','x','W','i','n','L','i','c',ATL_NAME_SUFFIX};
FIXME("version %04x semi-stub\n", _ATL_VER); FIXME("version %04x semi-stub\n", _ATL_VER);
...@@ -108,7 +109,7 @@ BOOL WINAPI AtlAxWinInit(void) ...@@ -108,7 +109,7 @@ BOOL WINAPI AtlAxWinInit(void)
return FALSE; return FALSE;
wcex.cbSize = sizeof(wcex); wcex.cbSize = sizeof(wcex);
wcex.style = CS_GLOBALCLASS | CS_DBLCLKS; wcex.style = CS_GLOBALCLASS | (_ATL_VER > _ATL_VER_30 ? CS_DBLCLKS : 0);
wcex.cbClsExtra = 0; wcex.cbClsExtra = 0;
wcex.cbWndExtra = 0; wcex.cbWndExtra = 0;
wcex.hInstance = GetModuleHandleW( NULL ); wcex.hInstance = GetModuleHandleW( NULL );
...@@ -123,9 +124,13 @@ BOOL WINAPI AtlAxWinInit(void) ...@@ -123,9 +124,13 @@ BOOL WINAPI AtlAxWinInit(void)
if ( !RegisterClassExW( &wcex ) ) if ( !RegisterClassExW( &wcex ) )
return FALSE; return FALSE;
wcex.lpszClassName = AtlAxWinLicW; if(_ATL_VER > _ATL_VER_30) {
if ( !RegisterClassExW( &wcex ) ) const WCHAR AtlAxWinLicW[] = {'A','t','l','A','x','W','i','n','L','i','c',ATL_NAME_SUFFIX};
return FALSE;
wcex.lpszClassName = AtlAxWinLicW;
if ( !RegisterClassExW( &wcex ) )
return FALSE;
}
return TRUE; return TRUE;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment