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?
error C2664: 'pstsdk::pst::pst(const std::wstring &)' : cannot convert parameter 1 from 'System::String ^' to 'const std::wstring &'
. I understand that is a fact of mixing managed and unmanaged C++, but I don't seem to be able to type cast in anyway. – Popelka