首 页 | 新 闻 | Symbian | Android| Windows Mobile | J2ME | 下载中心 | 游戏策划招聘与求职 | 购书指南 | 视频教程
您现在的位置: 开发视界 >> Symbian >> Symbian开发 >> 正文
symbian与uiq开发教程[完整版](五)
作者:未知    文章来源:loveunix.net    更新时间:2005-11-19 17:26:28
函数是不是会Leave 这个在symbian中是以函数名的形式提供
函数名后面是L的表示它会Leave 函数名后面是LC的表示它会Leave,并且已经把指针push到cleanupstack中了

leave的情况:
是不是任何情况都会Leave呢
当然不是 只有资源申请失败或是操作失败时时会Leave 在系统库提供的函数是这样的

一般它也会提供不Leave的相同功能的函数
如Defined in TDesC8: 看TDesc8的类说明
Alloc(), AllocL(), AllocLC(), Compare(), CompareC(), CompareF(), Find(), Find(), FindC(), FindC(), FindF(), FindF(), Left(), Length(), Locate(), LocateF(), LocateReverse(), LocateReverseF(), Match(), MatchC(), MatchF(), Mid(), Mid(), Ptr(), Right(), Size(), operator!=(), operator<(), operator<=(), operator==(), operator>(), operator>=(), operator[]()

这里提供了Alloc()和AllocL()
看它们的说明
Alloc()
HBufC8* Alloc() const;
Description
Creates a new 8 bit heap descriptor and initialises it with a copy of this descriptor's data.

Return value
HBufC8* A pointer to the new 8 bit heap descriptor, if creation is successful. NULL, if creation of the descriptor fails.




--------------------------------------------------------------------------------

AllocL()
HBufC8* AllocL() const;
Description
Creates a new 8 bit heap descriptor and initialises it with a copy of this descriptor's data.

The function leaves, if creation of the descriptor fails.

Return value
HBufC8* A pointer to the 8 bit heap descriptor, if creation is successful.



See also:
Creating a heap descriptor

AllocLC()
HBufC8* AllocLC() const;
Description
Creates a new 8 bit heap descriptor and initialises it with a copy of this descriptor's data

The function leaves, if creation of the descriptor fails.

Return value
HBufC8* A pointer to the 8 bit heap descriptor, if creation is successful. The pointer is also put onto the cleanup stack.


对其它函数也一样

可以根据自己的需要来调用带L或是不带L的函数

必然会有不带L的函数 可能有带L的相同功能函数
其实上面还有一个特殊的符号 那就是_L
在symbian中是使用描述符的概念,与普通c/c++程序中字符串的概念不一样
后面会介绍它
相关文章:
不从默认堆分派内存单元
理解Symbian的命名规则
Nokia官方培训(Symbian 4300)笔记(五)--Memory Management
在16位descriptor和8位descriptor之间拷贝数据
使用CEikonEnv::Static()->CreateBitmapL()打开文件的时候程序当掉了,函数总是返回-1001错误代码。怎样才能找到訽因?
怎样获取可用的堆内存(heap memory)数量
从文件中读取中文乱码的解决办法
可写静态数据(WSD):问题解释和解决方法
 

站点地图 | 加入收藏 | 联系站长 | 广告服务 |
QQ:280529124  Tel:0592-8271361 辽ICP备05021703号