The flavours of C++ . net

Hi all
i am new to visual c++ .net  and am getting mightily confused.

I am in the process of writing an mfc application and a dll for it to communicate with.

When coding the dll I wanted to construct/split a file path. I am using _makepath and _splitpath which I obtained from another questino on this website.

However when I look at the msdn it says if I want the file name of a path I can use the FileName property. I am gettign confused. I see the filename property is in the .net framework where as _makepath etc are in the visual C++ libraries. Has this got something to do with why i can use some functions and not others?

Thanks

Richard
richjo100Asked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

drichardsCommented:
In Visual C++ .NET, you can write plain ANSI C++ or you can write managed C++ which is executed in the .NET CLR.  It sounds like you are writing plain C++ and should avoid any .NET Framework Library classes as they will not work for you.

If you want to use .NET managed C++ functionality, you need to create a Console Application (.NET), a Windows Control Library (.NET), or Windows Forms App (.NET) project.
0
richjo100Author Commented:
Thanks for the reply drichards. So if I start an MFC application is this managed? Can I use .NET framework in this?
Also if I use windows api stuff is this available in all of my projects

Thanks
Richard
0
drichardsCommented:
An MFC project is unmanaged.  You can add support for managed code if you really want to use it, but if you're doing that, you should really start with a Windows Forms Appl (.NET) and make it a managed application rather than a mixed one.

If you just wanted to use one or two classes from .NET, find MFC, STL, or other C++ alternatives.  In my opinion, it's not worth doing a mixed mode app unless you're converting a legacy MFC application to interact with new .NET components or writing a new managed app that needs some functionality not available in the .NET class library.  The latter is not likely unless you're doing networking.  It works OK, but can introduce odd performance problems.

In all cases you can use Windows API calls.  In MFC obviously it works as it always has.  If you stay away from managed code there really isn't any difference from what you've done in the past.  If you do managed code, C++ gives you IJW (It Just Works) where you can throw in unmanaged C++ code right along with the managed code.  You can also do explicit PInvokes.  Again, that should only be a last resort.  If you're doing managed code, there are a couple oof things (like some network functions) that will require you to go to the Windows API.
0
Cloud Class® Course: Microsoft Office 2010

This course will introduce you to the interfaces and features of Microsoft Office 2010 Word, Excel, PowerPoint, Outlook, and Access. You will learn about the features that are shared between all products in the Office suite, as well as the new features that are product specific.

richjo100Author Commented:
Thanks for your answer drichards.
So am I correct in thinking that .net is a framework that c++.net and c# can use.
Or is .net just another "flavour" of c++ and c# is just a completely different language? From what I know you can get asp.net so does this use the .net framework like C++.net
then?

Richard
0
drichardsCommented:
>> So am I correct in thinking that .net is a framework that c++.net and c# can use
That is certainly part of .NET.

>> Or is .net just another "flavour" of c++
No, but MS added some language extensions to C++ to allow you to write managed (.NET) apps in C++.

ASP.NET is an implementation of ASP that executes in the .NET CLR.  Certain file requests are forked off to the ASP.NET process which is a .NET application.  This allows your ASP.NET pages to utilize the features of the .NET framework.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
richjo100Author Commented:
Excellent thank drichards
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Development

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.