C
Chang Kuang
Gurus,
I am almost out of resources (and hair) in figuring out using C# class
as COM component in Pocket PC and Smartphone 2003. Basically I need to
implement a pre-defined C++ interface in Embedded VC++. Part of the
implementation, I hope, can make use of nice C# classes available in
..NET compact framework, and C# classes that I developed under my own
namespace using Visual Studio .NET 2003.
Well this is not an unexplored territory in desktop environment.
However, in Pocket PC world, it still seems a daunting task. Below is a
summary of what I found:
1. Using managed C++ to mix C++ and C# in source code level.
No go in pocket pc as Visual Studio .NET 2003 does not have such a
choice for so-called smart device.
2. Prefix a C# interface and its implementation C# class using
Guid/InterfaceType/ClassInterface attributes, register them using
regasm.exe to expose them as a COM component that will be taken care by
mscoree.dll.
No go in pocket pc as InterfaceType/ClassInterface attributes are not
supported in .NET Compact Framework.
However, Visual Studio .NET indeed builds a .tlb file. Anybody
successfully makes use of this .tlb file by directly importing it in C++
source code?
3. Directly host .NET runtime by creating coclass CLSID_CorRuntimeHost
instance, starting up the runtime, getting default domain, and creating
an instance of the C# class.
Did not test in PPC environment yet.
4. Using some commercial enablers? I doubt my company would approve that.
Appreciate any pointers, except that (1) using C++ then; (2) waiting for
MS next release of .NET CF.
- Chang
I am almost out of resources (and hair) in figuring out using C# class
as COM component in Pocket PC and Smartphone 2003. Basically I need to
implement a pre-defined C++ interface in Embedded VC++. Part of the
implementation, I hope, can make use of nice C# classes available in
..NET compact framework, and C# classes that I developed under my own
namespace using Visual Studio .NET 2003.
Well this is not an unexplored territory in desktop environment.
However, in Pocket PC world, it still seems a daunting task. Below is a
summary of what I found:
1. Using managed C++ to mix C++ and C# in source code level.
No go in pocket pc as Visual Studio .NET 2003 does not have such a
choice for so-called smart device.
2. Prefix a C# interface and its implementation C# class using
Guid/InterfaceType/ClassInterface attributes, register them using
regasm.exe to expose them as a COM component that will be taken care by
mscoree.dll.
No go in pocket pc as InterfaceType/ClassInterface attributes are not
supported in .NET Compact Framework.
However, Visual Studio .NET indeed builds a .tlb file. Anybody
successfully makes use of this .tlb file by directly importing it in C++
source code?
3. Directly host .NET runtime by creating coclass CLSID_CorRuntimeHost
instance, starting up the runtime, getting default domain, and creating
an instance of the C# class.
Did not test in PPC environment yet.
4. Using some commercial enablers? I doubt my company would approve that.
Appreciate any pointers, except that (1) using C++ then; (2) waiting for
MS next release of .NET CF.
- Chang