WINCE6.0在控制面板添加应用程序不成功
已以生成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.
}