C++:收到“错误 C2065:'pst”; :未声明的标识符”使用 pstsdk 时?

发布于 2024-10-10 22:38:27 字数 1561 浏览 3 评论 0原文

遵循此问题中使用 pstsdk 的建议:
处理 Microsoft Office Outlook 2003/2007 电子邮件...

以及以下内容此处的说明:
PST 文件格式 SDK - PST 层概述 - 入门

并且根据此视频:
在 PST SDK 演示中,Terry Mahaffey 讨论了 PST SDK文件格式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));
    }

现在我收到以下错误:

错误 C3859:超出 PCH 的虚拟内存范围;请使用“-Zm111”或更高的命令行选项重新编译

错误 C1076:编译器限制:达到内部堆限制;使用 /Zm 指定更高的限制

我绝对没想到会发生这些。如何解决?

Following the suggestion of working with the pstsdk in this question:
Processing Microsoft Office Outlook 2003/2007 email messages…

And following the instructions here:
PST File Format SDK - PST Layer Overview - Getting Started

And also according to this video:
In PST SDK Presentation, Terry Mahaffey, discusses the PST SDK file format SDK.
(Forward it to 28:32)

They all agree that I only have to include the PST header file after having properly added the include paths for both Boost and pstsdk, and to write the following code to start working with my pst file:

#include "pst.h"

pst myfile(L"myfile.pst");

Now, I'm using a mix of managed and unmanaged C++, hence I'm trying to put this code in my function like so:

private: 
    System::Void readPstFileButton_Click(System::Object^  sender, System::EventArgs^  e) {
        pst myfile(fileNameTextBox->Text);
    }

And everytime I compile, I get the c2065 error code that says the pst is undeclared.

Any clue anyone?

EDIT #1

After I have done as suggested by Hans Passant (which works), my code now looks like this:

private:
    System::Void readPstFileButton_Click(System::Object^  sender, System::EventArgs^  e) {
         pstsdk::pst myfile(marshal_as<std::wstring>(fileNameTextBox->Text));
    }

And I now get the following errors:

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

I definitely didn't expect these to occur. How to solve them?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

鲜血染红嫁衣 2024-10-17 22:38:27

它应该在命名空间中声明。使固定:

 pstsdk::pst myfile(fileNameTextBox->Text);

It is declared in a namespace, as it should. Fix:

 pstsdk::pst myfile(fileNameTextBox->Text);
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文