|
在VC++中编译通过的程序为何到运行时就出现一个对话框,说要发送什么错误报告,调试等.这是为什么?请高手指教.
程序如下:/*===========================================================================
FILE: ITextdemo.c
===========================================================================*/
/*===============================================================================
INCLUDES AND VARIABLE DEFINITIONS
=============================================================================== */
#include "AEEModGen.h" // Module interface definitions
#include "AEEAppGen.h" // Applet interface definitions
#include "AEEShell.h" // Shell interface definitions
#include "AEEText.h"
#include "ITextdemo.bid"
#include "ITextdemo_res.h"
#define Menu_Start 1
#define Menu_Config 2
#define Menu_Help 3
#define Menu_About 4
#define Menu_Quit 5
#define MaxChar 30
/*-------------------------------------------------------------------
Function Prototypes
-------------------------------------------------------------------*/
static boolean ITextdemo_HandleEvent(IApplet * pi, AEEEvent eCode,
uint16 wParam, uint32 dwParam);
int AEEClsCreateInstance(AEECLSID ClsId,IShell * pIShell,IModule * po,void ** ppObj)
{
*ppObj = NULL;
if(ClsId == AEECLSID_ITEXTDEMO){
if(AEEApplet_New(sizeof(AEEApplet), ClsId, pIShell,po,(IApplet**)ppObj,
(AEEHANDLER)ITextdemo_HandleEvent,NULL)
== TRUE)
{
// Add your code here .....
return (AEE_SUCCESS);
}
}
return (EFAILED);
}
static boolean ITextdemo_HandleEvent(IApplet * pi, AEEEvent eCode, uint16 wParam, uint32 dwParam)
{
AEEApplet * pMe = (AEEApplet*)pi;
static ITextCtl* text = NULL;
static IMenuCtl* menu = NULL;
AEERect rect;
AEEDeviceInfo bi;
AECHAR char1[] = {'T','i','t','l','e','\0'};
AECHAR char2[]={' ','H','e','l','l','o',' ','W','o','r','l','d','\0'};
AECHAR char3[MaxChar];
switch (eCode)
{
case EVT_APP_START:
// µÃµ½É豸ÐÅÏ¢
ISHELL_GetDeviceInfo(pMe->m_pIShell,&bi);
rect.x = 10;
rect.y = 10;
rect.dx = 100;
rect.dy = 20;
//´´½¨Îı¾Ö¸Õë
if (ISHELL_CreateInstance(pMe->m_pIShell,AEECLSID_TEXTCTL,
(void**)&text) != SUCCESS)
return FALSE;
IMENUCTL_SetTitle(menu,ITEXTDEMO_RES_FILE,IMENU_TITLE,NULL);
IMENUCTL_AddItem(menu,ITEXTDEMO_RES_FILE,IMENU_START,Menu_Start,NULL,0);
IMENUCTL_AddItem(menu,ITEXTDEMO_RES_FILE,IMENU_HELP,Menu_Help,NULL,0);
IMENUCTL_AddItem(menu,ITEXTDEMO_RES_FILE,IMENU_CONFIG,Menu_Config,NULL,0);
IMENUCTL_AddItem(menu,ITEXTDEMO_RES_FILE,IMENU_ABOUT,Menu_About,NULL,0);
IMENUCTL_AddItem(menu,ITEXTDEMO_RES_FILE,IMENU_QUIT,Menu_Quit,NULL,0);
//¹ØÁªtext¿Ø¼þºÍmenu ¿Ø¼þ
ITEXTCTL_SetSoftKeyMenu(text,menu);
ITEXTCTL_SetProperties(text,TP_FRAME);
ITEXTCTL_SetRect(text,&rect);
ITEXTCTL_SetTitle(text,NULL,0,char1);
ITEXTCTL_SetText(text,char2,20);
ITEXTCTL_SetInputMode(text,AEE_TM_LETTERS);//É趨ÊäÈëģʽ
//¸üÐÂ
ITEXTCTL_Redraw(text);
IMENUCTL_Redraw(menu);
ITEXTCTL_SetActive(text,TRUE);
return(TRUE);
case EVT_APP_STOP:
if(text) {
ITEXTCTL_Release(text);
}
if(menu) {
IMENUCTL_Release(menu);
}
return TRUE;
case EVT_KEY:
//Èç¹ûÊÇÑ¡Ôñ¼ü,Ôò°ÑÎı¾¿Ø¼þÖеÄÄÚÈÝ×÷ΪһÏî²Ëµ¥Ïî¼Óµ½²Ëµ¥ÖÐ
if (wParam == AVK_SELECT) {
//°ÑÎı¾¿òÖеÄÎı¾COPYµ½char3
ITEXTCTL_GetText(text,char3,MaxChar);
//Óøոյõ½µÄÎı¾Ôö¼Ó²Ëµ¥Ïî
IMENUCTL_AddItem(menu,NULL,0,6,char3,0);
//¸üÐÂ
IMENUCTL_Redraw(menu);
}
//½»¸øITEXT¿Ø¼þµÄHandleEventÈ¥×ö,Èç¹û×öÁË´¦Àí,¾Í·µ»ØTRUE,·ñÔòÈóÌÐòÈ¥´¦Àí
if (ITEXTCTL_HandleEvent(text,eCode,wParam,dwParam))
return TRUE;
if (IMENUCTL_HandleEvent(menu,eCode,wParam,dwParam))
return TRUE;
break;
case EVT_COMMAND:
switch(wParam) {
case Menu_Start:
IDISPLAY_ClearScreen(pMe->m_pIDisplay);
IDISPLAY_DrawText(pMe->m_pIDisplay,AEE_FONT_NORMAL,char1,-1,50,20,NULL,NULL);
IDISPLAY_Update(pMe->m_pIDisplay);
return TRUE;
default:
break;
}
default:
break;
}
return FALSE;
} |
|