tips

http://www.developer.nokia.com/Community/Wiki/Logs_Example

http://www.developer.nokia.com/Community/Wiki/Logs_monitoring_Example

http://code.google.com/p/htmlcontrol-for-symbian/source/browse/trunk/src/controlimpl.cpp


 

用自带短信阅读程序播放一条文本消息

 

iServiceHandler = CAiwServiceHandler::NewL();

 

http://www.developer.nokia.com/Community/Wiki/%E7%94%A8%E8%87%AA%E5%B8%A6%E7%9F%AD%E4%BF%A1%E9%98%85%E8%AF%BB%E7%A8%8B%E5%BA%8F%E6%92%AD%E6%94%BE%E4%B8%80%E6%9D%A1%E6%96%87%E6%9C%AC%E6%B6%88%E6%81%AF

 

防止内容显示在多媒体文件夹中

1、如果多个进程需要访问同一数据。那就需要完成一个client-server方案,其中一个进程请求打开和传递文件句柄给它的client,如果没有这样实现,就不能存放在private目录中

2、存放在 /system/data/<application_name>/

 

 

监听滚动条事件


  • 详细描述

该代码片段演示了如何监听滚动条事件。注意:代码中的MEikScrollBarObserver::HandleScrollEventL()使用需要触摸UI支持。该代码可以通过自签名执行。

 

 

非CBase类的清除栈支持

非CBase类的清除栈支持

迄今有关清除的讨论都假定待清除的对象是从CBase派生的,通过调用delete清除。其它类需要由程序员提供显式的清除支持。

清除栈通过CleanupStack::PushL()的两个重载版本支持其它类型的对象。你可以压入(push):

  • 一个TAny*: 这种对象通过对压入的指针调用User::Free()而被销毁。——注意这个不是那么强大: 简单释放内存,没有调用C++析构函数。
  • 一个TCleanupItem: 这种类型的对象包装了一个待压入对象的指针,以及提供清除那个对象的函数的指针。

SDK已提供了一些工具函数使构造一个适当的TCleanupItem变得容易。

例子: RPointerArray

RPointerArray 可以被压入清除栈并被安全销毁,通过给它制作一个TCleanupItem和一个静态函数。 在本例中,数组含有HBufC描述符。

// static cleanup function
static void PointerArrayCleanup( TAny* aArray )
    {
    static_cast<RPointerArray<HBufC>*>( aArray )->ResetAndDestroy();
    }
 
RPointerArray<HBufC> array;
...
TCleanupItem arrayCleanup( PointerArrayCleanup, &array );
CleanupStack::PushL( arrayCleanup );
...
CleanupStack::PopAndDestroy(); // arrayCleanup

 

如何检测在触摸界面中的长按动作

 

你的UI控件需要完成MAknLongTapDetectorCallBack接口

#include <aknlongtapdetector.h> 
 
class CImageConverterContainer : public CCoeControl, 
public MCoeControlObserver, public MAknLongTapDetectorCallBack
    {
    ...
    private: // From MAknLongTapDetectorCallBack
        void HandleLongTapEventL( const TPoint& aPenEventLocation, 
        const TPoint& aPenEventScreenLocation );
 
    private:
        CAknLongTapDetector* iLongTapDetector;
    ...
    }

源文件

// Create long tap detector
void CImageConverterContainer::ConstructL(const TRect& /*aRect*/)
    {
    ...
    iLongTapDetector = CAknLongTapDetector::NewL(this);
    ...
    }
 
// Redirect pointer events to long tap detector
void CImageConverterContainer::HandlePointerEventL(const TPointerEvent& 
aPointerEvent)
    {
    iLongTapDetector->PointerEventL(aPointerEvent);
    ...
    }	
 
// This method is called when long tap occurs	
void CImageConverterContainer::HandleLongTapEventL( const TPoint& 
aPenEventLocation, const TPoint& aPenEventScreenLocation )
    {
    // TODO: What to do when long tap detected
    ...
    }

 

 ==========

TFindFile

TFindFile findFile(iFsSession);
CDir* dir=NULL;
TInt error = findFile.FindWildByDir(parse.NameAndExt(), parse.Path(), dir);
delete dir;
if (error)
{
if (aShowDlgIfErr)
{
ErrorContextL(error,localizedFileName);
}
else
User::Leave(error);
}
else
localizedFileName=findFile.File();

=============================================

 

 

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值