atl110: Trace ATL version.
[wine.git] / dlls / atl110 / atl110.c
blob707b43b2a7aa6b97678de8145521c71ef94a38ac
1 /*
2 * Copyright 2013 Jacek Caban for CodeWeavers
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; either
7 * version 2.1 of the License, or (at your option) any later version.
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Lesser General Public License for more details.
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with this library; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
19 #include <stdarg.h>
20 #include <stdio.h>
22 #define COBJMACROS
24 #include "windef.h"
25 #include "winbase.h"
26 #include "winerror.h"
27 #include "winuser.h"
28 #include "atlbase.h"
30 #include "wine/debug.h"
31 #include "wine/unicode.h"
33 WINE_DEFAULT_DEBUG_CHANNEL(atl);
35 /***********************************************************************
36 * AtlGetVersion [atl110.@]
38 DWORD WINAPI AtlGetVersion(void *pReserved)
40 TRACE("version %04x (%p)\n", _ATL_VER, pReserved);
41 return _ATL_VER;
44 /**********************************************************************
45 * AtlAxWin class window procedure
47 static LRESULT CALLBACK AtlAxWin_wndproc( HWND hWnd, UINT wMsg, WPARAM wParam, LPARAM lParam )
49 if ( wMsg == WM_CREATE )
51 DWORD len = GetWindowTextLengthW( hWnd ) + 1;
52 WCHAR *ptr = HeapAlloc( GetProcessHeap(), 0, len*sizeof(WCHAR) );
53 if (!ptr)
54 return 1;
55 GetWindowTextW( hWnd, ptr, len );
56 AtlAxCreateControlEx( ptr, hWnd, NULL, NULL, NULL, NULL, NULL );
57 HeapFree( GetProcessHeap(), 0, ptr );
58 return 0;
60 return DefWindowProcW( hWnd, wMsg, wParam, lParam );
63 BOOL WINAPI AtlAxWinInit(void)
65 WNDCLASSEXW wcex;
66 const WCHAR AtlAxWin110[] = {'A','t','l','A','x','W','i','n','1','1','0',0};
67 const WCHAR AtlAxWinLic110[] = {'A','t','l','A','x','W','i','n','L','i','c','1','1','0',0};
69 FIXME("version %04x semi-stub\n", _ATL_VER);
71 if ( FAILED( OleInitialize(NULL) ) )
72 return FALSE;
74 wcex.cbSize = sizeof(wcex);
75 wcex.style = CS_GLOBALCLASS | CS_DBLCLKS;
76 wcex.cbClsExtra = 0;
77 wcex.cbWndExtra = 0;
78 wcex.hInstance = GetModuleHandleW( NULL );
79 wcex.hIcon = NULL;
80 wcex.hCursor = NULL;
81 wcex.hbrBackground = NULL;
82 wcex.lpszMenuName = NULL;
83 wcex.hIconSm = 0;
85 wcex.lpfnWndProc = AtlAxWin_wndproc;
86 wcex.lpszClassName = AtlAxWin110;
87 if ( !RegisterClassExW( &wcex ) )
88 return FALSE;
90 wcex.lpszClassName = AtlAxWinLic110;
91 if ( !RegisterClassExW( &wcex ) )
92 return FALSE;
94 return TRUE;