Sign in to follow this  
soconne

[.net] create C++ winforms project WITHOUT CLR

Recommended Posts

In Visual Studio 2003 if you create a WinForms project in C++, by default you get the regular C++ style syntax and none of the CLR stuff. But in Visual Studio 2005 the project automatically gets created with CLR and so pointers (*) turn into (^) and using statements get added. How can you create a C++ Winforms project in VS2005 without this happening? How can you create it without CLR and just plain C++?

Share this post


Link to post
Share on other sites
I don't think you got the regular C++ style syntax, you got the really dodgy 'managed bits tacked onto C++' syntax. With VS2005 they've dramatically *improved* the syntax (which is called C++/CLI). You simply cannot get WinForms without the CLR, since all of the WinForm classes themselves are managed code.

Share this post


Link to post
Share on other sites
But in VS2003 you can create a winforms C++ project without all the odd C++ syntax. And I can then load that project into 2005 and compile just fine. So there must be a way to create it in 2005.

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
Quote:
Original post by soconne
But in VS2003 you can create a winforms C++ project without all the odd C++ syntax. And I can then load that project into 2005 and compile just fine. So there must be a way to create it in 2005.


Compare the settings to see if there is a switch not set in VS 2005.

Share this post


Link to post
Share on other sites
2003 had "Managed C++"
2005 has "C++/CLI"

two different languages, but NONE of those are ordinary c++. both are c++ in a managed world. 2003 just looks like ordinary c++, wich is quite dangerous. 2005 does add difference to make it obvious wich part of the code is managed, and wich isn't.

afaik 'Managed C++' got deprecated in 2005 => you can't normally create projects using it. but you can still compile the old code using it (against the .net 1.1 framework, that is, i guess). so better check the options in the project (not at creation time, but afterwards. rightclick the project in the projectbrowser, and choose settings)

Share this post


Link to post
Share on other sites
as long as you don't need winforms or anything else that IS .NET-based, you don't need the CLR, and can disable it in the options. and then you can continue coding as usual.

but if you want to use anything of .NET, you obviously have to .. use .NET. winforms are .NET, ergo there's no way around it. but you can use win32 if you want (but i won't suggest it to you ever...).

possibly you should just not be scared of .NET, it's a great tool for a lot of things.

Share this post


Link to post
Share on other sites
Quote:
Original post by soconne
Reasons I'll continue to stick with C++ Builder.

Silly reasoning.

If you want the .NET CLR, use the CLR. If you don't want it, don't complain that you can't use tools (like Windows Forms) that are built on it. Above all, don't blame your misperceptions on your tools.

Share this post


Link to post
Share on other sites
You really need to spend some time to learn your IDE, whatever it may be.

Project -> Properties -> General -> Project Defaults -> Common Language Runtime support -> Old Syntax.

Personally, I like the new syntax better.

Either way, it's no longer plain C++.

[Edited by - Nypyren on October 10, 2006 3:43:59 PM]

Share this post


Link to post
Share on other sites
Quote:
Original post by Oluseyi
Quote:
Original post by soconne
Reasons I'll continue to stick with C++ Builder.

Silly reasoning.

If you want the .NET CLR, use the CLR. If you don't want it, don't complain that you can't use tools (like Windows Forms) that are built on it. Above all, don't blame your misperceptions on your tools.


Woa calm down cowboy. All I wanted to do was create a C++ Winforms project in VS2005 like you can do in VS2003. What's with all this "don't complain that you can't use tools.....don't blame your misperceptions...". Just calm down.

Share this post


Link to post
Share on other sites
Quote:
Original post by soconne
Woa calm down cowboy. All I wanted to do was create a C++ Winforms project in VS2005 like you can do in VS2003. What's with all this "don't complain that you can't use tools.....don't blame your misperceptions...". Just calm down.

What's with the perception that if someone chides you, he's not calm?

We're breeding a generation of pansies.

Share this post


Link to post
Share on other sites
Quote:
Original post by Oluseyi
Quote:
Original post by soconne
Woa calm down cowboy. All I wanted to do was create a C++ Winforms project in VS2005 like you can do in VS2003. What's with all this "don't complain that you can't use tools.....don't blame your misperceptions...". Just calm down.

What's with the perception that if someone chides you, he's not calm?

We're breeding a generation of pansies.


...and arrogance

Share this post


Link to post
Share on other sites
nope. but a bunch of people that don't read up what they have in their hands, what they use, nor read replies..

as stated, winforms are part of CLR, so it's NOT possible to use them without CLR. thats like wanting to play a dvd without a dvd player (soft, or hardware).

if you only want to create a project to code c++, and DON'T want to use winforms themselfes, you can disable the CLR in the options (but it's YOUR job to find out where, there's are options for this in the project settings), but you can't create winforms then.

if you want to use "Managed C++", wich is the "old way to work with c++ and winforms", you can change the settings, again, in the options (read above).

but yes, you should prefer C++/CLI over Managed C++ anytime, it's the better designed language.

and for the rest of your problems, read up, or ask. but don't just blame some stuff that you don't seem to know really.

and don't blame the ones that try to help you.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this