This site is no longer active and is available for archival purposes only. Registration and login is disabled.

Help needed for Pocket PC program (Simple Tutorial)


Help needed for Pocket PC program (Simple Tutorial)

Postby chaser » Jul 28, 2004 @ 6:31am

Hi, all

I am very new in this field. I am learning the tutorial by this URL:

http://www.pocket-g.com/prx/winframe.html

///////////////////////////////////////////////
#include <windows.h>

LRESULT MainWndProc(HWND hWnd, UINT message, WPARAM uParam, LPARAM lParam)
{
PAINTSTRUCT ps;
HDC hDC;
RECT rcClient;

switch(message){
case WM_PAINT:
hDC = BeginPaint(hWnd,&ps);
GetClientRect(hWnd,&rcClient);
DrawText(hDC,L"Hello",5,&rcClient,DT_CENTER|DT_VCENTER);
EndPaint(hWnd,&ps);
break;

case WM_LBUTTONDOWN:
DestroyWindow(hWnd);
break;

default:
DefWindowProc(hWnd, message, uParam, lParam);
}
return 0;
}

int WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPTSTR lpCmdLine, int nCmdShow)
{
WNDCLASS wc;

memset(&wc,0,sizeof(wc));
wc.style = CS_HREDRAW|CS_VREDRAW;
wc.lpfnWndProc = (WNDPROC) MainWndProc;
wc.hInstance = hInstance;
wc.hbrBackground = GetStockObject(WHITE_BRUSH);
wc.lpszClassName = L"myapp";

if(RegisterClass(&wc))
{
HWND hWndMain;

if(hWndMain = CreateWindow(L"myapp",L"Hello",WS_VISIBLE,0,0,240,320,0,0,hInstance,0))
{
MSG msg;

ShowWindow(hWndMain, SW_MAXIMIZE);
UpdateWindow(hWndMain);

while(GetMessage(&msg,hWndMain,0,0))
DispatchMessage(&msg);

return msg.wParam;
}
}

return 0;
}

/////////////////////////////////////

The code is very simple. But when I build it, after the simulator emerged, an error message is prompt which said:

The Intelnet 80486 CPU does not support the configuaration example1 - Win32 (WCE ARM) Release!
Executable will not run on the device.

example1 is the project name I created.

The configuarations are:
Pocket PC 2002 Win32 (WCE ARM) Release Pocket PC 2002 Emulation

I tried to choose
Win32 (WCE x86) instead but get errors when compiling:

Compiling...
startup.c
C:\ppc\example1\startup.c(2 : warning C4007: 'WinMain' : must be '__stdcall'
C:\ppc\example1\startup.c(2 : error C2373: 'WinMain' : redefinition; different type modifiers
C:\Windows CE Tools\wce300\Pocket PC 2002\include\winbase.h(372) : see declaration of 'WinMain'
Error executing cl.exe.

startup.obj - 1 error(s), 1 warning(s)

Could any one give me a help? Any suggestion?

Many, many, many,... thanks!!!!!

Xiaobo
chaser
pm Member
 
Posts: 2
Joined: Jul 27, 2004 @ 7:12pm


Postby Dan East » Jul 28, 2004 @ 12:40pm

had already been moved to this Developer Forum.

Dan East
User avatar
Dan East
Site Admin
 
Posts: 5264
Joined: Jan 25, 2001 @ 5:19pm
Location: Virginia, USA


Return to Windows Mobile


Sort


Forum Description

A discussion forum for mobile device developers on the Windows Mobile platform. Any platform specific topics are welcome.

Moderators:

Dan East, sponge, Digby, David Horn, Kevin Gelso, RICoder

Forum permissions

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

cron