WEB开发网
开发学院手机开发Symbian 开发 symbian资源的自定义和解析 阅读

symbian资源的自定义和解析

 2010-10-20 08:00:08 来源:WEB开发网   
核心提示:},DATA{wrd = 33;lng = 44;ltxt = "data2";byt = 2;dbl = 3.11;},DATA{wrd = 55;lng = 66;ltxt = "data3";byt = 3;dbl = 4.11;}};}RESOURCE MYCUSTOM

},

DATA

{

wrd = 33;

lng = 44;

ltxt = "data2";

byt = 2;

dbl = 3.11;

},

DATA

{

wrd = 55;

lng = 66;

ltxt = "data3";

byt = 3;

dbl = 4.11;

}

};

}

RESOURCE MYCUSTOM r_mycustom_data

{

wrd = 10;

lng = 1000;

datas = r_data_array;

}

在cpp里面读取以上自己写的资源

HBufC8* resource = CCoeEnv::Static()->AllocReadResourceAsDes8LC(R_MYCUSTOM_DATA);

TResourceReader reader;

reader.SetBuffer(resource);

TInt a = reader.ReadInt16();

TInt b = reader.ReadInt32();

TInt res = reader.ReadInt32();

HBufC8* res1 = CCoeEnv::Static()->AllocReadResourceAsDes8LC(res);//转到LLINK的资源地址

reader.SetBuffer(res1);

TInt count = reader.ReadInt16();//数组用前两个字节来标识数组长度

for (TInt i=0;i

{

TInt wrd = reader.ReadInt16();

TInt lng = reader.ReadInt32();

TPtrC ptr = reader.ReadTPtrC();

TInt bte = reader.ReadUint8();

TReal dbl = reader.ReadReal64();

}

CleanupStack::PopAndDestroy(2);

上一页  1 2 

Tags:symbian 资源 自定

编辑录入:爽爽 [复制链接] [打 印]
赞助商链接