GPRS connection, RAS entry structure

F

Francesco

Hi everybody,
I need to create via code a gprs connection.
I have no problem to Ras.dial a gprs connection created via pocket pc
user interface, but I can't understand which parameters I got to
specify on the RasSetEntryProperties function.
On the user interface, I specify the following additional AT commands:
+cgdcont=1,"IP","web.omnitel.it"

where do I have to specify this on the rasEntry structure????
Thanks for your help

I post here the eVC function I use to create the connection

COMM_API int CreateRasConnection(wchar_t *entryName,wchar_t
*modem,wchar_t *phoneNumber,wchar_t *userName,wchar_t *password)
{
DWORD dwOutcome;
RASENTRY RasEntry;
RASDIALPARAMS RasDialParams;

// Initialize the RASENTRY structure.
memset (&RasEntry, 0, sizeof (RASENTRY));

RasEntry.dwSize = sizeof (RASENTRY);

// Retrieve the entry properties.
dwOutcome = RasGetEntryProperties ( NULL,
TEXT(""),
&RasEntry,
&RasEntry.dwSize,
NULL,
NULL);
if (dwOutcome) return dwOutcome;

// Fill the RASENTRY structure.
RasEntry.dwfOptions = RASEO_IpHeaderCompression +
RASEO_SwCompression;
wcscpy (RasEntry.szDeviceType, RASDT_Modem);
wcscpy (RasEntry.szDeviceName, modem);
wcscpy (RasEntry.szLocalPhoneNumber, phoneNumber);
RasEntry.dwFramingProtocol = RASFP_Ppp;
RasEntry.dwfNetProtocols = RASNP_Ip;

// Create a new phone-book entry.
dwOutcome = RasSetEntryProperties ( NULL,
entryName,
&RasEntry,
RasEntry.dwSize,
NULL,
0);
if (dwOutcome) return dwOutcome;

// Initialize the RASDIALPARAMS structure.
memset (&RasDialParams, 0, sizeof (RASDIALPARAMS));

// Configure the RASDIALPARAMS structure.
RasDialParams.dwSize = sizeof (RASDIALPARAMS);
wcscpy (RasDialParams.szEntryName, entryName);
wcscpy (RasDialParams.szPhoneNumber, phoneNumber);
wcscpy (RasDialParams.szUserName, userName);
wcscpy (RasDialParams.szPassword, password);

dwOutcome = RasSetEntryDialParams( NULL,
&RasDialParams,
FALSE);

return dwOutcome;
}
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top