Re: migrating VC6 to VC8



Tony Johansson wrote:
> Hello!!
>
> You may correct me if I say something that is not right.
>
> If I want to use the .NET framework for an VC6/MFC application I must
> compile the VC6/MFC to VC8 using the /CLI switch after removing all
> the errors?

If you wan to use .NET 2.0, yes. You can do it with VC 7.1 (2003) for .NET
1.1, but you won't have the new managed C++ syntax.

> The old MFC will work in the new VS2005(VC8)
> My MFC project consist of several files that constitute the MFC
> application.

You may have to make a change here and there, by overall, yes.

> Now assume that I want to change something in the old updated MFC what
> conditions exist then.
> Can I use.NET framework only in new classes or is possible to use it
> even in old classes from the updated MFC application?

When you compile your existsing code with /clr, you can use .NET framework
classes from anywhere, including adding new code to old classes.

> I wrote in an earlier mail the following:
> If I intend to use C++ in VS2005 I can either use managed code which
> is C++/CLI which give me the possibility to mix other language such
> as C# or VB or use unmanaged code for example using MFC then I can
> not mix other language.
>
> I received the answer below
> There are two separate, somewhat independent issues:
> 1. Which platform you're targeting: native or managed
> 2. Which language (syntax) you're using: C++/CLI, ISO C++ or ISO
> C89. C++/CLI - managed only
> ISO C++ - native or managed (or mixture)
> ISO C - native only
>
> Supported languages can be mixed on either platform, so for
> example, you can use both ISO C++ and C++/CLI to write managed code
> (but only the C++/CLI classes will be usable from other .NET
> languages). In fact, there's nothing to stop you from having
> C++/CLI, ISO C++ compiled as managed, ISO C++ compiled as natice and
> ISO C89 compiled as native all in the same executable.
>
>
> Some more question on the answer.You wrote which platform you're
> targeting: native or managed?
> I assume a managed app mean that it is more or less plattform
> independent similar to Java
> and that you can mix different .NET langauges. Is that right
> conclusion?

Yes.

> Even if you have a managed app you can't use it as you can use Java
> because Java runs on most plattforms for example Unix..
> If I use managed app which plattform can the updated app be executed
> on? Can I run it on Unix(Linux)?

Maybe. The platform is the CLI. Microsoft .NET is one implementation of
the CLI, but there are others. The Mono project is an open-source CLI for
Unix, but it doesn't support everything that .NET supports yet. In practice
your WinForms+MFC app is still tied to Windows, just as it was as an MFC
app.

> Is it a condition to be able to mix several different .NET langauges
> for an application that it's a managed app?

No.

> A native app can't mix different .NET langauges?

Yes it can, but not as easily.

> If I instead used native what do I miss then?

Windows Forms and the .NET framework classes.

> Is it correct an updated app VC6/MFC to VC8 that will use the .NET
> framework must be a managed app.?

That's two ways of saying the same thing. .NET Framework app == managed
app.

> If I update a VC6/MFC to VC8 just to be able to use .NET framework
> What condition exist in the new updated application. I mean when
> changing existing code in one way or another and adding new code. Can
> I use the standard C++(ISO C++) instead of C++/CLI?. So the question
> is when can I use standard C++(ISO C++) and when do I have to use
> C++/CLI in the updated VC6/MFC to VC8 to be abler to use .NET
> framework.

You never have to use C++/CLI. When interacting with the .NET framework,
you can use C++/CLI or the older Managed Extensions for C++. Use of ISO C++
and C++/CLI are not mutually exclusive - C++/CLI is an extension of ISO C++,
so you can write 99% ISO C++ and mix in a little bit of C++/CLI here and
there where you need to interact with .NET framework class.

-cd


.



Relevant Pages

  • migrating VC6 to VC8
    ... My MFC project consist of several files that constitute the MFC application. ... is C++/CLI which give me the possibility to mix other language such ... Even if you have a managed app you can't use it as you can use Java because ... VC6/MFC to VC8 to be abler to use .NET framework. ...
    (microsoft.public.dotnet.languages.vc)
  • Re: calling DLL from a Device Drive
    ... your MSIL should be able to execute on any machine that contains the same kind of support as the .net framework (depends what your app requires). ... be warned that pinvoke'd functions are platform dependent. ... I've never done it from a managed app and I may be missing something. ...
    (microsoft.public.development.device.drivers)
  • Re: starting a dialog app in a minimized state
    ... As stated in my original post, I'm using MFC. ... in the .NET framework and I'm not using .NET for my app. ... >> state (for windows mobile 2003). ...
    (microsoft.public.pocketpc.developer)
  • RE: c++, visual basic, framework .. newbie question
    ... The c++ app is using MFC.. ... Is it as easy as just putting all the MFC c++ code and the vb code into .NET Framework? ... (sorry if the question is kind of stupid) ...
    (microsoft.public.dotnet.general)
  • Re: Real-World Sample Application?
    ... My experience has been that if an application cost ... VB.NET app would be SQL Server and the back end in the MS Access ... The key to .Net is to know the .Net Framework, using the code in the library and what is in the namespaces of the .Net Framework. ...
    (microsoft.public.dotnet.general)