程序有错,求高人调试!!在线等~~急呀~~~~
/*---------------------------------------------
FILE: keymove.c
---------------------------------------------*/
#include "AEEModGen.h" // Module interface definitions
#include "AEEAppGen.h" // Applet interface definitions
#include "AEEShell.h" // Shell interface definitions
#include "keymove.bid" // Applet-specific header that contains class ID
#include "aeedisp.h"
#ifndef Max
#define Max( x, y ) ( ((x) > (y)) ? (x) : (y) )
#endif
#ifndef Min
#define Min( x, y ) ( ((x) < (y)) ? (x) : (y) )
#endif
typedef struct _CKeyApp {
AEEApplet a; // Mandatory first AEEApplet data member
int x; int y;
int cxScreen; int cyScreen;
}CKeyApp;
static boolean keymove_HandleEvent(AEEApplet * pi, AEEEvent eCode, uint16 wParam, uint32 dwParam);
int AEEClsCreateInstance(AEECLSID ClsId, IShell * pIShell,IModule * po,void ** ppObj)
{
*ppObj = NULL;
if(ClsId == AEECLSID_KEYMOVE)
{
if(AEEApplet_New(sizeof(CKeyApp), ClsId, pIShell,po,(IApplet**)ppObj,
(AEEHANDLER)keymove_HandleEvent,NULL)
== TRUE)
{ // Add your code here .....
return (AEE_SUCCESS);
}
}
return (EFAILED);
}
static boolean keymove_HandleEvent(AEEApplet * pMe, AEEEvent eCode, uint16 wParam, uint32 dwParam)
{
CKeyApp *pApp = (CKeyApp *)pMe; AEERect rc; AEEDeviceInfo deviceInfo;
switch (eCode) {
case EVT_APP_START: ISHELL_GetDeviceInfo(pApp->a.m_pIShell, &deviceInfo); pApp->x = (deviceInfo.cxScreen - 8)/2; pApp->y = (deviceInfo.cyScreen - 8)/2; pApp->cxScreen = deviceInfo.cxScreen; pApp->cyScreen = deviceInfo.cyScreen; SETAEERECT(&rc,pApp->x,pApp->y,8,8);
IDISPLAY_DrawRect(pApp->a.m_pIDisplay,&rc,0xff000000,0x00ff0000,
IDF_RECT_FRAME|IDF _RECT_FILL);
IDISPLAY_Update (pApp->a.m_pIDisplay);
return(TRUE);
case EVT_KEY:
SETAEERECT(&rc,pApp->x,pApp->y,8,8);
IDISPLAY_DrawRect(pApp->a.m_pIDisplay,&rc,0xffffff00,0xffffff00,
IDF_RECT_FRAME|IDF_RECT_FILL);
switch(wParam)
{
case AVK_UP: pApp->y -=4; break;
case AVK_DOWN: pApp->y +=4; break;
case AVK_LEFT: pApp->x -=4; break;
case AVK_RIGHT: pApp->x +=4; break;
default: return FALSE;
} pApp->x = Max(0, Min(pApp->x, pApp->cxScreen - 8)); pApp->y = Max(0, Min(pApp->y, pApp->cyScreen - 8)); SETAEERECT(&rc,pApp->x,pApp->y,8,8);
IDISPLAY_DrawRect(pApp->a.m_pIDisplay,&rc,0xff000000,0x00ff0000,
IDF_RECT_FRAME|IDF _RECT_FILL);
IDISPLAY_Update (pApp->a.m_pIDisplay);
return TRUE;
case EVT_APP_STOP:
return TRUE; default: break; }
return FALSE;
}
[解决办法]
贴一下报错信息呀