Hi all,

I need to start connection using different access points.

SDK is Series 60 v1.2

I use RGenericAgent to start connection.

I can start connection using any valid access point.
If I need to start connection using different access point, I terminate it first and reconnect using same code

below.

This works fine on 7650, 6670. But I get strange error on 7610.
When restarting connection using different access point I get KErrInUse message.

I tried to use CIntConnectionInitiator to start connection, it gave same result.

What is the problem?

I searched forum, RConnection is suggested to use on platform 2.0. Do I have to really? Because I want my

application is also compatible with platform 1.0 (7650, 3650).

I am stuck here.

Thank you in advance for giving some hints!

bsekerci.

<code>

void StartConnectionWithAgent(const TUint32& aIapId)
{
CCommsDatabase* cdb = CCommsDatabase::NewL(EDatabaseTypeIAP);
CleanupStack::PushL(cdb);

CCommsDbConnectionPrefTableView* connPrefView;
connPrefView = cdb->OpenConnectionPrefTableInRankOrderLC(ECommDbConnectionDirectionOutgoing);

TInt err = connPrefView->GotoFirstRecord();

CCommsDbConnectionPrefTableView::TCommDbIapConnectionPref aPref;

while (KErrNone == err)
{
connPrefView->ReadConnectionPreferenceL(aPref);
if (aPref.iBearer.iIapId == aIapId)
break;
err = connPrefView->GotoNextRecord();
}

aPref.iDialogPref = ECommDbDialogPrefDoNotPrompt;
aPref.iBearer.iIapId = aIapId;
aPref.iDirection=ECommDbConnectionDirectionOutgoing;

CStoreableOverrideSettings *m_overrides =

CStoreableOverrideSettings::NewL(CStoreableOverrideSettings::EParamListPartial,EDatabaseTypeIAP);
CleanupStack::PushL(m_overrides);
m_overrides->SetConnectionPreferenceOverride(aPref);

RGenericAgent iAgent;
User::LeaveIfError(iAgent.Open());
User::LeaveIfError(iAgent.StartOutgoing(*m_overrides));


CleanupStack::PopAndDestroy(m_overrides);

CleanupStack::PopAndDestroy(connPrefView);
CleanupStack::PopAndDestroy(cdb);
}
</code>