Pocket PC 2005 C++ Managed Class Library

  • Thread starter Thread starter Hassan Wassel
  • Start date Start date
H

Hassan Wassel

Hi All,
I want to create a smart device C++ managed class library (for Pocket
PC 2005). Is this possible? If yes, how?
I want to wrap a C++ unmanaged Dll to be used in a C# application.

Thanks in advance!
Hassan
 
Managed C++ is not supported in any version of the Compact Framework, so no,
it is not possible.
 
1. There's no such thing as "Pocket PC 2005".

2. NETCF has no support for Managed C++.

3. You can use native DLL in C# via P/Invoke or COM interop.


--
Best regards,


Ilya

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

*** Want to find answers instantly? Here's how... ***

1. Go to
http://groups-beta.google.com/group/microsoft.public.dotnet.framework.compactframework?hl=en
2. Type your question in the text box near "Search this group" button.
3. Hit "Search this group" button.
4. Read answer(s).
 
Thanks for replying. I wanted to use the C++ classes in the Dll in a C#
using P/Invoke but I didn't know how to use DllImport for class methods
not C functions.
I will appreciate your answer very much.

Thanks in advance!
Hassan
 
You can't. This has been discussed in the past, so for details search the
archives, but the general mechanism to use C++ classes is to write a C
interface that you P/Invoke. the C interface creates an object and returns
a handle, then for every method in the class you need a C method that you
pass the handle and parameters to.
 
No, you don't want to do that. You're much better off writing a C,
non-class-based, wrapper for your C++ classes and P/Invoking that. I
suppose that you could build your P/Invoke structure so that all of the
class methods expected a 'this' IntPtr as the first parameter, but you still
have to deal with calling 'new', etc. Not worth the effort. You'll never
be able to treat the C++ class as a C# class, so you're better off not
trying.

If the code is COM, then you have a chance, at least, of wrapping it with
C#.

Paul T.
 
Back
Top