×

Discussion Board

Results 1 to 2 of 2
  1. #1
    Registered User
    Join Date
    Sep 2007
    Posts
    47

    Get rid of IAP dialog

    Hi,

    My application has network code using RSocket. The IAP selection dialog comes up when the program initializes. However, the problem is that I still see the dialog during the networking. Do you have any idea? Thanks in advance!

    In the initialization , the following is used.

    Code:
    	TInt iapid = SelectIAPL();		
    	iPrefs.SetDialogPreference(ECommDbDialogPrefDoNotPrompt);
    	iPrefs.SetDirection(ECommDbConnectionDirectionOutgoing);
    	iPrefs.SetIapId(iapid);	
    	
    	iSockServer.Connect();	
    
    	iConnection.Open(iSockServer);
    	
    	iConnection.Start(iPrefs);
    In RunL(), the following is used.

    Code:
    if (iSocket.Open(iSockServer, KAfInet, KSockStream, KProtocolInetTcp, iConnection)){
    	iSocket.Connect(iAddress, iStatus) ;
    	SetActive();
    }
    .
    .
    .
    <Code for IAP selection>
    Code:
    TInt SelectIAPL()
    {
    	CArrayFixFlat<TIapData>* iEApList=new (ELeave) CArrayFixFlat<TIapData>(2) ;
    	TInt stack=0;
    	// Make listitems. and PUSH it
    	CAknSinglePopupMenuStyleListBox* list = new(ELeave) CAknSinglePopupMenuStyleListBox;
    	CleanupStack::PushL(list);stack++; 
     
    	// Create popup list and PUSH it.
    	CAknPopupList* popupList = CAknPopupList::NewL(list,
    		R_AVKON_SOFTKEYS_OK_CANCEL, AknPopupLayouts::EMenuWindow);
    	CleanupStack::PushL(popupList);stack++; 
     
    	CDesCArrayFlat* items = new (ELeave) CDesCArrayFlat(5);
    	CleanupStack::PushL(items);stack++; 
    	// initialize listbox.
    	list->ConstructL(popupList, CEikListBox::ELeftDownInViewRect);
    	list->CreateScrollBarFrameL(ETrue);
    	list->ScrollBarFrame()->SetScrollBarVisibilityL(CEikScrollBarFrame::EOff, 
    													CEikScrollBarFrame::EAuto);
     
    	TBuf<52> iapfromtable;
    	TInt err = KErrNone;
     
    	CCommsDatabase* iCommsDB=CCommsDatabase::NewL(EDatabaseTypeIAP);
    	CleanupStack::PushL(iCommsDB);stack++; 
    
    	CCommsDbTableView* gprsTable = iCommsDB->OpenIAPTableViewMatchingBearerSetLC(
    	ECommDbBearerGPRS|ECommDbBearerWLAN|ECommDbBearerVirtual,
    	ECommDbConnectionDirectionOutgoing); 
    
    	User::LeaveIfError(gprsTable->GotoFirstRecord());
    	TInt i=0;
    	TUint32 id;
    	TIapData eap;	
     
    	TInt cur =0; //current value
    	do
    	{
    		gprsTable->ReadTextL(TPtrC(COMMDB_NAME), iapfromtable);
    		gprsTable->ReadUintL(TPtrC(COMMDB_ID), id);
    		items->AppendL(iapfromtable);
    		eap.iIap = id;
    		eap.iName.Copy(iapfromtable);
    		iEApList->AppendL(eap);
     
    		err = gprsTable->GotoNextRecord();
    		i++;
    	}
    	while (err == KErrNone);
    	CleanupStack::PopAndDestroy(2); stack--; 
     
    	// Set listitems.
    	CTextListBoxModel* model = list->Model();
    	model->SetItemTextArray(items);
    	model->SetOwnershipType(ELbmOwnsItemArray);
    	CleanupStack::Pop();    
     
    	popupList->SetTitleL(_L("IAP"));
    	list->SetListBoxObserver(popupList);
    	TInt popupOk = popupList->ExecuteLD();
    	CleanupStack::Pop();    
    	TInt iap=0;
    	if (popupOk)
    	{	
    		TInt index = list->CurrentItemIndex();
    		iap=(*iEApList)[index].iIap;
     
    	}
    	CleanupStack::PopAndDestroy();  
    	iEApList->Reset();
    	delete iEApList;
    	return iap;
    }

  2. #2
    Registered User
    Join Date
    Sep 2007
    Posts
    47

    Re: Get rid of IAP dialog

    Oh, I just found the problem. The code above is absolute working. The problem was at RHostResolver.
    I will not delete my posting for those who may want this.

Similar Threads

  1. IAP selection dialog
    By HellenZ in forum Symbian Networking & Messaging (Closed)
    Replies: 4
    Last Post: 2008-03-13, 14:04
  2. IAP dialog only one and never again
    By marcinkrol84 in forum Symbian Networking & Messaging (Closed)
    Replies: 8
    Last Post: 2008-03-13, 13:59
  3. Why IAP dialog pop up in the bad network situation?
    By jesseek in forum Symbian Networking & Messaging (Closed)
    Replies: 0
    Last Post: 2007-04-09, 11:04
  4. how to cancel the IAP Dialog ??
    By flokriesel in forum Symbian Networking & Messaging (Closed)
    Replies: 1
    Last Post: 2006-09-13, 22:23
  5. IAP Dialog box - Trapping "Cancel Button" Click?
    By sethuraman in forum Symbian Networking & Messaging (Closed)
    Replies: 2
    Last Post: 2006-04-10, 09:58

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×