Will CF 2.0 support Managed C++?

  • Thread starter Thread starter Smith
  • Start date Start date
As I understand it, no, no chance of it being supported. That doesn't mean,
that for some set of code, you can't make it work, of course. C# is pretty
similar. Do you have some huge managed C++ codebase?

Paul T.
 
Paul G. Tobey said:
As I understand it, no, no chance of it being supported. That doesn't
mean, that for some set of code, you can't make it work, of course. C# is
pretty similar. Do you have some huge managed C++ codebase?

Paul T.


Thanks Paul for your reply.

I've got a large portion of unmanaged C++ to interop with.
What do you mean when you say that for some set of code, I can make it work?
Actually it is not the first time I read something like that, what is
working and what is not exactly? (And can the MC++ compiler produce ARMV4
code in the first place anyway?)
 
The managed compilers don't create processor dependent code. They produce
IL. The unmanaged runtimes that interpret the IL are processor dependent.

As for support, search the archives. The short is that the compiler and
tool set are not set up for managed C++, so there's no way to know if your
code will produce opcodes that are unsupported by the CF. It's pure trial
and error. For a small project it's not tough, but then if it's small
rewriting it in C# is fast. If it's large, it's going to probably take more
time to test than to just rewrite.

-Chris
 
The managed compilers don't create processor dependent code. They produce
IL. The unmanaged runtimes that interpret the IL are processor dependent.

Well, Managed C++ is all about mixing two types of C++, so unmanaged C++
does get generated too. That's the whole point really: MC++ is there to ease
bridging the two technologies, nothing more, nothing less.
Either your statement is pointless, or I am missing something.
As for support, search the archives. The short is that the compiler and
tool set are not set up for managed C++, so there's no way to know if your
code will produce opcodes that are unsupported by the CF. It's pure trial
and error. For a small project it's not tough, but then if it's small
rewriting it in C# is fast. If it's large, it's going to probably take
more time to test than to just rewrite.

What I want to do is pretty simple. Write a thin layer above my C++ classes.

class Foo
{
}

__gc class ManagedFoo
{
... instanciate Foo, call methods, etc.
}

Is there a way to make that run on the CF 2.0?
 
You won't be able to do that in V2.0 of the CF. You may however put a COM
wrapper around your C++ and use the COM interop.
 
Well, Managed C++ is all about mixing two types of C++, so unmanaged C++
does get generated too. That's the whole point really: MC++ is there to
ease bridging the two technologies, nothing more, nothing less.
Either your statement is pointless, or I am missing something.

You are missing something. *All* managed code produces IL, regardless of
language. IL is processor independent. Is it JITted and run by the
runtimes, which are written partially in native code, and therefore are
processor dependent. Managed C++ does not "generate" unmanaged C++, you're
simply using both.
What I want to do is pretty simple. Write a thin layer above my C++
classes.

class Foo
{
}

__gc class ManagedFoo
{
... instanciate Foo, call methods, etc.
}

If you're after a simple shim wrapper around your exisitng unmanaged C, then
use c#. If your intention is to wrap managed C++, then what I'm saying is
you're out of luck. Your managed assemblies will not work becasue FFW
assemblies are not retargetable to the CF, and there's no inherent compiler
support form managed C++ for the CF. There have been some that have gotten
it to work, but it's not easy, it's not supported, and IMHO it's a waste of
time to try to build, test, field and support such a fragile system.

-Chris
 
Managed C++ will not be supported in CF V2.

If you have unmanaged C++ code to interact with, consider recompiling it
with unmanaged C++ from eVC (free download) so you can P/Invoke into it
from managed code.
There's little point in tweaking existing C++ code to convert it to managed
C++. If you're willing to invest in conversion, consider converting to C#
instead.

Best regards,

Ilya

This posting is provided "AS IS" with no warranties, and confers no rights.

--------------------
 
Converting the whole code to C# is out of purpose.
How can I interop with C++ other than through dllimport using decorated
names (which will be ugly, if not dodgy) ?
The whole point of MC++ is the smooth interop between C++ and .NET.

"Ilya Tumanov [MS]" said:
Managed C++ will not be supported in CF V2.

If you have unmanaged C++ code to interact with, consider recompiling it
with unmanaged C++ from eVC (free download) so you can P/Invoke into it
from managed code.
There's little point in tweaking existing C++ code to convert it to
managed
C++. If you're willing to invest in conversion, consider converting to C#
instead.

Best regards,

Ilya

This posting is provided "AS IS" with no warranties, and confers no
rights.

