Author: janderwald
Date: Wed Apr 4 22:43:24 2007
New Revision: 26263
URL:
http://svn.reactos.org/svn/reactos?rev=26263&view=rev
Log:
- move implementation of dialogs to appropiate file (odbccp32.dll)
- odbccp32.cpl is therefore complete YUHU
- rbuild needs to be hacked that odbccp32.cpl is outputed in the right destination folder
(currently it writes into destination of odbccp32.dll)
Removed:
trunk/reactos/dll/cpl/odbccp32/about.c
trunk/reactos/dll/cpl/odbccp32/drivers.c
trunk/reactos/dll/cpl/odbccp32/dsn.c
trunk/reactos/dll/cpl/odbccp32/lang/
trunk/reactos/dll/cpl/odbccp32/pool.c
trunk/reactos/dll/cpl/odbccp32/resource.h
trunk/reactos/dll/cpl/odbccp32/rsrc.rc
trunk/reactos/dll/cpl/odbccp32/trace.c
Modified:
trunk/reactos/dll/cpl/odbccp32/odbccp32.c
trunk/reactos/dll/cpl/odbccp32/odbccp32.h
trunk/reactos/dll/cpl/odbccp32/odbccp32.rbuild
trunk/reactos/dll/cpl/odbccp32/odbccp32.rc
Removed: trunk/reactos/dll/cpl/odbccp32/about.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/odbccp32/about.c?r…
==============================================================================
--- trunk/reactos/dll/cpl/odbccp32/about.c (original)
+++ trunk/reactos/dll/cpl/odbccp32/about.c (removed)
@@ -1,23 +1,0 @@
-/* $Id$
- *
- * PROJECT: ReactOS ODBC Control Panel Applet
- * FILE: lib/cpl/main/main.c
- * PURPOSE: ODBC about dialog
- * PROGRAMMER: Johannes Anderwald
- */
-
-#include "odbccp32.h"
-
-INT_PTR
-CALLBACK
-AboutProc(IN HWND hwndDlg,
- IN UINT uMsg,
- IN WPARAM wParam,
- IN LPARAM lParam)
-{
-
-
-
-
- return FALSE;
-}
Removed: trunk/reactos/dll/cpl/odbccp32/drivers.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/odbccp32/drivers.c…
==============================================================================
--- trunk/reactos/dll/cpl/odbccp32/drivers.c (original)
+++ trunk/reactos/dll/cpl/odbccp32/drivers.c (removed)
@@ -1,23 +1,0 @@
-/* $Id: odbccp32.c 22979 2006-07-09 21:10:40Z fireball $
- *
- * PROJECT: ReactOS ODBC Control Panel Applet
- * FILE: lib/cpl/main/main.c
- * PURPOSE: ODBC drivers dialog
- * PROGRAMMER: Johannes Anderwald
- */
-
-#include "odbccp32.h"
-
-INT_PTR
-CALLBACK
-DriversProc(IN HWND hwndDlg,
- IN UINT uMsg,
- IN WPARAM wParam,
- IN LPARAM lParam)
-{
-
-
-
-
- return FALSE;
-}
Removed: trunk/reactos/dll/cpl/odbccp32/dsn.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/odbccp32/dsn.c?rev…
==============================================================================
--- trunk/reactos/dll/cpl/odbccp32/dsn.c (original)
+++ trunk/reactos/dll/cpl/odbccp32/dsn.c (removed)
@@ -1,51 +1,0 @@
-/* $Id$
- *
- * PROJECT: ReactOS ODBC Control Panel Applet
- * FILE: lib/cpl/main/main.c
- * PURPOSE: ODBC DSN functions
- * PROGRAMMER: Johannes Anderwald
- */
-
-#include "odbccp32.h"
-
-INT_PTR
-CALLBACK
-UserDSNProc(IN HWND hwndDlg,
- IN UINT uMsg,
- IN WPARAM wParam,
- IN LPARAM lParam)
-{
-
-
-
-
- return FALSE;
-}
-
-INT_PTR
-CALLBACK
-SystemDSNProc(IN HWND hwndDlg,
- IN UINT uMsg,
- IN WPARAM wParam,
- IN LPARAM lParam)
-{
-
-
-
-
- return FALSE;
-}
-
-INT_PTR
-CALLBACK
-FileDSNProc(IN HWND hwndDlg,
- IN UINT uMsg,
- IN WPARAM wParam,
- IN LPARAM lParam)
-{
-
-
-
-
- return FALSE;
-}
Modified: trunk/reactos/dll/cpl/odbccp32/odbccp32.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/odbccp32/odbccp32.…
==============================================================================
--- trunk/reactos/dll/cpl/odbccp32/odbccp32.c (original)
+++ trunk/reactos/dll/cpl/odbccp32/odbccp32.c Wed Apr 4 22:43:24 2007
@@ -8,59 +8,9 @@
#include "odbccp32.h"
-HINSTANCE hApplet = 0;
-
-VOID
-InitPropSheetPage(PROPSHEETPAGE *psp, WORD idDlg, DLGPROC DlgProc)
-{
- ZeroMemory(psp, sizeof(PROPSHEETPAGE));
-
- psp->dwSize = sizeof(PROPSHEETPAGE);
- psp->dwFlags = PSP_DEFAULT;
- psp->hInstance = hApplet;
- psp->pszTemplate = MAKEINTRESOURCE(idDlg);
- psp->pfnDlgProc = DlgProc;
-}
-
-
-LONG
-APIENTRY
-AppletProc(HWND hwnd, UINT uMsg, LONG wParam, LONG lParam)
-{
- PROPSHEETPAGE psp[7];
- PROPSHEETHEADER psh;
- TCHAR szBuffer[256];
-
- UNREFERENCED_PARAMETER(lParam);
- UNREFERENCED_PARAMETER(wParam);
- UNREFERENCED_PARAMETER(uMsg);
- UNREFERENCED_PARAMETER(hwnd);
-
- ZeroMemory(&psh, sizeof(PROPSHEETHEADER));
- psh.dwFlags = PSH_PROPSHEETPAGE;
- psh.dwSize = sizeof(PROPSHEETHEADER);
- psh.hwndParent = NULL;
- psh.hInstance = hApplet;
- psh.hIcon = LoadIcon(hApplet, MAKEINTRESOURCE(IDC_CPLICON));
- psh.nStartPage = 0;
- psh.ppsp = psp;
- psh.nPages = sizeof(psp) / sizeof(PROPSHEETPAGE);
-
- if (LoadString(hApplet, IDS_CPLNAME, szBuffer, sizeof(szBuffer) / sizeof(TCHAR)) <
256)
- {
- psh.dwFlags |= PSH_PROPTITLE;
- psh.pszCaption = szBuffer;
- }
-
- InitPropSheetPage(&psp[0], IDD_USERDSN, UserDSNProc);
- InitPropSheetPage(&psp[1], IDD_SYSTEMDSN, SystemDSNProc);
- InitPropSheetPage(&psp[2], IDD_FILEDSN, FileDSNProc);
- InitPropSheetPage(&psp[3], IDD_DRIVERS, DriversProc);
- InitPropSheetPage(&psp[4], IDD_CONNTRACE, TraceProc);
- InitPropSheetPage(&psp[5], IDD_CONNPOOL, PoolProc);
- InitPropSheetPage(&psp[6], IDD_ABOUT, AboutProc);
- return (LONG)(PropertySheet(&psh) != -1);
-}
+HINSTANCE hApplet = NULL;
+APPLET_PROC ODBCProc = NULL;
+HMODULE hLibrary = NULL;
LONG
@@ -70,32 +20,36 @@
LPARAM lParam1,
LPARAM lParam2)
{
- switch(uMsg)
+ if (ODBCProc == NULL)
{
- case CPL_INIT:
- return TRUE;
+ TCHAR szBuffer[MAX_PATH];
- case CPL_GETCOUNT:
- return 1;
+ if (ExpandEnvironmentStrings(_T("%systemroot%\\system32\\odbccp32.dll"),
+ szBuffer,
+ sizeof(szBuffer) / sizeof(TCHAR)) > 0)
+ {
+ hLibrary = LoadLibrary(szBuffer);
+ if (hLibrary)
+ {
+ ODBCProc = (APPLET_PROC)GetProcAddress(hLibrary, "ODBCCPlApplet");
+ }
+ }
+ }
- case CPL_INQUIRE:
+ if (ODBCProc)
+ {
+ return ODBCProc(hwndCpl, uMsg, lParam1, lParam2);
+ }
+ else
+ {
+ if(hLibrary)
{
- CPLINFO *CPlInfo = (CPLINFO*)lParam2;
-
- CPlInfo->lData = lParam1;
- CPlInfo->idIcon = CPL_ICON;
- CPlInfo->idName = CPL_NAME;
- CPlInfo->idInfo = CPL_INFO;
- break;
+ FreeLibrary(hLibrary);
}
- case CPL_DBLCLK:
- {
- AppletProc(hwndCpl, uMsg, lParam1, lParam2);
- break;
- }
+ TerminateProcess(GetCurrentProcess(), -1);
+ return (LONG)-1;
}
- return FALSE;
}
Modified: trunk/reactos/dll/cpl/odbccp32/odbccp32.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/odbccp32/odbccp32.…
==============================================================================
--- trunk/reactos/dll/cpl/odbccp32/odbccp32.h (original)
+++ trunk/reactos/dll/cpl/odbccp32/odbccp32.h Wed Apr 4 22:43:24 2007
@@ -6,61 +6,7 @@
#include <cpl.h>
#include <tchar.h>
-#include "resource.h"
-
extern HINSTANCE hApplet;
-
-INT_PTR
-CALLBACK
-UserDSNProc(IN HWND hwndDlg,
- IN UINT uMsg,
- IN WPARAM wParam,
- IN LPARAM lParam);
-
-INT_PTR
-CALLBACK
-SystemDSNProc(IN HWND hwndDlg,
- IN UINT uMsg,
- IN WPARAM wParam,
- IN LPARAM lParam);
-
-INT_PTR
-CALLBACK
-FileDSNProc(IN HWND hwndDlg,
- IN UINT uMsg,
- IN WPARAM wParam,
- IN LPARAM lParam);
-
-
-INT_PTR
-CALLBACK
-DriversProc(IN HWND hwndDlg,
- IN UINT uMsg,
- IN WPARAM wParam,
- IN LPARAM lParam);
-
-INT_PTR
-CALLBACK
-TraceProc(IN HWND hwndDlg,
- IN UINT uMsg,
- IN WPARAM wParam,
- IN LPARAM lParam);
-
-
-INT_PTR
-CALLBACK
-PoolProc(IN HWND hwndDlg,
- IN UINT uMsg,
- IN WPARAM wParam,
- IN LPARAM lParam);
-
-INT_PTR
-CALLBACK
-AboutProc(IN HWND hwndDlg,
- IN UINT uMsg,
- IN WPARAM wParam,
- IN LPARAM lParam);
-
-
+extern HMODULE hLibrary;
#endif /* end of ODBCCP32_H__ */
Modified: trunk/reactos/dll/cpl/odbccp32/odbccp32.rbuild
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/odbccp32/odbccp32.…
==============================================================================
--- trunk/reactos/dll/cpl/odbccp32/odbccp32.rbuild (original)
+++ trunk/reactos/dll/cpl/odbccp32/odbccp32.rbuild Wed Apr 4 22:43:24 2007
@@ -12,10 +12,5 @@
<library>comctl32</library>
<library>msvcrt</library>
<file>odbccp32.c</file>
- <file>dsn.c</file>
- <file>trace.c</file>
- <file>pool.c</file>
- <file>about.c</file>
- <file>drivers.c</file>
<file>odbccp32.rc</file>
</module>
Modified: trunk/reactos/dll/cpl/odbccp32/odbccp32.rc
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/odbccp32/odbccp32.…
==============================================================================
--- trunk/reactos/dll/cpl/odbccp32/odbccp32.rc (original)
+++ trunk/reactos/dll/cpl/odbccp32/odbccp32.rc Wed Apr 4 22:43:24 2007
@@ -7,7 +7,3 @@
#define REACTOS_STR_INTERNAL_NAME "odbccp32\0"
#define REACTOS_STR_ORIGINAL_FILENAME "odbccp32.cpl\0"
#include <reactos/version.rc>
-
-
-
-#include "rsrc.rc"
Removed: trunk/reactos/dll/cpl/odbccp32/pool.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/odbccp32/pool.c?re…
==============================================================================
--- trunk/reactos/dll/cpl/odbccp32/pool.c (original)
+++ trunk/reactos/dll/cpl/odbccp32/pool.c (removed)
@@ -1,23 +1,0 @@
-/* $Id$
- *
- * PROJECT: ReactOS ODBC Control Panel Applet
- * FILE: lib/cpl/main/main.c
- * PURPOSE: ODBC pool functions
- * PROGRAMMER: Johannes Anderwald
- */
-
-#include "odbccp32.h"
-
-INT_PTR
-CALLBACK
-PoolProc(IN HWND hwndDlg,
- IN UINT uMsg,
- IN WPARAM wParam,
- IN LPARAM lParam)
-{
-
-
-
-
- return FALSE;
-}
Removed: trunk/reactos/dll/cpl/odbccp32/resource.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/odbccp32/resource.…
==============================================================================
--- trunk/reactos/dll/cpl/odbccp32/resource.h (original)
+++ trunk/reactos/dll/cpl/odbccp32/resource.h (removed)
@@ -1,54 +1,0 @@
-#ifndef RESOURCE_H__ //resource.h
-#define RESOURCE_H__
-
-//
-/// dialog constants
-///
-#define IDD_USERDSN 100
-#define IDD_SYSTEMDSN 101
-#define IDD_FILEDSN 102
-#define IDD_DRIVERS 103
-#define IDD_CONNTRACE 104
-#define IDD_CONNPOOL 105
-#define IDD_ABOUT 106
-
-#define IDC_CPLICON 150
-#define IDS_CPLNAME 151
-#define CPL_ICON 152
-#define CPL_NAME 153
-#define CPL_INFO 154
-
-///
-/// User DSN dialog constants
-///
-
-#define IDC_USERDSN_ADD 200
-#define IDC_USERDSN_REMOVE 201
-#define IDC_USERDSN_CONFIGURE 202
-
-///
-/// System DSN dialog constants
-///
-
-///
-/// File DSN dialog constants
-///
-
-///
-/// Drivers dialog constants
-///
-
-///
-/// Trace dialog constants
-///
-
-///
-/// Connection pooling dialog constants
-///
-
-///
-/// About dialog constants
-///
-
-
-#endif /* end of RESOURCE_H__ */
Removed: trunk/reactos/dll/cpl/odbccp32/rsrc.rc
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/odbccp32/rsrc.rc?r…
==============================================================================
--- trunk/reactos/dll/cpl/odbccp32/rsrc.rc (original)
+++ trunk/reactos/dll/cpl/odbccp32/rsrc.rc (removed)
@@ -1,7 +1,0 @@
-#include <windows.h>
-#include <commctrl.h>
-#include "resource.h"
-
-LANGUAGE LANG_NEUTRAL, SUBLANG_NEUTRAL
-
-#include "lang/en-US.rc"
Removed: trunk/reactos/dll/cpl/odbccp32/trace.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/odbccp32/trace.c?r…
==============================================================================
--- trunk/reactos/dll/cpl/odbccp32/trace.c (original)
+++ trunk/reactos/dll/cpl/odbccp32/trace.c (removed)
@@ -1,23 +1,0 @@
-/* $Id$
- *
- * PROJECT: ReactOS ODBC Control Panel Applet
- * FILE: lib/cpl/main/main.c
- * PURPOSE: ODBC trace functions
- * PROGRAMMER: Johannes Anderwald
- */
-
-#include "odbccp32.h"
-
-INT_PTR
-CALLBACK
-TraceProc(IN HWND hwndDlg,
- IN UINT uMsg,
- IN WPARAM wParam,
- IN LPARAM lParam)
-{
-
-
-
-
- return FALSE;
-}