[高分]window mobile5 中操作通讯录,该如何解决
发布时间:2010-05-30 00:56:11 文章来源:www.iduyao.cn 采编人员:星星草
[高分]window mobile5 中操作通讯录
用vs2005(C++)写一个程序,在mobile5中能把数据按通讯录的格式导入数据到通讯录里。
请教各位大虾,如何实现,有哪些函数或方法
------解决方案--------------------
你的代码里面“polApp”是个空值,怎么可能继续走下去呢?你可以用下面的代码初始化
BOOL InitPoom(HWND hwnd)
{
BOOL bSuccess = FALSE;
if (SUCCEEDED(CoInitializeEx( NULL, 0)))
{
// Now, let 's get the main outlook application
if (SUCCEEDED(CoCreateInstance(CLSID_Application, NULL, CLSCTX_INPROC_SERVER,
IID_IPOutlookApp, reinterpret_cast <void **> (&g_polApp))))
{
// login to the Pocket Outlook object model
if(SUCCEEDED(g_polApp-> Logon(NULL)))
{
// can 't login to the app
bSuccess = TRUE;
}
}
}
return bSuccess;
}
------解决方案--------------------
D:\Program Files\Windows CE Tools\wce500\Windows Mobile 5.0 Pocket PC SDK\Samples\CPP\Win32
其实在你WM5.0的目录下有很多例子可以参考,poom的操作你可以参考Poommaster里的Poomdata.cpp
//
// Copyright (c) Microsoft Corporation. All rights reserved.
//
//
// Use of this source code is subject to the terms of the Microsoft end-user
// license agreement (EULA) under which you licensed this SOFTWARE PRODUCT.
// If you did not accept the terms of the EULA, you are not authorized to use
// this source code. For a copy of the EULA, please see the LICENSE.RTF on your
// install media.
//
// ************************************************************
// POOMDATA.CPP
//
// Implementation of generic POOM data access functions
//
// Includes
#include "PoomMaster.h "
// Globals
IPOutlookApp * g_polApp = NULL;
// **************************************************************************
// Function Name: InitPoom
//
// Purpose: Creates and logs on to the POOM application object
//
// Arguments:
// none
//
// Return Values:
// BOOL
// returns TRUE if POOM was initialized, FALSE otherwise
//
// Description:
// This function creates the POOM application COM object and starts a POOM
// session via Logon. This must be done before any subsequent POOM calls are
// made.
BOOL InitPoom(HWND hwnd)
{
;
BOOL bSuccess = FALSE;
if (SUCCEEDED(CoInitializeEx( NULL, 0)))
{
// Now, let 's get the main outlook application
if (SUCCEEDED(CoCreateInstance(CLSID_Application, NULL, CLSCTX_INPROC_SERVER,
IID_IPOutlookApp, reinterpret_cast <void **> (&g_polApp))))
{
// login to the Pocket Outlook object model
if(SUCCEEDED(g_polApp-> Logon(NULL)))
{
// can 't login to the app
bSuccess = TRUE;
}
}
}
return bSuccess;
}
// **************************************************************************
// Function Name: GetPoomFolder
//
// Purpose: Gets the default folder for the specified POOM item type
//
// Arguments:
// IN int nFolder - POOM folder type to return, olFolderTasks,
// olFolderContacts, or olFolderCalendar in this app
// OUT IFolder ** ppFolder - pointer to IFolder interface returned.
// Must be released by caller of GetPoomFolder
//
// Return Values:
// BOOL
// returns TRUE if the folder interface was retrieved, FALSE otherwise
//
// Description:
// This function simply encapsulates a call on the global Outlook app interface. The
// returned pointer is simply passed through this function.
友情提示:
信息收集于互联网,如果您发现错误或造成侵权,请及时通知本站更正或删除,具体联系方式见页面底部联系我们,谢谢。
其他相似内容:
-
wince手持设备串口通信问题(在线等回复)
手持设备上的串口COM4能用函数CreatFile()打开(以同步模式),但用WriteFile()发送数据时,里边参数显...
-
windows mobile 移动开发用的是什么语言啊
windows mobile 移动开发用的是什么语言啊 我是学c/c++的想做 windows mobile 方面的...
-
Gps获得的经纬度不准确
通过GPSGetPosition获得到数据
纬度比实际纬度大0.002度左右
经度比实际经度小0.004度左右
测的位置与实...
-
wp7 利用ZipOutputStream压缩.txt文件问题
//压缩
private static void CreateZipFile(string filesPath, string zipFi...
-
WP开发工具安装问题
因为一些其他的原因,我暂时我只能工作在XP的环境下,但是我正在WP开发的路中。
我在XP上安装WP开发工具的时候...
-
VS2008的wince 6.0模拟器怎么和PC端的socket连接,需要怎么设置模拟器,谢谢
VS2008的wince 6.0模拟器怎么和PC端的socket连接,需要怎...
-
Windows Phone Express
我安装了Microsoft Virtual Studio 2010 for Express Windows Phone,Windows Phone项目成功创建,但是模拟器...
-
关于fmodce.dll资源释放的问题
请教各位: 使用C#在Mobile上用fmodce.dll进行声音文件的播放,播放结束调用:
bool isSuccess = fmod_S...
-
wp7 如何把手机联系人的电话号码写到一个.txt文件里面?
wp7 如何把手机联系人的电话号码写到一个.txt文件里面?
------解决方案---...
-
为什么C#修改注册表没有权限 如何获得权限?
C# code
RegistryKey key = Registry.LocalMachine.OpenSubKey(@"SOFTWARE\MICROSOFT...