C++:使用 pstsdk 时获取 "error C2065: ' pst':未声明的标识符?

标签 c++ visual-studio-2010 unmanaged managed-c++ pst

按照此问题中使用 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)

他们都同意我只需要在为 Boostpstsdk 正确添加包含路径后包含 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/

相关文章:

c++ - 一旦到达主函数末尾,就会发生调试运行时堆栈错误

c++ - 符号文件 MyFile.pdb 与模块不匹配

c++ - 十六进制字符到十进制并将输出存储为字符

c++ - 静态类成员的初始化。为什么要构造函数?

c++ - 私有(private)数据类与成员变量

c++ - 从源代码编译 Inkscape 时出错

asp.net - 是否可以在 Visual Studio 2010 中调用 SSRS 2008 R2 报告?

visual-studio-2010 - VS 2010不加载PDB

c# - 了解 C# 中的非托管关键字

.net - 为什么由 blittable 类型参数化的泛型结构不是非托管类型?