⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 singlerequest.cpp

📁 Symbain mobile code 手机应用程序源代码--基本结构方面
💻 CPP
字号:
// SingleRequest.cpp
//
// Copyright (C) Symbian Software Ltd 2000-2005.  All rights reserved.
//
//  Shows asynchronous programming (without active objects).
//	Example shows how a single request can be issued, followed
//	by User::WaitForRequest()


#include "CommonFramework.h"



// Do the example
LOCAL_C void doExampleL()
    {
	  // create and initialize heartbeat timer
	RTimer heartbeat;               // heartbeat timer

	TRequestStatus heartbeatStatus; // request status associated with it
	heartbeat.CreateLocal();        // always created for this thread

	  // go round timing loop
	for (TInt i=0; i<10; i++)
		{
		  // issue and wait for single request
		heartbeat.After(heartbeatStatus,1000000); // wait 1 second
		User::WaitForRequest(heartbeatStatus);    // wait for request
		                                          // to complete
		  // say we're here
		_LIT(KFormatString1,"Tick %d\n");
		console->Printf(KFormatString1, i);
		}

	  // close timer
	heartbeat.Close(); // close timer
	}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -