Will Marcouiller
Will Marcouiller

Reputation: 24132

CLR C++ VS C++ (pstsdk)

Considering Simon Mourier's answer to this question:
Processing Microsoft Office Outlook 2003/2007 email messages…

I plan to use the PST File Format SDK which is written in C++.

I would take this opportunity to learn more about C++ and to renew with it, since it's been quite 15 years since the last time I used it. I have already downloaded and configured Boost 1.45 which is required to work with pstsdk.

Now, I'm currently writing a Windows Forms application using CLR C++ and plan to use the pstsdk to read from PST files.

Does it matter in any way that I'm using both CLR C++ and pure C++ altogether?

Shall I consider using it a different way, or is this okay?

Upvotes: 0

Views: 1108

Answers (3)

Puppy
Puppy

Reputation: 146930

C++/CLI is intended to interop with unmanaged C++- that's pretty much it's entire purpose. However, I feel that it's probably easier to write in C# if you need .NET for, say, WPF, which is an excellent technology, and just use C++/CLI for interop.

Upvotes: 1

Ben Voigt
Ben Voigt

Reputation: 283634

If you want to use a .NET (Windows Forms, or maybe even the newer WPF) user interface, the simplest approach is to build an object model in C++/CLI, implemented in terms of the native code but having a .NET interface.

Then write the UI in C# and call the C++/CLI object model (which differs from using the .NET base class library in only one way -- you have to add a reference to the C++/CLI assembly... but the C++/CLI compiler will create all the metadata that C# uses).

Upvotes: 1

Gene Bushuyev
Gene Bushuyev

Reputation: 5538

You can mix managed and unmanaged code, but it will be a pain to marshal everything except the built-in types across the boundaries. It's much easier to stay with more powerful unmanaged C++. You could use CodeGear C++ Builder for example (or QT). The problem with CodeGear is compiler isn't that great, so you won't be able to compile everything from Boost, but you might not need that.

Upvotes: 1

Related Questions