按照此问题中使用 pstsdk 的建议:
Processing Microsoft Office Outlook 2003/2007 email messages…
并按照此处的说明操作:
PST File Format SDK - PST Layer Overview - Getting Started
还有根据这个视频:
In PST SDK Presentation, Terry Mahaffey, discusses the PST SDK file format SDK.
(转发到28:32)
他们都同意我只需要在为 Boost 和 pstsdk 正确添加包含路径后包含 PST 头文件,并将以下代码写入开始使用我的 pst 文件:
#include "pst.h"
pst myfile(L"myfile.pst");
现在,我混合使用托管和非托管 C++,因此我尝试将此代码放入我的函数中,如下所示:
private:
System::Void readPstFileButton_Click(System::Object^ sender, System::EventArgs^ e) {
pst myfile(fileNameTextBox->Text);
}
每次编译时,我都会收到 c2065 错误代码,指出 pst
未声明。
有任何线索吗?
编辑#1
按照 Hans Passant 的建议(可行)完成后,我的代码现在如下所示:
private:
System::Void readPstFileButton_Click(System::Object^ sender, System::EventArgs^ e) {
pstsdk::pst myfile(marshal_as<std::wstring>(fileNameTextBox->Text));
}
现在我得到以下错误:
error C3859: virtual memory range for PCH exceeded; please recompile with a command line option of '-Zm111' or greater
error C1076: compiler limit : internal heap limit reached; use /Zm to specify a higher limit
我绝对没想到会发生这些。如何解决?
最佳答案
它应该在命名空间中声明。修复:
pstsdk::pst myfile(fileNameTextBox->Text);
关于C++:使用 pstsdk 时获取 "error C2065: ' pst':未声明的标识符?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4594640/