Converting console application to windows application – C++/CLI

Have you ever needed to convert a console application to windows application?

Recently, I worked on an application which was created to run on console, but later decided to move to windows application. To make it a windows forms application, you only have to add new windows form to the project. VS will add all necessary references automatically.

Modify your main method like, Continue reading

Advertisements

Using application configuration file (app.config) with C++/CLI applications

.NET applications uses app.config file to keep the application configuration entries like database connection strings, logging information etc.  Using Visual Studio, you can add a new app.config file to your application. In C# and VB.NET projects, app.config will be copied automatically to the output directory and it will be named like <Application>.exe.config where <Application> is your executable name. ConfigurationManager is a helper class which provides a neat interface to the contents of app.config.

With the above information, let us write a simple application which reads AppSettings node from the application configuration file. Continue reading