--------------------
Subject: Re: Will CF 2.0 support Managed C++?
Date: Thu, 7 Apr 2005 13:41:15 +1200
Lines: 18
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.2180
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180
X-RFC2646: Format=Flowed; Response
Message-ID: <#[email protected]>
Newsgroups: microsoft.public.dotnet.framework.compactframework
NNTP-Posting-Host: mail.navman.com 203.163.70.66
Path: TK2MSFTNGXA01.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTNGP15.phx.gbl
Xref: TK2MSFTNGXA01.phx.gbl microsoft.public.dotnet.framework.compactframework:26461
X-Tomcat-NG: microsoft.public.dotnet.framework.compactframework




Thanks Paul for your reply.

I've got a large portion of unmanaged C++ to interop with.
What do you mean when you say that for some set of code, I can make it work?
Actually it is not the first time I read something like that, what is
working and what is not exactly? (And can the MC++ compiler produce ARMV4
code in the first place anyway?)
 
From talking to the CF guys at Microsoft, it's just an issue of how many
people they have, how many hours there are in the day, and how long it would
take to make Managed C++ work and there aren't enough resources to do it.
So, you have to figure out what the best of the available choices is: port
to C#, use P/Invoke and compile with native C++, or some combination.

Paul T.

Smith said:
Converting the whole code to C# is out of purpose.
How can I interop with C++ other than through dllimport using decorated
names (which will be ugly, if not dodgy) ?
The whole point of MC++ is the smooth interop between C++ and .NET.

"Ilya Tumanov [MS]" said:
Managed C++ will not be supported in CF V2.

If you have unmanaged C++ code to interact with, consider recompiling it
with unmanaged C++ from eVC (free download) so you can P/Invoke into it
from managed code.
There's little point in tweaking existing C++ code to convert it to
managed
C++. If you're willing to invest in conversion, consider converting to C#
instead.

Best regards,

Ilya

This posting is provided "AS IS" with no warranties, and confers no
rights.

--------------------
Subject: Re: Will CF 2.0 support Managed C++?
Date: Thu, 7 Apr 2005 13:41:15 +1200
Lines: 18
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.2180
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180
X-RFC2646: Format=Flowed; Response
Message-ID: <#[email protected]>
Newsgroups: microsoft.public.dotnet.framework.compactframework
NNTP-Posting-Host: mail.navman.com 203.163.70.66
Path: TK2MSFTNGXA01.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTNGP15.phx.gbl
Xref: TK2MSFTNGXA01.phx.gbl microsoft.public.dotnet.framework.compactframework:26461
X-Tomcat-NG: microsoft.public.dotnet.framework.compactframework

"Paul G. Tobey [eMVP]" <ptobey no spam AT no instrument no spam DOT com>
wrote in message As I understand it, no, no chance of it being supported. That doesn't
mean, that for some set of code, you can't make it work, of course.
C# is
pretty similar. Do you have some huge managed C++ codebase?

Paul T.


Thanks Paul for your reply.

I've got a large portion of unmanaged C++ to interop with.
What do you mean when you say that for some set of code, I can make it work?
Actually it is not the first time I read something like that, what is
working and what is not exactly? (And can the MC++ compiler produce
ARMV4
code in the first place anyway?)
 
You can identify API you need to call from managed code and prevent them
from been mangled by the compiler.
That probably would be a smaller change compared to managed C++ adaptation.
Alternatively, you can use native wrapper to expose the API you need
without mangling.
That would allow you to keep original code completely intact.

Best regards,

Ilya

This posting is provided "AS IS" with no warranties, and confers no rights.
--------------------
<#[email protected]>
Subject: Re: Will CF 2.0 support Managed C++?
Date: Tue, 12 Apr 2005 20:16:11 +1200
Lines: 68
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.2180
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180
X-RFC2646: Format=Flowed; Original
Message-ID: <#[email protected]>
Newsgroups: microsoft.public.dotnet.framework.compactframework
NNTP-Posting-Host: port54-158-39.adsl.maxnet.co.nz 210.54.158.39
Path: TK2MSFTNGXA01.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTNGP15.phx.gbl
Xref: TK2MSFTNGXA01.phx.gbl microsoft.public.dotnet.framework.compactframework:26812
X-Tomcat-NG: microsoft.public.dotnet.framework.compactframework

Converting the whole code to C# is out of purpose.
How can I interop with C++ other than through dllimport using decorated
names (which will be ugly, if not dodgy) ?
The whole point of MC++ is the smooth interop between C++ and .NET.

