面朝大海,春暖华开

focus on scientific computue, 3dgis, spatial database
专注于科学计算、GIS空间分析

 

moblie development based on .net compact framework2 solution:activeX

at .net cf1, it did not support com interop.
at .net cf2, it supports basic com interop. but it did not supports hosting activeX in cf diectly.
Then comes with two solution to Hosting ActiveX Controls in the .NET Compact Framework 2.0
1. cfcom
officeal website:
http://www.odysseysoftware.com/
http://www.odysseysoftware.com/products_cfcom.asp
some docs:
English Version
Add COM and ActiveX Support in .NET Compact Framework Using Odyssey Software CFCOM
Add COM and ActiveX Support in .NET Compact Framework Using Odyssey Software CFCOM(Andy Sjöström businessanyplace.net September 2003 Applies to:    Microsoft® .NET Compact Framework 1.0    Microsoft Visual Studio® .NET 2003    Odyssey Software CFCOM 1.0    Microsoft Windows Mobile™–based ..
中文版本
 

Add COM and ActiveX Support in .NET Compact Framework Using Odyssey Software CFCOM(中文):office" />

Andy Sjöström
businessanyplace.net

September 2003

Applies to:

   Microsoft® .NET Compact Framework 1.0
   Microsoft Visual Studio® .NET 2003
   Odyssey Software CFCOM 1.0
   Microsoft Windows Mobile™–based Pocket PC

aawolf的话:本月给大家带来的是一篇上了MSDN首页的文章,读者评价为7。原文发于200398日,而且话题也是大家比较关心的在CF下如何调用COMActiveX组件。所以,老狼抽出一个下午的时间翻译过来,希望的是大家能了解目前最新的技术,并与之保持同步。但老狼毕竟是个程序员而不是专业译者,水平粗糙不说,也没有很多时间翻译文章,所以还是希望大家能多读写英文资料,老狼的翻译仅做参考。原文的连接如下:asp>http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnppc2k3/html/cfcom.asp">http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnppc2k3/html/cfcom.asp

摘要:学习在Visual C#中如果将COMActiveX支持添加到.NET Compact Framework应用程序中来。还有,如何在.NET Compact Framework应用程序中如何使用Macromedia Flash Player 6 for a Microsoft Windows Mobile–based Pocket PC

背景:COMActiveX的互用性在full .NET Framework中是可用的。受管.NET Compact Framework代码可以使用Platform Invoke (P/Invoke)调用DLL中的非受管代码,但是在.NET Compact Framework中对COMActiveX的支持是不可用的。Odyssey Software CFCOM作为介入层将COM对象和ActiveX控件作为.NET equivalences暴露给.NET Compact Framework应用程序,使用一个大约只有30Kmemory foot print

Odyssey Software CFCOM能够透明地访问控件(比如Windows Media Player)和对象(比如Pocket Outlook Object Model ADOCE),和实际上任何第三方的COM或者ActiveX组件。CFCOM可以通过Odyssey Software得到许可,尽管文章中的代码示例可以通过license key被创建在代码中。

Download http://download.microsoft.com/download/8/3/d/83d880c1-a76b-49a2-8a55-4b7da23c12fd/cfcom.exe";>cfcom.exe from the Microsoft Download Center.

Contents

http://msdn.microsoft.com/library/en-us/dnppc2k3/html/#cfcom_topic1" target=_self>Introduction
http://msdn.microsoft.com/library/en-us/dnppc2k3/html/#cfcom_topic2" target=_self>Odyssey Software CFCOM
http://msdn.microsoft.com/library/en-us/dnppc2k3/html/#cfcom_topic3" target=_self>Code Walk-through
http://msdn.microsoft.com/library/en-us/dnppc2k3/html/#cfcom_topic4" target=_self>Macromedia Flash 6 Player for Pocket PC
http://msdn.microsoft.com/library/en-us/dnppc2k3/html/#cfcom_topic5" target=_self>Flash Anyplace
http://msdn.microsoft.com/library/en-us/dnppc2k3/html/#cfcom_topic6" target=_self>Flash Anyplace Code Walk-through
http://msdn.microsoft.com/library/en-us/dnppc2k3/html/#cfcom_topic7" target=_self>Conclusion

Introduction

姑且不论大小,.NET Compact Framework的命名空间和类的结构层次和完整的.NET framework是十分相似的。当然,因为体积和执行效率的问题,去掉了.NET Framework的一些特性。其中之一就是COM互用性。Microsoft® Windows® CEPocket PC的许多核心模块都是作为COM对象和ActiveX控件实现的,比如连通性、消息、通讯、图形、媒体、对象存储和个人信息管理PIM)。也有许多第三方COMActiveX控件被用在移动设备上,例如GPS、图表、安全和连通性。Platform Invoke (P/Invoke)存在于System.Runtime.InteropServices命名空间中,可以用来调用简单的非受管代码函数。第三方有效提供者的一个实例是Sapphire Solutions Ltd (http://www.sapphire-solutions.co.uk/";>http://www.sapphire-solutions.co.uk/),使用存在的.NET Compact Framework服务是足够的。Sapphire Solutions通过组件和源代码远程访问服务、编密码等等。Sapphire Solutions组件是通过Platform Invoke加载到.NET Compact Framework代码示例中的,使之更早地开始使用这些代码

调用更复杂的非受管代码函数需要需要一个大量的复杂编码,包括更多有挑战性的领域,比如marshalling开发COM封装往往是需要单一的基于函数的接口。使COMActiveX融合到受管代码中是充满挑战的。

Odyssey Software CFCOM

Odyssey Software对于Windows CE开发者社区来说并不陌生。他们从1996年开始就已经在推动企业级移动应用程序开发方面扮演重要的角色了,他们的产品CEfusion ViaXML。公司连续为移动应用开发社区提供工具,这次他们带来的是一个介于COMCompact Framework中间的转换层,可以使COM暴露等价于.NET的接口。CFCOMCOMActiveX转换到Compact Framework应用程序提供广泛的互用性。

CFCOM可以被看作一个使COM.NET对象能够运行在同一个应用程序中的封装。一个Compact Framework对象被Common Language Runtime (CLR)约束在受管内存中,当一个COM对象保存在非受管内存中。CFCOM实现了一个透明的转换层,使受管和非受管组件可以相互作用:设置或取得属性值,调用方法,捕捉COM事件,处理高级类型转换函数(a k a marshalling)并从非受管代码的异常事件中产生本地.NET异常。

对于开发者来说,CFCOM由三个文件组成:

·                     Odyssey.CFCOM.dll包含CFCOM运行时。

·                     Odyssey.CFCOM.Design.dll 提供Visual Studio的设计期支持。该文件被安装C:\Program Files\Microsoft Visual Studio .NET 2003\CompactFrameworkSDK\ v1.0.5000\Windows CE\Designer目录中。

·                     Odyssey.CFCOM.1248.dll是本地(设备支持)运行时组件。



for more information about cfcom, pls visits the offical website and google the related docs
2  openNETCF
offical website:
http://www.opennetcf.org
introducation

Welcome to OpenNETCF.org, the web's central repository for information and shared-source projects specifically targeting the Microsoft .NET Compact Framework.

OpenNETCF.org was started by the members of the OpenNETCF Advisory Board as an independent source for Compact Framework development information working under the spirit of the open-source movement. We welcome suggestions for projects as well as submissions of code, articles and white papers. All submissions are reviewed by the OpenNETCF Advisory Board members.

For free-flow, unedited, warranty-free (and untested) code, we offer the OpenNETCF Forums. These forums are the largest repository of independent Compact Framework code on the web.
for more details, pls visits the offical website and google related docs

posted on 2006-09-12 20:49  风过 无痕  阅读(765)  评论(0编辑  收藏  举报

导航

向日葵支付宝收钱码