home *** CD-ROM | disk | FTP | other *** search
- //////////////////////////////////////////////////////////////////////////////
- //
- // FILE: edblib.h
- //
- // Header for generic Embedded SQL for C Win16/Win32 program
- //
- // COMMENTS:
- //
- // Copyright (C) 1992 - 1994 Microsoft Corporation
- //
- //////////////////////////////////////////////////////////////////////////////
-
- // control IDs
- #define IDM_FILE_CONNECT 101
- #define IDM_FILE_EXIT 102
- #define IDM_HELP_ABOUT 103
- #define IDM_FILE_QUERY 104
- #define IDE_EDIT 1001
- #define IDC_SERVER 1002
- #define IDC_LOGIN 1003
- #define IDC_PASSWORD 1004
- #define IDC_DATABASE 1005
- #define IDC_PLATFORM 1006
- #define IDC_VERSION 1007
- #define IDC_LASTNAME 1008
- #define IDC_STATIC -1
-
- // get these from C run-time
- extern int __argc;
- extern char** __argv;
- extern char** _environ;
-
- #define MSGBOX(a,b) \
- MessageBeep(MB_ICONASTERISK); \
- MessageBox(a,b,"Message",MB_OK | MB_ICONASTERISK);
- #define ERRBOX(a,b) \
- MessageBeep(MB_ICONHAND); \
- MessageBox(a,b,"Error",MB_OK | MB_ICONHAND);
-
- #if defined (_WIN32)
- // Win32
- #define GET_WM_COMMAND_ID(wp, lp) LOWORD(wp)
- #define GET_WM_COMMAND_HWND(wp, lp) (HWND)(lp)
- #define GET_WM_COMMAND_NOTIFY(wp, lp) HIWORD(wp)
- #define Post_WM_COMMAND(hwnd, id, notify, hwndChild) \
- PostMessage(hwnd,WM_COMMAND,(WPARAM)MAKELONG(id,notify),(LPARAM)hwndChild)
- #define EXPORT
- #define OS_STRING "for Windows NT"
- #else
- // Win16
- #define GET_WM_COMMAND_ID(wp, lp) (wp)
- #define GET_WM_COMMAND_HWND(wp, lp) (HWND)LOWORD(lp)
- #define GET_WM_COMMAND_NOTIFY(wp, lp) HIWORD(lp)
- #define Post_WM_COMMAND(hwnd, id, notify, hwndChild) \
- PostMessage(hwnd,WM_COMMAND,(WPARAM)id, MAKELPARAM(hwndChild, notify))
- #define EXPORT __export
- #define OS_STRING "for Windows"
- #endif
-
- // maximum SQL Server identifier length
- #define SQLID_MAX 30
-
- #define WM_CONNECTTOSQLSERVER WM_USER
- #define WM_QUERYSQLSERVER WM_USER+1
-
- // function prototypes
- int WINAPI WinMain (HINSTANCE, HINSTANCE, LPSTR, int);
- LRESULT CALLBACK MainWndProc (HWND, UINT, WPARAM, LPARAM);
- BOOL CALLBACK ConnectDlgProc (HWND, UINT, WPARAM, LPARAM);
- BOOL CALLBACK QueryDlgProc (HWND, UINT, WPARAM, LPARAM);
- BOOL CALLBACK AboutDlgProc (HWND, UINT, WPARAM, LPARAM);
- BOOL ConnectToSQLServer (LPSTR, LPSTR, LPSTR, LPSTR);
- BOOL QuerySQLServer (void);
- void ErrorHandler (void);
- int FAR EXPORT DblibErrorHandler (PDBPROCESS, int, int, int, LPCSTR, LPCSTR);
- int FAR EXPORT DblibMessageHandler (PDBPROCESS, DBINT, int, int, LPCSTR);
-