Hi,

I wish to avoid the prompt to select the access point in each upload. I am using the following code.

Code Start:


User::LeaveIfError(ss.Connect());
err=iSocket.Open(ss, KAfInet, KSockStream, KUndefinedProtocol);


if(iPromptFlag) // Set the value of iPromptFlag=ETrue. It will execute first time to get the IAP id by prompting the dailog.
{

// Open a socket
err=iSocket.Open(ss, KAfInet, KSockStream, KUndefinedProtocol);
User::LeaveIfError(err);
CCommsDatabase* db = CCommsDatabase::NewL(EDatabaseTypeIAP);
CleanupStack::PushL(db);
CApUtils* apUtils = CApUtils::NewLC(*db);
CApSelect* apSelect = CApSelect::NewLC( *db, KEApIspTypeAll, EApBearerTypeAll, KEApSortNameAscending);
// Convert IAP id to CommsDb id

TUint32 id ;
id=apSelect->Uid();
aIap = apUtils->IapIdFromWapIdL(id);

CleanupStack::PopAndDestroy(apSelect);
CleanupStack::PopAndDestroy(apUtils);
CleanupStack::PopAndDestroy(db);
iPromptFlag=EFalse;
}
else
{

RHTTPSession iSession;
TCommDbConnPref prefs;
RStringPool strP;
RHTTPConnectionInfo connInfo;
RConnection iConnection;
TInt err;
TInetAddr ServerAddr(KInetAddrMMRServer, KTcpPort);
ss.Connect();
prefs.SetIapId(aIap); // using the IAP id which i get by if part


prefs.SetDialogPreference(ECommDbDialogPrefDoNotPrompt);// Note *******$$$$




prefs.SetDirection(ECommDbConnectionDirectionOutgoing);
prefs.SetBearerSet(KCommDbBearerUnknown);
User::LeaveIfError(iConnection.Open(ss));
User::LeaveIfError(iConnection.Start(prefs));

iSession.OpenL();
User::LeaveIfError(iConnection.Open(ss));
User::LeaveIfError(iConnection.Start(prefs));
strP = iSession.StringPool();
connInfo = iSession.ConnectionInfo();
connInfo.SetPropertyL ( strP.StringF(HTTP::EHttpSocketServ, RHTTPSession::GetTable() ), THTTPHdrVal (ss.Handle()) );
TInt connPtr = REINTERPRET_CAST(TInt, &iConnection);
connInfo.SetPropertyL ( strP.StringF(HTTP::EHttpSocketConnection, RHTTPSession::GetTable() ), THTTPHdrVal (connPtr) );
err=iSocket.Open(ss, KAfInet, KSockStream, KUndefinedProtocol,iConnection);

}

iSocket.Connect(ServerAddr, iStatus);

Code End


Note *******$$$$:- when i used EComDbDialogPrefPrompt it used to work but in the case of EComDbDialogPrefDoNotPrompt my application is not able to send the data to server and its show ing app cose error.
Please Help me its very urgent.


Thanks and Regards
Rakesh Kumar Jaiswal