Sign in to follow this  

A transition to vc++ .net

This topic is 4597 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I am a long time user of Borland C++ Builder and I am now attempting to switch to vc++ .net. One thing that has confused about vc++ is the Windows Forms applications. When you add an event to a control it automatically places you within the header file where I suppose it wants you to put your code for the event. Builder placed you within the soure file. Why does vc++ do this? Isn't it better coding practice to have the code in the source file? Anyone have some insight on this? Thanks.

Share this post


Link to post
Share on other sites
Well, it's designed for use with C#, rather than C++, which means that it just drops functions in inline. It also drops in a lot of crazy C++ extension stuff.

The purpose of C++.NET is so you can eaisly port existing C++ code. If you're just going from scratch (and you have it), it'd probably be better to use C#.

The best way of navigating the huge files that result is with the drop-downs above the code window, and using the little [+][-] boxes to fold up sections.

It isn't necessaraly better to have the implementation in another file. I would have prefered it to (having come from Borland myself), but it works the same either way.

I find that wxWidgets is nicer anyway than doing Windows Forms in C++, and this is probably partially because I used to work in BCB. You should try it.

Share this post


Link to post
Share on other sites
So it is acceptable to keep the implementation within the header? Just seems a bit foreign to me. I have heard of wxWidgets but I am not familiar with them, could you point me to some good resources or give me a brief explanation?

Thanks!

Share this post


Link to post
Share on other sites
WxWidgets is something completely different, it's a cross-platform GUI kit with native look&feel on the platforms it supports.

VS.Net is different from C++.Net; VS.Net is the IDE which you can use to make 'normal' C++ programs and .Net programs. Whereas C++.Net or "C++ with Managed Extentions" is a new language. It's C++ with stuff added so you can use C++ for .Net/CLI/CLR programs. If you are using WinForms, you are using .Net/CLI/CLR. You can also make a plain C++ Win32 application or use MFC, and that would be a normal C++ program (no .Net).

WinForms will be most like the VCL.
MFC will place the code in a source file and build the header file for you.
I'd follow whatever the IDE does for C++.Net, messing with it can only cause headache.

Share this post


Link to post
Share on other sites
Quote:
Original post by Magmai Kai Holmlor
I'd follow whatever the IDE does for C++.Net, messing with it can only cause headache.


Yeah that is what I figured. So does the new standard really want your code within the header? If so what is the purpose of having a source and header file now?

Share this post


Link to post
Share on other sites
It is no kind of new standard, it's just the way that Windows Forms constructs the C++ file for you.

It's perfectly acceptable to use either method when you write the class yourself. Not to mention, I think I moved a few implementations out of the header file for various reasons when I was using Windows Forms anyway.


wxWidgets is, as MKH said, a cross-platform GUI library. You, like myself, may find it better than using Windows Forms. It is probably more familar to a VCL user too.

The difference is it dosn't have a standard WYSIWYG editor. However it's generally not a big deal. You can get WYSIWYG editors from elsewhere with various levels of quality if you need one.

I found that using managed C++ (and also, interfacing it with unmanaged C++) was painful at best.


If you were using C# rather than C++, then I would recomend using Windows Forms.

Share this post


Link to post
Share on other sites

This topic is 4597 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

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