Andrey Turkin : atl: Implement AtlAxWinInit and AtlAxWin window procedure.

Alexandre Julliard julliard at wine.codeweavers.com
Thu Nov 2 15:47:57 CST 2006


Module: wine
Branch: master
Commit: 2d9fc5d7b595541e318965825fb2dbfc7888c78c
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=2d9fc5d7b595541e318965825fb2dbfc7888c78c

Author: Andrey Turkin <pancha at mail.nnov.ru>
Date:   Mon Oct 30 19:07:46 2006 +0300

atl: Implement AtlAxWinInit and AtlAxWin window procedure.

---

 dlls/atl/Makefile.in |    1 +
 dlls/atl/atl_ax.c    |   99 ++++++++++++++++++++++++++++++++++++++++++++++++++
 dlls/atl/atl_main.c  |   15 --------
 3 files changed, 100 insertions(+), 15 deletions(-)

diff --git a/dlls/atl/Makefile.in b/dlls/atl/Makefile.in
index fc20950..24a8d88 100644
--- a/dlls/atl/Makefile.in
+++ b/dlls/atl/Makefile.in
@@ -8,6 +8,7 @@ IMPORTS   = ole32 shlwapi user32 gdi32 a
 EXTRALIBS = -luuid
 
 C_SRCS = \
+	atl_ax.c \
 	atl_main.c \
 	registrar.c
 
diff --git a/dlls/atl/atl_ax.c b/dlls/atl/atl_ax.c
new file mode 100644
index 0000000..660e001
--- /dev/null
+++ b/dlls/atl/atl_ax.c
@@ -0,0 +1,99 @@
+/*
+ * Active Template Library ActiveX functions (atl.dll)
+ *
+ * Copyright 2006 Andrey Turkin
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+#include <stdarg.h>
+#include <stdio.h>
+
+#define COBJMACROS
+
+#include "windef.h"
+#include "winbase.h"
+#include "winuser.h"
+#include "winerror.h"
+#include "winuser.h"
+#include "wine/debug.h"
+#include "objbase.h"
+#include "objidl.h"
+#include "ole2.h"
+#include "exdisp.h"
+#include "atlbase.h"
+#include "atliface.h"
+#include "atlwin.h"
+
+#include "wine/unicode.h"
+
+WINE_DEFAULT_DEBUG_CHANNEL(atl);
+
+/**********************************************************************
+ * AtlAxWin class window procedure
+ */
+LRESULT static 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 );
+            AtlAxCreateControl( ptr, hWnd, NULL, NULL );
+            HeapFree( GetProcessHeap(), 0, ptr );
+            return 0;
+    }
+    return DefWindowProcW( hWnd, wMsg, wParam, lParam );
+}
+
+/***********************************************************************
+ *           AtlAxWinInit          [ATL.@]
+ * Initializes the control-hosting code: registering the AtlAxWin, 
+ * AtlAxWin7 and AtlAxWinLic7 window classes and some messages.
+ *
+ * RETURNS
+ *  TRUE or FALSE
+ */
+ 
+BOOL WINAPI AtlAxWinInit(void)
+{
+    WNDCLASSEXW wcex;
+    const WCHAR AtlAxWin[] = {'A','t','l','A','x','W','i','n',0};
+
+    FIXME("semi-stub\n");
+
+    if ( FAILED( OleInitialize(NULL) ) )
+        return FALSE;
+
+    wcex.cbSize        = sizeof(wcex);
+    wcex.style         = 0;
+    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;
+}
diff --git a/dlls/atl/atl_main.c b/dlls/atl/atl_main.c
index f7a6fc4..6c72289 100644
--- a/dlls/atl/atl_main.c
+++ b/dlls/atl/atl_main.c
@@ -180,21 +180,6 @@ HRESULT WINAPI AtlModuleUnregisterServer
     return S_OK;
 }
 
-/***********************************************************************
- *           AtlAxWinInit          [ATL.@]
- * Initializes the control-hosting code: registering the AtlAxWin7 and AtlAxWinLic7 window
- * classes and some messages.
- *  
- * RETURNS
- *  TRUE or FALSE
- */
-
-BOOL WINAPI AtlAxWinInit(void)
-{
-    FIXME("Try use native atl.dll if possible\n");
-    return FALSE;
-}
-
 
 IUnknown* WINAPI AtlComPtrAssign(IUnknown** pp, IUnknown *p)
 {




More information about the wine-cvs mailing list