|
|
1.1 ! root 1: /************************************************************************* ! 2: ** ! 3: ** OLE 2 Sample Code ! 4: ** ! 5: ** debug.c ! 6: ** ! 7: ** This file contains some functions for debugging support ! 8: ** ! 9: ** (c) Copyright Microsoft Corp. 1992 - 1993 All Rights Reserved ! 10: ** ! 11: *************************************************************************/ ! 12: ! 13: #include "outline.h" ! 14: ! 15: OLEDBGDATA ! 16: ! 17: extern LPOUTLINEAPP g_lpApp; ! 18: ! 19: void SetDebugLevelCommand(void) ! 20: { ! 21: char szBuf[80]; ! 22: HWND hWndFrame = OutlineApp_GetFrameWindow(g_lpApp); ! 23: ! 24: wsprintf(szBuf, "%d", OleDbgGetDbgLevel()); ! 25: ! 26: if (InputTextDlg(hWndFrame, szBuf, "Debug Level [0-4]")) { ! 27: switch (szBuf[0]) { ! 28: case '0': ! 29: OleDbgSetDbgLevel(0); ! 30: break; ! 31: case '1': ! 32: OleDbgSetDbgLevel(1); ! 33: break; ! 34: case '2': ! 35: OleDbgSetDbgLevel(2); ! 36: break; ! 37: case '3': ! 38: OleDbgSetDbgLevel(3); ! 39: break; ! 40: case '4': ! 41: OleDbgSetDbgLevel(4); ! 42: break; ! 43: default: ! 44: OutlineApp_ErrorMessage(g_lpApp, "Valid Debug Level Range: 0-4"); ! 45: break; ! 46: } ! 47: } ! 48: } ! 49: ! 50: ! 51: #if defined( OLE_VERSION ) ! 52: ! 53: /* InstallMessageFilterCommand ! 54: * --------------------------- ! 55: * ! 56: * Handles the "Install Message Filter" menu item. If a message filter is ! 57: * already installed, this function de-installs it. If there is not one ! 58: * already installed, this function installs one. ! 59: * ! 60: */ ! 61: ! 62: void InstallMessageFilterCommand(void) ! 63: { ! 64: LPOLEAPP lpOleApp = (LPOLEAPP)g_lpApp; ! 65: ! 66: /* ! 67: ** Check to see if we've already installed a MessageFilter. ! 68: ** If so, uninstall it. ! 69: */ ! 70: if (lpOleApp->m_lpMsgFilter != NULL) ! 71: OleApp_RevokeMessageFilter(lpOleApp); ! 72: else ! 73: OleApp_RegisterMessageFilter(lpOleApp); ! 74: } ! 75: ! 76: ! 77: /* RejectIncomingCommand ! 78: * --------------------- ! 79: * ! 80: * Toggles between rejecting and not-handling in coming LRPC calls ! 81: * ! 82: */ ! 83: ! 84: void RejectIncomingCommand(void) ! 85: { ! 86: DWORD dwOldStatus; ! 87: DWORD dwNewStatus; ! 88: LPOLEAPP lpOleApp = (LPOLEAPP)g_lpApp; ! 89: ! 90: dwOldStatus = OleStdMsgFilter_GetInComingCallStatus(lpOleApp->m_lpMsgFilter); ! 91: ! 92: if (dwOldStatus == SERVERCALL_RETRYLATER) ! 93: dwNewStatus = SERVERCALL_ISHANDLED; ! 94: else ! 95: dwNewStatus = SERVERCALL_RETRYLATER; ! 96: ! 97: OleStdMsgFilter_SetInComingCallStatus(lpOleApp->m_lpMsgFilter, dwNewStatus); ! 98: } ! 99: ! 100: #endif // OLE_VERSION ! 101: ! 102:
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.