"Ilya Tumanov [MS]" said:
Managed C++ will not be supported in CF V2.

If you have unmanaged C++ code to interact with, consider recompiling it
with unmanaged C++ from eVC (free download) so you can P/Invoke into it
from managed code.
There's little point in tweaking existing C++ code to convert it to
managed
C++. If you're willing to invest in conversion, consider converting to C#
instead.

Best regards,

Ilya

This posting is provided "AS IS" with no warranties, and confers no
rights.

--------------------
Subject: Re: Will CF 2.0 support Managed C++?
Date: Thu, 7 Apr 2005 13:41:15 +1200
Lines: 18
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.2180
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180
X-RFC2646: Format=Flowed; Response
Message-ID: <#[email protected]>
Newsgroups: microsoft.public.dotnet.framework.compactframework
NNTP-Posting-Host: mail.navman.com 203.163.70.66
Path: TK2MSFTNGXA01.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTNGP15.phx.gbl
Xref: TK2MSFTNGXA01.phx.gbl microsoft.public.dotnet.framework.compactframework:26461
X-Tomcat-NG: microsoft.public.dotnet.framework.compactframework

"Paul G. Tobey [eMVP]" <ptobey no spam AT no instrument no spam DOT com>
wrote in message As I understand it, no, no chance of it being supported. That doesn't
mean, that for some set of code, you can't make it work, of course.
C#
is
pretty similar. Do you have some huge managed C++ codebase?

Paul T.


Thanks Paul for your reply.

I've got a large portion of unmanaged C++ to interop with.
What do you mean when you say that for some set of code, I can make it work?
Actually it is not the first time I read something like that, what is
working and what is not exactly? (And can the MC++ compiler produce ARMV4
code in the first place anyway?)
 
Hello, "Ilya!
You wrote on Thu, 07 Apr 2005 18:08:54 GMT:

ITM> Managed C++ will not be supported in CF V2.

And I have another, more interesting question.
Any plans to support managed development for C++ coders for CE in the
future??

We have quite a large source codebase, so it's really annoying to not to
know what the MS plans are: now we have to make choice - either start
porting to C# or wait several years for C++/CLI on CE platform. If we spend
resources on rewriting working&tested code in less powerful language - it's
gonna be silly... On the other hand we will not be able to port in just 1-2
years if C++ will not be supported one time.

The problem here is that management already is planning to port to C#. But
we could delay that porting until something with C++ support
beta-released...

Best regards, Vyacheslav Lanovets
 
Believe it or not, but managed C++ support is one of the least requested
features and thus is not planned for CF.
That might change based on number of requests and/or deployment potential.
VS 2005 will include native C++ support for CE.

Best regards,

Ilya

This posting is provided "AS IS" with no warranties, and confers no rights.

--------------------
From: "Vyacheslav Lanovets" <xentrax_umail.ru>
References: <[email protected]>
<#[email protected]>
Subject: Re: Will CF 2.0 support Managed C++?
Date: Wed, 13 Apr 2005 22:39:04 +0400
Lines: 23
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.2527
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2527
X-Comment-To: "Ilya Tumanov [MS]"
FL-Build: Fidolook 2002 (SL) 6.0.2800.94 - 3/3/2005 11:18:26
X-RFC2646: Format=Flowed; Original
Message-ID: <[email protected]>
Newsgroups: microsoft.public.dotnet.framework.compactframework
NNTP-Posting-Host: ppp139-247.dialup.mtu-net.ru 62.118.139.247
Path: TK2MSFTNGXA01.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTNGP14.phx.gbl
Xref: TK2MSFTNGXA01.phx.gbl microsoft.public.dotnet.framework.compactframework:26912
X-Tomcat-NG: microsoft.public.dotnet.framework.compactframework

Hello, "Ilya!
You wrote on Thu, 07 Apr 2005 18:08:54 GMT:

ITM> Managed C++ will not be supported in CF V2.

And I have another, more interesting question.
Any plans to support managed development for C++ coders for CE in the
future??

We have quite a large source codebase, so it's really annoying to not to
know what the MS plans are: now we have to make choice - either start
porting to C# or wait several years for C++/CLI on CE platform. If we spend
resources on rewriting working&tested code in less powerful language - it's
gonna be silly... On the other hand we will not be able to port in just 1-2
years if C++ will not be supported one time.

The problem here is that management already is planning to port to C#. But
we could delay that porting until something with C++ support
beta-released...

Best regards, Vyacheslav Lanovets
 
Don't forget COM interop in V2.0. You can wrap your native code in COM
components and access them from managed code.
 
Back
Top