Jacek Caban : hhctrl.ocx: Move doWinMain to hhctrl.c.

Alexandre Julliard julliard at wine.codeweavers.com
Wed Feb 28 08:19:09 CST 2007


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

Author: Jacek Caban <jacek at codeweavers.com>
Date:   Wed Feb 28 03:49:20 2007 +0100

hhctrl.ocx: Move doWinMain to hhctrl.c.

---

 dlls/hhctrl.ocx/help.c   |   31 +++----------------------------
 dlls/hhctrl.ocx/hhctrl.c |   28 ++++++++++++++++++++++++++++
 dlls/hhctrl.ocx/hhctrl.h |    4 ++++
 3 files changed, 35 insertions(+), 28 deletions(-)

diff --git a/dlls/hhctrl.ocx/help.c b/dlls/hhctrl.ocx/help.c
index 770b69a..14382c8 100644
--- a/dlls/hhctrl.ocx/help.c
+++ b/dlls/hhctrl.ocx/help.c
@@ -57,7 +57,7 @@ static LPWSTR HH_LoadString(DWORD dwID)
     return string;
 }
 
-static BOOL NavigateToChm(HHInfo *info, LPCWSTR file, LPCWSTR index)
+BOOL NavigateToChm(HHInfo *info, LPCWSTR file, LPCWSTR index)
 {
     WCHAR buf[INTERNET_MAX_URL_LENGTH];
     WCHAR full_path[MAX_PATH];
@@ -764,7 +764,7 @@ static BOOL CreateViewer(HHInfo *pHHInfo)
     return TRUE;
 }
 
-static void ReleaseHelpViewer(HHInfo *info)
+void ReleaseHelpViewer(HHInfo *info)
 {
     if (!info)
         return;
@@ -790,7 +790,7 @@ static void ReleaseHelpViewer(HHInfo *info)
     OleUninitialize();
 }
 
-static HHInfo *CreateHelpViewer(LPCWSTR filename)
+HHInfo *CreateHelpViewer(LPCWSTR filename)
 {
     HHInfo *info = hhctrl_alloc_zero(sizeof(HHInfo));
 
@@ -814,28 +814,3 @@ static HHInfo *CreateHelpViewer(LPCWSTR filename)
 
     return info;
 }
-
-/* FIXME: Check szCmdLine for bad arguments */
-int WINAPI doWinMain(HINSTANCE hInstance, LPSTR szCmdLine)
-{
-    MSG msg;
-    HHInfo *info;
-    LPWSTR filename = strdupAtoW(szCmdLine);
-
-    info = CreateHelpViewer(filename);
-    hhctrl_free(filename);
-    if(!info)
-        return -1;
-
-    NavigateToChm(info, info->pCHMInfo->szFile, info->WinType.pszFile);
-    
-    while (GetMessageW(&msg, 0, 0, 0))
-    {
-        TranslateMessage(&msg);
-        DispatchMessageW(&msg);
-    }
-
-    ReleaseHelpViewer(info);
-
-    return 0;
-}
diff --git a/dlls/hhctrl.ocx/hhctrl.c b/dlls/hhctrl.ocx/hhctrl.c
index 18e769f..15e38ef 100644
--- a/dlls/hhctrl.ocx/hhctrl.c
+++ b/dlls/hhctrl.ocx/hhctrl.c
@@ -135,3 +135,31 @@ HWND WINAPI HtmlHelpA(HWND caller, LPCSTR filename, UINT command, DWORD data)
     hhctrl_free(wfile);
     return result;
 }
+
+/******************************************************************
+ *		doWinMain (hhctrl.ocx.13)
+ */
+int WINAPI doWinMain(HINSTANCE hInstance, LPSTR szCmdLine)
+{
+    MSG msg;
+    HHInfo *info;
+    LPWSTR filename = strdupAtoW(szCmdLine);
+
+    /* FIXME: Check szCmdLine for bad arguments */
+    info = CreateHelpViewer(filename);
+    hhctrl_free(filename);
+    if(!info)
+        return -1;
+
+    NavigateToChm(info, info->pCHMInfo->szFile, info->WinType.pszFile);
+
+    while (GetMessageW(&msg, 0, 0, 0))
+    {
+        TranslateMessage(&msg);
+        DispatchMessageW(&msg);
+    }
+
+    ReleaseHelpViewer(info);
+
+    return 0;
+}
diff --git a/dlls/hhctrl.ocx/hhctrl.h b/dlls/hhctrl.ocx/hhctrl.h
index 5d2bb0f..9f2a9fa 100644
--- a/dlls/hhctrl.ocx/hhctrl.h
+++ b/dlls/hhctrl.ocx/hhctrl.h
@@ -80,6 +80,10 @@ CHMInfo *OpenCHM(LPCWSTR szFile);
 BOOL LoadWinTypeFromCHM(CHMInfo *pCHMInfo, HH_WINTYPEW *pHHWinType);
 CHMInfo *CloseCHM(CHMInfo *pCHMInfo);
 
+HHInfo *CreateHelpViewer(LPCWSTR);
+void ReleaseHelpViewer(HHInfo*);
+BOOL NavigateToChm(HHInfo*,LPCWSTR,LPCWSTR);
+
 /* memory allocation functions */
 
 static inline void *hhctrl_alloc(size_t len)




More information about the wine-cvs mailing list