Launching of AVKON_DATA_QUERY dialog in console base application.

Login to reply to this topic.
Fri, 2008-04-11 13:28
Joined: 2008-03-18
Forum posts: 32

Hi all,

Can any one tell me how to launch dialog in console base application. My code is written below. I want to launch password dialog at
the time of uninstalling the application. But for launching R_PASSWORD_DIALOG we have to make one .rss file and i don't know whether
it is possible to add .rss file in console base application.

TBuf<20> answer;
CAknTextQueryDialog* queryDialog = CAknTextQueryDialog::NewL (answer);
queryDialog->ExecuteLD(R_PASSWORD_DIALOG);
TLex tokenizer = answer;
if(!tokenizer.NextToken().Compare(_L("1234")))
{
Exit();
//return KErrNone;
}
else
{

RWsSession iWsSession;
TApaAppInfo apaAppInfo;
RApaLsSession iLsSession;

User::LeaveIfError(iWsSession.Connect());
CleanupClosePushL(iWsSession);
User::LeaveIfError(iLsSession.Connect());
TUid KInstallerUidin3rdEd ;
TInt32 iUid;
// Console->Printf(KAppName);
// Console->Getch();
User::LeaveIfError(iLsSession.GetAllApps());
while(iLsSession.GetNextApp(apaAppInfo) == KErrNone)
{

//Console->Printf(KAppName);
//Console->Getch();
if(apaAppInfo.iCaption.Compare(KAppName) == 0)
{
// Console->Printf(apaAppInfo.iCaption);
// Console->Getch();
iUid = apaAppInfo.iUid.iUid;
//Console->Printf(iUid);
}

}

KInstallerUidin3rdEd.iUid = iUid;

TApaTaskList taskList(iWsSession);

TApaTask aTask = taskList.FindApp(KInstallerUidin3rdEd);
RThread t;
t.Open(aTask.ThreadId());
CleanupClosePushL(t);
RProcess r;
t.Process(r);
CleanupClosePushL(r);
r.Kill(0);
CleanupStack::PopAndDestroy(3);

Thanks
Sweta


NEWBIE OF SYMBIAN


Sat, 2008-04-12 11:35
Joined: 2007-08-29
Forum posts: 128
Re: Launching of AVKON_DATA_QUERY dialog in console base applica

Hi,

To display data query you need to write in .rss file of your application and handle in AppUI of your application. you can check query example for more details.


Thanks & Regards
Ram

Symbian OS 9.1,S60 3rd edition MR,and CodeWarrior 3.1

Mon, 2008-04-14 10:17
Joined: 2004-11-29
Forum posts: 1134
Re: Launching of AVKON_DATA_QUERY dialog in console base applica

You need the application framework in your thread to be able to use the dialogs.

Since you say you write a console application I assume you don't have it.

If you want to use dialogs and windows and controls, the easiest is to simply create the set of minimal app classes (appui, app, appdocument) and start the appframework with a call to "NewApplication" just as in a normal application.

It is also at least theoretically possible to create ccoeenv, ceikonenv, etc separately from scratch, but really, I wouldn't recommend it.
Even with access to the source code of the real app framework available, its a mess to do (I've tried), and will take a very long time to get right, and you will probably find you sit there with most of the app framework initialized anyway.

  • Login to reply to this topic.