Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Will CF 2.0 support Managed C++?

1 view
Skip to first unread message

Smith

unread,
Apr 6, 2005, 8:05:54 PM4/6/05
to
Any chance to have MC++ working on Compact Framework 2.0?


Paul G. Tobey [eMVP]

unread,
Apr 6, 2005, 8:06:36 PM4/6/05
to
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.

"Smith" <Sm...@smith.com.invalid> wrote in message
news:O2ygFVwO...@TK2MSFTNGP14.phx.gbl...

Smith

unread,
Apr 6, 2005, 9:41:15 PM4/6/05
to
"Paul G. Tobey [eMVP]" <ptobey no spam AT no instrument no spam DOT com>
wrote in message news:%23sA4wXw...@TK2MSFTNGP12.phx.gbl...

> 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?)


<ctacke/>

unread,
Apr 6, 2005, 10:11:10 PM4/6/05
to
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


"Smith" <Sm...@smith.com.invalid> wrote in message

news:%23qCPYKx...@TK2MSFTNGP15.phx.gbl...

Smith

unread,
Apr 6, 2005, 11:15:58 PM4/6/05
to
"<ctacke/>" <ctacke_AT_OpenNETCF_com> wrote in message
news:%23WiqRcx...@TK2MSFTNGP15.phx.gbl...

> 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?

Steve Maillet (eMVP)

unread,
Apr 6, 2005, 11:43:15 PM4/6/05
to
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.

--
Steve Maillet
EmbeddedFusion
www.EmbeddedFusion.com
smaillet at EmbeddedFusion dot com


<ctacke/>

unread,
Apr 7, 2005, 7:31:02 AM4/7/05
to
> 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


Ilya Tumanov [MS]

unread,
Apr 7, 2005, 2:08:54 PM4/7/05
to
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.

--------------------
> From: "Smith" <Sm...@smith.com.invalid>
> References: <O2ygFVwO...@TK2MSFTNGP14.phx.gbl>
<#sA4wXwO...@TK2MSFTNGP12.phx.gbl>
> 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: <#qCPYKxO...@TK2MSFTNGP15.phx.gbl>
> 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

Smith

unread,
Apr 12, 2005, 4:16:11 AM4/12/05
to
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]"" <ily...@online.microsoft.com> wrote in message
news:OyUOfz5O...@TK2MSFTNGXA01.phx.gbl...

Paul G. Tobey [eMVP]

unread,
Apr 12, 2005, 12:36:52 PM4/12/05
to
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" <Sm...@smith.com.invalid> wrote in message

news:%23GRnVez...@TK2MSFTNGP15.phx.gbl...

Ilya Tumanov [MS]

unread,
Apr 12, 2005, 2:54:01 PM4/12/05
to
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.
--------------------
> From: "Smith" <Sm...@smith.com.invalid>
> References: <O2ygFVwO...@TK2MSFTNGP14.phx.gbl>
<#sA4wXwO...@TK2MSFTNGP12.phx.gbl>

<#qCPYKxO...@TK2MSFTNGP15.phx.gbl>
<OyUOfz5O...@TK2MSFTNGXA01.phx.gbl>


> 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: <#GRnVezP...@TK2MSFTNGP15.phx.gbl>
> 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

Vyacheslav Lanovets

unread,
Apr 13, 2005, 2:39:04 PM4/13/05
to
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


Ilya Tumanov [MS]

unread,
Apr 13, 2005, 6:46:04 PM4/13/05
to
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: <O2ygFVwO...@TK2MSFTNGP14.phx.gbl>
<#sA4wXwO...@TK2MSFTNGP12.phx.gbl>
<#qCPYKxO...@TK2MSFTNGP15.phx.gbl>
<OyUOfz5O...@TK2MSFTNGXA01.phx.gbl>

> 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: <u6KFqhFQ...@TK2MSFTNGP14.phx.gbl>
> 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

Steve Maillet (eMVP)

unread,
Apr 18, 2005, 9:47:22 AM4/18/05
to
Don't forget COM interop in V2.0. You can wrap your native code in COM
components and access them from managed code.
0 new messages