动态创建控件时碰到的问题
ari 2004-07-21 10:31:20 我在开发程序的过程中,碰到一个问题,希望能得到大家的指点:
///< 循环画出控件
for ( i = 0; i <= 14; i++,j++ ) {
pCtrl = CtlNewControl( (void**)&frmP, kindcode[i].flag, checkboxCtl,kindcode[i].name,
10, 25 + j * 15,
320, 28, stdFont, 0, true );
CtlDrawControl( pCtrl );
CtlSetValue( pCtrl, 1 );
}
此段代码为动态创建一组CheckBox,其中的kindecode的结构为:
kindcode {
UInt16 flag;
Char name[32];
};
在程序中为定义好的一个结构数组.
kindcode [] = {
{ 1, "A" },
{ 2, "B" },
{ 3, "C" },
...
};
程序代码能够按照我的设想来创建,但我发现当运行此段代码时,在Palm Emulator目录下面有log产生,内容为:
An "unallocated chunk of memory" is a chunk of memory that has not been reserved for use by the application
through calling MemPtrNew or MemHandleNew. It should not be accessed by applications under any circumstances.
Such an access usually means that an application is accessing a chunk that used to be allocated to the
application but has since been returned with MemPtrFree or MemHandleFree.
我不确定此log的含义,希望能得到各位的指点。