C ++:获取“错误C2065:'pst':未声明的标识符"在使用pstsdk时? [英] C++: Getting the "error C2065: 'pst' : undeclared identifier" while using pstsdk?

查看:174
本文介绍了C ++:获取“错误C2065:'pst':未声明的标识符"在使用pstsdk时?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在以下问题中,建议与 pstsdk 一起使用:
正在处理Microsoft Office Outlook 2003/2007电子邮件…

并按照此处的说明进行操作:
PST文件格式SDK-PST层概述-入门

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

我现在收到以下错误:

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

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

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

解决方案

应在命名空间中声明它.修复:

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

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?

解决方案

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

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

这篇关于C ++:获取“错误C2065:'pst':未声明的标识符"在使用pstsdk时?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