在vs下新建VC++智能项目,利用仿真器代替真实设备测试应用程序。
这里以smartphone平台为例:
// test1.cpp : 定义应用程序的入口点。
//
#include "stdafx.h"
#include "test1.h"
#include <windows.h>
#include <commctrl.h>
#define MAX_LOADSTRING 100
// 全局变量:
HINSTANCE g_hInst; // 当前实例
HWND g_hWndMenuBar; // 菜单栏句柄
// 此代码模块中包含的函数的前向声明:
ATOM MyRegisterClass(HINSTANCE, LPTSTR);
BOOL InitInstance(HINSTANCE, int);
LRESULT CALLBACK WndProc(HWND, UINT, WPARAM, LPARAM);
INT_PTR CALLBACK About(HWND, UINT, WPARAM, LPARAM);
int WINAPI WinMain(HINSTANCE hInstance,
HINSTANCE hPrevInstance,
LPTSTR lpCmdLine,
int nCmdShow)
{
MSG msg;
// 执行应用程序初始化:
if (!InitInstance(hInstance, nCmdShow))
{
return FALSE;
}
HACCEL hAccelTable;
hAccelTable = LoadAccelerators(hInstance, MAKEINTRESOURCE(IDC_TEST1));
MessageBox(NULL,TEXT("welcome to smartphone!"),TEXT("hello"),MB_OK);
// 主消息循环:
while (GetMessage(&msg, NULL, 0, 0))
{
if (!TranslateAccelerator(msg.hwnd, hAccelTable, &msg))
{
TranslateMessage(&msg);
DispatchMessage(&msg);
}
}
return (int) msg.wParam;
}