0

我将 EASendEmail 与 Visual C++ 一起使用。编译并运行代码后,我收到一条错误消息:“调试错误!/Program:[file path] /abort() has been called/ (press retry to debug the application)”

代码来自这个网站:https ://www.emailarchitect.net/easeendmail/kb/vc.aspx?cat=0

错误发生在 lins 中:

oSmtp->LicenseCode = _T("TryIt");

'

_tprintf(_T("Start to send email ...\r\n"));

我在 Visual Studio 中尝试过调试模式,它导致我在附加库中出现未处理的表达式,并在特定内存位置出现错误。

C++

#include "pch.h"
#include "easendmailobj.tlh"
#include <tchar.h>
#include <iostream>
using namespace std;
using namespace EASendMailObjLib;
int _tmain(int argc, _TCHAR* argv[])
{

    ::CoInitialize(NULL);
    IMailPtr oSmtp = NULL;
    oSmtp.CreateInstance("EASendMailObj.Mail");//<- one cause of the error
    oSmtp->LicenseCode = _T("TryIt");
    //...
    _tprintf(_T("Start to send email ...\r\n"));//<- one cause of the error

错误:https ://imgur.com/a/M3C72Kc

4

0 回答 0