home *** CD-ROM | disk | FTP | other *** search
/ High Voltage Shareware / high1.zip / high1 / DIR41 / AUTOCTRL.ZIP / AUTOCTRL.H < prev    next >
C/C++ Source or Header  |  1993-10-25  |  3KB  |  70 lines

  1. #include <ole2.h>
  2. #include <dispatch.h> 
  3. #include <olenls.h>
  4.  
  5. // Dialog IDs
  6. #define IDD_CREATEOBJECT  100
  7. #define IDD_SETPROPERTY   101
  8. #define IDD_GETPROPERTY   102
  9. #define IDD_INVOKEMETHOD  103
  10.  
  11. // Control IDs
  12. #define IDC_NAME        200
  13. #define IDC_VALUE       201
  14. #define IDC_ENGLISH     202
  15. #define IDC_FRENCH      203
  16. #define IDC_GERMAN      204
  17. #define IDC_STRING      205
  18. #define IDC_INT         206
  19. #define IDC_REAL        207
  20. #define IDC_RETURNVALUE 208
  21.  
  22. // Menu-item IDs
  23. #define IDM_CREATEOBJECT  300
  24. #define IDM_SETPROPERTY   301
  25. #define IDM_GETPROPERTY   302
  26. #define IDM_INVOKEMETHOD  303
  27. #define IDM_RELEASEOBJECT 304    
  28.  
  29. // MAX len of string table entries
  30. #define STR_LEN   100
  31.  
  32. // String table constants
  33. #define IDS_PROGNAME                   1
  34. #define IDS_CANNOTDISPLAYRETURNVALUE   2
  35. #define IDS_ERROR                      3
  36.  
  37. // Locale IDs for the languages that are supported
  38. #define LCID_ENGLISH MAKELCID(MAKELANGID(0x09, 0x01))
  39. #define LCID_FRENCH  MAKELCID(MAKELANGID(0x0c, 0x01))  
  40. #define LCID_GERMAN  MAKELCID(MAKELANGID(0x07, 0x01))
  41.  
  42. // Function prototypes
  43. int PASCAL WinMain (HINSTANCE, HINSTANCE, LPSTR, int);
  44. BOOL InitApplication (HINSTANCE);
  45. BOOL InitInstance (HINSTANCE, int);
  46. BOOL InitOle(void);
  47. void UninitOle();
  48. LRESULT __export CALLBACK MainWndProc (HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam);
  49.  
  50. BOOL __export CALLBACK CreateObjectDlgFunc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam);
  51. BOOL __export CALLBACK SetPropertyDlgFunc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam);
  52. BOOL __export CALLBACK GetPropertyDlgFunc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam);
  53. BOOL __export CALLBACK InvokeMethodDlgFunc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam);
  54.  
  55. HRESULT CreateObject(LPSTR lpszProgID, IDispatch FAR* FAR* ppdisp);
  56. HRESULT SetProperty(LPSTR lpszPropName, LPSTR lpszValue, VARTYPE vt, LCID lcid, LPDISPATCH pdisp);
  57. HRESULT GetProperty(LPSTR lpszPropName, LCID lcid, LPDISPATCH pdisp);
  58. HRESULT InvokeMethod(LPSTR lpszMethodName, LCID lcid, LPDISPATCH pdisp);
  59. void DisplayReturnValue(LPVARIANTARG lpvarg);
  60. void ReportError(HRESULT hr, LPSTR szFuncName, LPSTR szFileName, int nLineNumber);
  61.  
  62. typedef struct _dlgdata
  63. {
  64.     char    szName[100];        // ProgID, property name or method name.     
  65.     char    szValue[100];       // Property value. Read as a string.
  66.     VARTYPE vt;                 // Property type.
  67.     LCID    lcid;               // Locale ID.
  68. } DLGDATA, FAR* LPDLGDATA;
  69.  
  70.