articleevents.cpp

来自「Visual_C++[1].NET_Bible1 Visual_C++宝典书中」· C++ 代码 · 共 28 行

CPP
28
字号
// ArticleEvents.cpp : Implementation of CArticleEvents

#include "stdafx.h"
#include "ArticleEvents.h"
#include <comdef.h>

// CArticleEvents


STDMETHODIMP CArticleEvents::NewArticle(BSTR* pbstrAuthor, BSTR* pbstrTitle, BSTR* pbstrUrl, SHORT sCategory)
{
  AFX_MANAGE_STATE(AfxGetStaticModuleState());

  CString strAuthor = (LPCTSTR)_bstr_t(*pbstrAuthor, false);
  CString strTitle = (LPCTSTR)_bstr_t(*pbstrTitle, false);
  CString strUrl = (LPCTSTR)_bstr_t(*pbstrUrl, false);

  CString strNewArticle;
  strNewArticle.Format("NEW ARTICLE:\n"
    "Author: %s\n"
    "Title: %s\n"
    "URL: %s\n",
    strAuthor, strTitle, strUrl);
  AfxMessageBox(strNewArticle);

  return S_OK;
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?