home *** CD-ROM | disk | FTP | other *** search
/ Microsoft Internet Business Development Kit / PRODUCT_CD.iso / sqlsvr / esqlc / esql / samples.c / edblib.h < prev    next >
Encoding:
C/C++ Source or Header  |  1995-12-29  |  2.8 KB  |  77 lines

  1. //////////////////////////////////////////////////////////////////////////////
  2. //
  3. //  FILE: edblib.h
  4. //
  5. //      Header for generic Embedded SQL for C Win16/Win32 program
  6. //
  7. //  COMMENTS:
  8. //
  9. //      Copyright (C) 1992 - 1994 Microsoft Corporation
  10. //
  11. //////////////////////////////////////////////////////////////////////////////
  12.  
  13. // control IDs
  14. #define IDM_FILE_CONNECT                101
  15. #define IDM_FILE_EXIT                   102
  16. #define IDM_HELP_ABOUT                  103
  17. #define IDM_FILE_QUERY                  104
  18. #define IDE_EDIT                        1001
  19. #define IDC_SERVER                      1002
  20. #define IDC_LOGIN                       1003
  21. #define IDC_PASSWORD                    1004
  22. #define IDC_DATABASE                    1005
  23. #define IDC_PLATFORM                    1006
  24. #define IDC_VERSION                     1007
  25. #define IDC_LASTNAME                    1008
  26. #define IDC_STATIC                      -1
  27.  
  28. // get these from C run-time
  29. extern int __argc;
  30. extern char** __argv;
  31. extern char** _environ;
  32.  
  33. #define MSGBOX(a,b) \
  34.     MessageBeep(MB_ICONASTERISK); \
  35.     MessageBox(a,b,"Message",MB_OK | MB_ICONASTERISK);
  36. #define ERRBOX(a,b) \
  37.     MessageBeep(MB_ICONHAND); \
  38.     MessageBox(a,b,"Error",MB_OK | MB_ICONHAND);
  39.  
  40. #if defined (_WIN32)
  41. // Win32
  42. #define GET_WM_COMMAND_ID(wp, lp)       LOWORD(wp)
  43. #define GET_WM_COMMAND_HWND(wp, lp)     (HWND)(lp)
  44. #define GET_WM_COMMAND_NOTIFY(wp, lp)   HIWORD(wp)
  45. #define Post_WM_COMMAND(hwnd, id, notify, hwndChild) \
  46.         PostMessage(hwnd,WM_COMMAND,(WPARAM)MAKELONG(id,notify),(LPARAM)hwndChild)
  47. #define EXPORT
  48. #define OS_STRING                       "for Windows NT"
  49. #else
  50. // Win16
  51. #define GET_WM_COMMAND_ID(wp, lp)       (wp)
  52. #define GET_WM_COMMAND_HWND(wp, lp)     (HWND)LOWORD(lp)
  53. #define GET_WM_COMMAND_NOTIFY(wp, lp)   HIWORD(lp)
  54. #define Post_WM_COMMAND(hwnd, id, notify, hwndChild) \
  55.         PostMessage(hwnd,WM_COMMAND,(WPARAM)id, MAKELPARAM(hwndChild, notify))
  56. #define EXPORT                          __export
  57. #define OS_STRING                       "for Windows"
  58. #endif
  59.  
  60. // maximum SQL Server identifier length
  61. #define SQLID_MAX 30
  62.  
  63. #define WM_CONNECTTOSQLSERVER       WM_USER
  64. #define WM_QUERYSQLSERVER           WM_USER+1
  65.  
  66. // function prototypes
  67. int WINAPI WinMain (HINSTANCE, HINSTANCE, LPSTR, int);
  68. LRESULT CALLBACK MainWndProc (HWND, UINT, WPARAM, LPARAM);
  69. BOOL CALLBACK ConnectDlgProc (HWND, UINT, WPARAM, LPARAM);
  70. BOOL CALLBACK QueryDlgProc (HWND, UINT, WPARAM, LPARAM);
  71. BOOL CALLBACK AboutDlgProc (HWND, UINT, WPARAM, LPARAM);
  72. BOOL ConnectToSQLServer (LPSTR, LPSTR, LPSTR, LPSTR);
  73. BOOL QuerySQLServer (void);
  74. void ErrorHandler (void);
  75. int FAR EXPORT DblibErrorHandler (PDBPROCESS, int, int, int, LPCSTR, LPCSTR);
  76. int FAR EXPORT DblibMessageHandler (PDBPROCESS, DBINT, int, int, LPCSTR);
  77.