home *** CD-ROM | disk | FTP | other *** search
/ Tricks of the Windows Gam…ming Gurus (2nd Edition) / Disc2.iso / msdn_vcb / samples / vc98 / atl / atlduck / duck / duckint.cpp < prev    next >
C/C++ Source or Header  |  1998-03-26  |  1KB  |  61 lines

  1. // duckint.cpp: Implementation of CDuckInt
  2. //
  3. // This is a part of the Active Template Library.
  4. // Copyright (C) 1996-1998 Microsoft Corporation
  5. // All rights reserved.
  6. //
  7. // This source code is only intended as a supplement to the
  8. // Active Template Library Reference and related
  9. // electronic documentation provided with the library.
  10. // See these sources for detailed information regarding the
  11. // Active Template Library product.
  12.  
  13. #include "stdafx.h"
  14. #include "resource.h"
  15. #include "duckint.h"
  16. #include "mydlg.h"
  17.  
  18. extern CMyDlg mydlg;
  19.  
  20. static void ShowStatus(LPCTSTR szWhosCalling)
  21. {
  22.     HWND hwndStatus = mydlg.GetDlgItem(IDC_STATUS);
  23.     ::SetWindowText(hwndStatus, szWhosCalling);
  24. }
  25.  
  26. STDMETHODIMP CDuckInt::Quack(BSTR szWhosCalling)
  27. {
  28.     USES_CONVERSION;
  29.  
  30.     LPTSTR szCaller = OLE2T(szWhosCalling);
  31.     ShowStatus(szCaller);
  32.     return S_OK;
  33. }
  34.  
  35. STDMETHODIMP CDuckInt::Flap(BSTR szWhosCalling)
  36. {
  37.     USES_CONVERSION;
  38.  
  39.     LPTSTR szCaller = OLE2T(szWhosCalling);
  40.     ShowStatus(szCaller);
  41.     return S_OK;
  42. }
  43.  
  44. STDMETHODIMP CDuckInt::Paddle(BSTR szWhosCalling)
  45. {
  46.     USES_CONVERSION;
  47.  
  48.     LPTSTR szCaller = OLE2T(szWhosCalling);
  49.     ShowStatus(szCaller);
  50.     return S_OK;
  51. }
  52.  
  53. STDMETHODIMP CDuckInt::Walk(BSTR szWhosCalling)
  54. {
  55.     USES_CONVERSION;
  56.  
  57.     LPTSTR szCaller = OLE2T(szWhosCalling);
  58.     ShowStatus(szCaller);
  59.     return S_OK;
  60. }
  61.