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;
}
Alex Yakhnin [MVP] - 10 Jun 2004 16:42 GMT
These are "extra-dial" string command that could be set in the registry.
Take a look at this thread:
http://groups.google.com/groups?hl=en&lr=&ie=UTF-8&c2coff=1&threadm=O1vgRw2CEHA.
3408%40tk2msftngp13.phx.gbl&rnum=2&prev=/groups%3Fq%3Dextra%2Bdial-string%2Bmode
m%2Bregistry%26hl%3Den%26lr%3D%26ie%3DUTF-8%26c2coff%3D1%26selm%3DO1vgRw2CEHA.34
08%2540tk2msftngp13.phx.gbl%26rnum%3D2
--
Alex Yakhnin .NET CF MVP
www.intelliprog.com | www.opennetcf.org
> Hi everybody,
> I need to create via code a gprs connection.
[quoted text clipped - 64 lines]
> return dwOutcome;
> }