notes c api

这是代码:

环境:bookmark.ntf 已经放在了C:/Program Files/lotus/notes/data目录下.
初始化函数报错:unhandled exception in NLSCCSTR.DLL 0xc0000005

#include <iostream.h>
#include <lncppapi.h>

#define ERR_BUF_SIZE 512

int main(int argc,char* argv[])
{
const char * DbFilename="bookmark.ntf";
const char * DbServer;

LNNotesSession Session;
LNDatabase Db;
LNString DbTitle;
/*
// Check the command line.
if (argc < 2 || argc > 3)
{
cout << "/nUsage:/n/t" << argv[0] << " <filename> [<server>] /n" << endl;
return (1);
}

// Get info from command line.
DbFilename = argv[1];

if (argc == 3)
DbServer = argv[2];
*/
// Make the error handler throw all errors encountered during execution.
LNSetThrowAllErrors(TRUE);

try
{
// Initialize the C++ API
Session.Init();  


// Get the specified database.
Session.GetDatabase(DbFilename, &Db);

// Open sesame.
Db.Open();

// Get the database's title.
DbTitle = Db.GetTitle();

// Display it.
cout << "The database title is: " << DbTitle << endl;
}

// Error handler. If an error occurred, get the text of
// the error message and display it.
catch (LNSTATUS Lnerror)
{
char ErrorBuf[ERR_BUF_SIZE];
LNGetErrorMessage(Lnerror, ErrorBuf, ERR_BUF_SIZE);
cout << "Error: " << ErrorBuf << endl;
}

// Close sesame.
Db.Close();

// Terminate the API.
Session.Term();

// Ciao, baby!
return (0);
}

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值