袁绍伦
路人甲
路人甲
  • 注册日期2003-08-08
  • 发帖数654
  • QQ164646905
  • 铜币1336枚
  • 威望0点
  • 贡献值0点
  • 银元0个
阅读:1511回复:0

C++ Example of a NotesView Dataset

楼主#
更多 发布于:2003-09-03 21:38


void CMapXView::OnNotesView() {
 CMapXDataset ds;
 CMapXNotesViewInfo NVI;
 COleVariant nviVt;
 COptionalVariant optVt;

 try {
  NVI.CreateDispatch(NVI.GetClsid());

  // Change this to point to the appropriate server and
  // database; a sample database is included on the MapX CD.
  // Leave the server field empty if accessing a local
  // database.
  NVI.SetServer("");
  NVI.SetDatabase("C:\\Windows\\Desktop\\LotusNotes\\Notesamp.nsf");
  NVI.SetView("NS View");

  nviVt.vt = VT_DISPATCH;
  nviVt.pdispVal = NVI.m_lpDispatch;
  nviVt.pdispVal->AddRef();

  // Create the dataset and add a simple theme
  ds = m_ctrlMapX.GetDatasets().Add(miDataSetNotesView, nviVt, COleVariant("NotesDS"),
   COleVariant("State"), optVt, optVt, optVt, optVt);

  ds.GetThemes().Add(miThemeRanged, "value", "NotesThematic");
 } catch (COleDispatchException *e) {
  e->ReportError();
  e->Delete();
 } catch (COleException *e) {
  e->ReportError();

  e->Delete();
 }
}

喜欢0 评分0
愿意和大家交朋友! QQ:47559983 MSN:shaolun_yuan@hotmail.com eMail:shaolun-yuan@163.com
游客

返回顶部