Quantcast
Channel: Visual Studio Integrate forum
Viewing all articles
Browse latest Browse all 4410

How to create a Visual C++ project using VCProjectEngine starting with Visual Studio 2010?

$
0
0

So, the question is already in the title, but let me detail it a bit more, because I suspect that I will get pointers to malfunctioning "options" (of which I have tried loads) otherwise. In the past it would be possible to use the COM interfaceVCProjectEngine along with other interfaces to generate a Visual C++ project from scratch. Yes, there are actually some of us that try to do it the right way.

Anyway, starting with Visual Studio 2010 this functionality is - according to MS employees, but not the official documentation - no longer supported. You can enjoy my cross-referencing write-uphere since MS is apparently too shy to admit they screwed up by changing the semantics of aninterface. Something that, as every decent developer knows, is a big NO NO.

Anyway, so it has happened and the workaround that one has to collect in an hour-long odyssey of web search and reading documentation doesn't work (also mentioned in the above linked write-up). And yes, the documentation in this regard is severely lacking and apparently whoever decided that with VS 2010 and later it's not allowed to instantiate it directly, quote:

You cannot instantiate a stand-alone VCProjectEngine object because additional binaries must be deployed in the folder that contains the application. Instead, obtain aVCProjectEngine object from a project that has been opened in Visual Studio.

forgot to mention an alternative route. Because at the top of the very same documentation page we get to read (underline mine):

The only Visual C++ project model object that can be returned byCoCreateInstance.

So what options do I have to create a project using the automation interfaces of Visual Studio and then populate it, if I do not have a running instance of it? I.e. I do not want to start Visual Studio to make use of the DTE object and I do not want to load an existing project (and ultimately solution) but create a new one from scratch.

Thanks in advance for any insightful comments and answers.

Related Connect thread.

@MS folks: it would be nice if the documentation could be reviewed and corrected in that area to spare others the odyssey I had to go through. Although I hope that my posts will perhaps at least shorten their search considerably.


per aspera ad astra



Viewing all articles
Browse latest Browse all 4410

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>