在windows mobile中使用桌面C#DLL
我有一个小的查询,在Windows Mobile中使用Desktop c#应用程序DLL时是否需要修改?我遇到像File or assembly name 'Interop.CDO, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null', or one of its dependencies, was not found.
这样的问题。 我有桌面DLL的源代码,我不不,我需要的东西组装的修改,以做mobile.please的工作让我的解决方案..提前 在windows mobile中使用桌面C#DLL
感谢Grabit
错误信息你得到的建议DLL不存在。
如果你已经超越了这个障碍,你仍然不能成为家庭的主人,因为CDO与Outlook/Exchange相关,因此很可能只是透明地工作。
将源代码编译为移动dll文件。
当您安装了精简框架时,您可以在桌面上使用移动dll文件
。
(请参阅ctacke的评论为什么)
您无法在移动设备上使用CDO。下面的“goo”并不存在,所以即使你以某种方式得到了重新编译的设备(我怀疑你可以做什么),它仍然会对你没有好处。怎么样告诉我们你想要解决什么问题,而不是你已经决定(错误地)解决它。
嘿,问题是...我必须下载整个网页(图片,样式表,脚本)在Windows Mobile ..但我知道一种技术是获取HTML和解析并下载每个link.its时间消耗和实施是复杂的..而是我正在寻找一些图书馆或接口,这有助于下载整个页面作为档案..所以它会很容易,我感觉如此。CDO之一,我看到,使用这整个webapeg可以存档在.Mht格式。但在移动它不支持: - (... – Naruto 2009-11-26 09:33:07
步骤来创建使用C++为Windows Mobile的DLL:
1)文件>新建>项目...>的Visual C++>智能设备> Win32的智能设备项目
2)写的名字该项目并单击确定。
3)下一步>插入需要
4)右键点击Source文件夹的SDK(如WM5和WM6)>下一页>点击DLL>完成,然后选择添加>新
5)查找.DEF文件名称与dll名称相同,然后单击确定。
现在高清你需要写这样的事:
LIBRARY "dllName"
EXPORTS
exactFunctionName1 DATA
exactFunctionName2 DATA
In dllName.cpp You need to add those two methods (exactFunctionName1, exactFunctionName2) and write code for them.
You don't need to state more then a method names in def (plus <tab><tab>DATA next to name).
Where to place the DLL after builiding to make use of it in my C# project
It must be placed next to Your app or in Windows folder of Your device.
To get methods from that library just do the following in C#:
using System.Runtime.InteropServices;
[DllImport("dllName.dll")]
private static extern anyReturnType exactFunctionName1(anyArgumentType argumentName);
So as an example let's get arithmethic sum form myMath.dll:
[DllImport("myMath.dll")]
private static extern int sum(int first, int second);
Those methods can be also public but they still require "static extern".
Following example in C++ side You'll have this:
In myMath.cpp:
INT sum(INT first, INT second)
{
return first + second;
}
In myMath.def:
LIBRARY "myMath"
EXPORTS
sum DATA
来源:
桌面不需要安装CF消耗CF组件。 CF组件可重定位并在完整框架下运行。 – ctacke 2009-11-25 16:16:46
谢谢ctacke。 – EKS 2009-11-26 09:05:24