ReactOS Fundraising Campaign 2012
 
€ 4,410 / € 30,000

Information | Donate

Home | Info | Community | Development | myReactOS | Contact Us

  1. Home
  2. Community
  3. Development
  4. myReactOS
  5. Fundraiser 2012

  1. Main Page
  2. Alphabetical List
  3. Data Structures
  4. Directories
  5. File List
  6. Data Fields
  7. Globals
  8. Related Pages

ReactOS Development > Doxygen

odbccp32.c
Go to the documentation of this file.
00001 /* $Id: odbccp32.c 54535 2011-11-29 14:55:58Z dgorbachev $
00002  *
00003  * PROJECT:         ReactOS ODBC Control Panel Applet
00004  * FILE:            dll/cpl/main/main.c
00005  * PURPOSE:         applet initialization
00006  * PROGRAMMER:      Johannes Anderwald
00007  */
00008 
00009 #include "odbccp32.h"
00010 
00011 HINSTANCE hApplet = NULL;
00012 APPLET_PROC ODBCProc = NULL;
00013 HMODULE hLibrary = NULL;
00014 
00015 
00016 LONG
00017 CALLBACK
00018 CPlApplet(HWND hwndCpl,
00019           UINT uMsg,
00020           LPARAM lParam1,
00021           LPARAM lParam2)
00022 {
00023     if (ODBCProc == NULL)
00024     {
00025         TCHAR szBuffer[MAX_PATH];
00026 
00027         if (ExpandEnvironmentStrings(_T("%systemroot%\\system32\\odbccp32.dll"),
00028                                      szBuffer,
00029                                      sizeof(szBuffer) / sizeof(TCHAR)) > 0)
00030         {
00031             hLibrary = LoadLibrary(szBuffer);
00032             if (hLibrary)
00033             {
00034                 ODBCProc = (APPLET_PROC)GetProcAddress(hLibrary, "ODBCCPlApplet");
00035             }
00036         }
00037     }
00038 
00039     if (ODBCProc)
00040     {
00041         return ODBCProc(hwndCpl, uMsg, lParam1, lParam2);
00042     }
00043     else
00044     {
00045         if(hLibrary)
00046         {
00047             FreeLibrary(hLibrary);
00048         }
00049 
00050         TerminateProcess(GetCurrentProcess(), -1);
00051         return (LONG)-1;
00052     }
00053 }
00054 
00055 
00056 BOOL
00057 WINAPI
00058 DllMain(HINSTANCE hinstDLL,
00059         DWORD dwReason,
00060         LPVOID lpReserved)
00061 {
00062     INITCOMMONCONTROLSEX InitControls;
00063     UNREFERENCED_PARAMETER(lpReserved);
00064 
00065     switch(dwReason)
00066     {
00067         case DLL_PROCESS_ATTACH:
00068         case DLL_THREAD_ATTACH:
00069 
00070             InitControls.dwSize = sizeof(INITCOMMONCONTROLSEX);
00071             InitControls.dwICC = ICC_LISTVIEW_CLASSES | ICC_UPDOWN_CLASS | ICC_BAR_CLASSES;
00072             InitCommonControlsEx(&InitControls);
00073 
00074             hApplet = hinstDLL;
00075             break;
00076   }
00077 
00078   return TRUE;
00079 }

Generated on Fri May 25 2012 04:19:05 for ReactOS by doxygen 1.7.6.1

ReactOS is a registered trademark or a trademark of ReactOS Foundation in the United States and other countries.