阅读:1597回复:0
C++ Example of a NotesView Datasetvoid 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(); } } |
|
|