all groups > dotnet compact framework > july 2005 >
You're in the

dotnet compact framework

group:

running Unmanaged code


running Unmanaged code Ashishthaps
7/14/2005 3:06:03 PM
dotnet compact framework:
How can i run unmanaged code(VC++ and MFC) under .net compact framework 1.0
Re: running Unmanaged code Paul G. Tobey [eMVP]
7/14/2005 4:11:36 PM
What do you mean by "run it under .NET CF"? You can P/Invoke to unmanaged
DLLs in either .NET CF 1.0 or 2.0, but probably not MFC DLLs, since they
rely on being run inside a MFC application environment. If you have
unmanaged COM objects, you're on the edge of unusability in 1.0, but better
off in 2.0. Note, also, that there's no .NET CF 2.0 available for 5.0, at
this point.

Paul T.

[quoted text, click to view]

Re: running Unmanaged code Ashishthaps
7/14/2005 5:11:02 PM
Thanks for your reply paul . But is there any way by which .Net CF can be
extended as to run MFC DLL.
Re: running Unmanaged code ctacke/
7/14/2005 9:17:35 PM
No. Native code runs without a runtime and managed C++ is not supported.

-Chris


[quoted text, click to view]

Re: running Unmanaged code Paul G. Tobey [eMVP]
7/15/2005 8:28:15 AM
And MFC DLLs are making assumptions about there being a main window of a
certain class, certain values stored in extra bytes for each window, etc.
You can't do those things in .NET CF right now (and I doubt that there would
be enough interest in them for MS to change that -- I certainly hope that
they don't waste time on it). MFC is a bad choice for general-purpose DLLs.
You can port your DLLs over to straight C++ with no MFC, maybe, or write an
application in MFC to use the DLL and create some type of interprocess
communication for your managed code to communicate with that program.

Paul T.

[quoted text, click to view]

AddThis Social Bookmark Button