Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

134 lines
2.9 KiB

  1. //+-------------------------------------------------------------------------
  2. //
  3. // Microsoft Windows
  4. // Copyright (C) Microsoft Corporation, 1992 - 1993.
  5. //
  6. // File: tests.c
  7. //
  8. // Contents: unit tests for 32bit OLE
  9. //
  10. // Classes:
  11. //
  12. // Functions: StartClipboardTest1
  13. //
  14. // History: dd-mmm-yy Author Comment
  15. // 16-Jun-94 alexgo author
  16. //
  17. //--------------------------------------------------------------------------
  18. #include "outline.h"
  19. //+-------------------------------------------------------------------------
  20. //
  21. // Function: StartClipboardTest1
  22. //
  23. // Synopsis: copies the loaded object to the clipboard
  24. //
  25. // Effects:
  26. //
  27. // Arguments: void
  28. //
  29. // Requires:
  30. //
  31. // Returns: void
  32. //
  33. // Signals:
  34. //
  35. // Modifies:
  36. //
  37. // Algorithm:
  38. //
  39. // History: dd-mmm-yy Author Comment
  40. // 16-Jun-94 alexgo author
  41. //
  42. // Notes:
  43. //
  44. //--------------------------------------------------------------------------
  45. void StartClipboardTest1( LPOUTLINEAPP lpOutlineApp)
  46. {
  47. static char FileName[] = "letest12.olc";
  48. BOOL fStatus;
  49. HRESULT hresult = ResultFromScode(E_FAIL);
  50. lpOutlineApp->m_lpDoc = OutlineApp_CreateDoc(lpOutlineApp, FALSE);
  51. if (! lpOutlineApp->m_lpDoc)
  52. {
  53. goto errRtn;
  54. }
  55. fStatus = OutlineDoc_LoadFromFile(lpOutlineApp->m_lpDoc,
  56. FileName);
  57. if( !fStatus )
  58. {
  59. hresult = ResultFromScode(STG_E_FILENOTFOUND);
  60. goto errRtn;
  61. }
  62. // position and size the new doc window
  63. OutlineApp_ResizeWindows(lpOutlineApp);
  64. OutlineDoc_ShowWindow(lpOutlineApp->m_lpDoc);
  65. // we post a message here to give outline a chance to setup its
  66. // UI before we do the copy.
  67. UpdateWindow(lpOutlineApp->m_hWndApp);
  68. OutlineDoc_SelectAllCommand(lpOutlineApp->m_lpDoc);
  69. PostMessage(lpOutlineApp->m_hWndApp, WM_TEST2, 0, 0);
  70. return;
  71. errRtn:
  72. // we should abort if error
  73. PostMessage(g_hwndDriver, WM_TESTEND, TEST_FAILURE, hresult);
  74. PostMessage(lpOutlineApp->m_hWndApp, WM_SYSCOMMAND, SC_CLOSE, 0L);
  75. }
  76. //+-------------------------------------------------------------------------
  77. //
  78. // Function: ContinueClipboardTest1
  79. //
  80. // Synopsis: finishes up the clipboard test
  81. //
  82. // Effects:
  83. //
  84. // Arguments:
  85. //
  86. // Requires:
  87. //
  88. // Returns:
  89. //
  90. // Signals:
  91. //
  92. // Modifies:
  93. //
  94. // Algorithm:
  95. //
  96. // History: dd-mmm-yy Author Comment
  97. // 16-Jun-94 alexgo author
  98. // Notes:
  99. //
  100. //--------------------------------------------------------------------------
  101. void ContinueClipboardTest1( LPOUTLINEAPP lpOutlineApp )
  102. {
  103. OutlineDoc_CopyCommand(lpOutlineApp->m_lpDoc);
  104. OleApp_FlushClipboard((LPOLEAPP)lpOutlineApp);
  105. //flushing will make the app dirty, just reset that here ;-)
  106. lpOutlineApp->m_lpDoc->m_fModified = FALSE;
  107. PostMessage(g_hwndDriver, WM_TEST1, NOERROR, 0);
  108. PostMessage(lpOutlineApp->m_hWndApp, WM_SYSCOMMAND, SC_CLOSE, 0L);
  109. }