hDB = CeOpenDatabaseEx2(&guid, &CeOID, _T("Contacts Database"), 0, 0, &req);
if (hDB == INVALID_HANDLE_VALUE)
{
int r;
switch ((int)hDB)
{
case ERROR_INVALID_PARAMETER:
r = 1;
break;
case ERROR_FILE_NOT_FOUND:
r = 2;
break;
case ERROR_NOT_ENOUGH_MEMORY:
r = 3;
break;
default:
r = 4;
break;
}
}
}
LRESULT CALLBACK MyWndProc(
HWND hwnd,
UINT msg,
WPARAM wp,
LPARAM lp
)
{
int a = 0;
a += 1;
return TRUE;
}
int WINAPI WinMain(
HINSTANCE hInstance,
HINSTANCE hPrevInstance,
LPWSTR lpCmdLine,
int nCmdShow
)
{
MSG msg;
HWND hwnd = NULL;
BOOL fActivated;
WNDCLASS wc;
HWND hwndMain;
TCHAR szAppTitle[20];
/*创建我的收消息的窗口*****************************************/
hNotifyWnd = CreateWindow(g_szAppWndClass, NULL,
WS_CLIPCHILDREN, // Setting this to 0 gives a default style we don't want. Use a benign style bit instead.
0,0,0,0,
NULL, NULL, g_hInst, NULL );
if(!hNotifyWnd)
{
return(0);
}
mytest1();/*调测试接口*************************/
// Pump messages until a PostQuitMessage.
while(GetMessage(&msg, NULL, 0, 0))
{
TranslateMessage (&msg);
DispatchMessage(&msg);
}
return msg.wParam;
}