WINCE6.0在控制面板添加应用程序不成功

guetcw guetcw 墨衍会员 · AI 创作全网分发 墨衍智能分发 通过墨衍一键同步至各平台 可同步平台 CSDN微信公众号微博知乎掘金百家号博客园抖音小红书 你的文章也可以这样分发 墨衍会员 ¥399起/年,写一次发全网 我也要 + 加入社区
已以生成cpl,直接双击cpl可以调出应用程序,但是控制面板里不出现cpl的图标。我是按照MSDN的帮助的例子做的,和这个贴子的一样
http://blog.csdn.net/jjunjoe/article/details/6120601

调试发现是加载ICON失败,加载字符串资源也失败,ICON和字符串资源我都做好了的就是加载不成功

case CPL_NEWINQUIRE:
// This message is sent once for each dialog box, as
// determined by the value returned from CPL_GETCOUNT.
// lParam1 is the 0-based index of the dialog box.
// lParam2 is a pointer to the NEWCPLINFO structure.
{
ASSERT(0 == lParam1);
ASSERT(lParam2);

NEWCPLINFO* lpNewCplInfo = (NEWCPLINFO *) lParam2;
NKDbgPrintfW( (TEXT("HelloCPL:11111111111\r\n")));
if (lpNewCplInfo)
{
lpNewCplInfo->dwSize = sizeof(NEWCPLINFO);
lpNewCplInfo->dwFlags = 0;
lpNewCplInfo->dwHelpContext = 0;
lpNewCplInfo->lData = IDI_HelloWorld;

// The large icon for this application. Do not free this
// HICON; it is freed by the Control Panel infrastructure.
NKDbgPrintfW( (TEXT("HelloCPL:LoadIcon g_hModule %X\r\n")), g_hModule);
lpNewCplInfo->hIcon = LoadIcon(g_hModule, MAKEINTRESOURCE(IDI_HelloWorld));
NKDbgPrintfW( (TEXT("HelloCPL:LoadIcon %X\r\n")), lpNewCplInfo->hIcon);

int i = LoadString(g_hModule, IDS_APP_TITLE, lpNewCplInfo->szName, lengthof(lpNewCplInfo->szName));
NKDbgPrintfW( (TEXT("HelloCPL:LoadString %d\r\n")), i);

LoadString(g_hModule, IDC_HelloWorld, lpNewCplInfo->szInfo, lengthof(lpNewCplInfo->szInfo));
NKDbgPrintfW( (TEXT("HelloCPL:LoadString\r\n")));
_tcscpy(lpNewCplInfo->szHelpFile, _T(""));
return 0;
}
return 1; // Nonzero value means CPlApplet failed.
}

LoadIcon和LoadString都返回0,不知道哪里搞错了
...全文
评论 22
收藏 已收藏
分享
返回顶部
guetcw
嵌入开发(WinCE) 19,524 成员 41,565 内容