Re: RAS Entry in C - I really really need help

Tech-Archive recommends: Fix windows errors by optimizing your registry



Instead of using RAS API, send config XML to the CM_GPRSEntries
configuration service provider via the DMProcessConfigXML(). Look at

http://msdn.microsoft.com/library/en-us/guide_ppc/html/ppc_wce51grfcm_gprsentriescspozup.asp
http://msdn.microsoft.com/library/en-us/apippc/html/ppc__mdref_dmprocessconfigxml.asp

Hope that helps,
Darren

"David Burrows" <dave@xxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:%23MiETEsJGHA.2628@xxxxxxxxxxxxxxxxxxxxxxx
Hi all,

I using the below code to set-up a RAS entry and dial params in a C setup
program for a connection later on. The entries are copied directly from a
working RAS connection I can make in the "Connections"->"My ISP" editor of
PocketPC2003 SE3.

I just can't seem to get it to work connectly.

There looks to be a connection but it fails on authorisation and yet if I
use the exact same values in the "My ISP" editor it works.

I'm really at my wits end. In the code I'm checking every return for
error codes - this bit is missing below - but all functions succeed. It
seems so simple and yet it doesn't work. What is the editor doing that
I'm not?

Any help would be great.

SETUP CODE.....
RASENTRY RASEntry;
memset( &RASEntry, 0, sizeof(RASEntry) );
RASEntry.dwSize = sizeof(RASEntry);
RASEntry.dwfNetProtocols = RASNP_Ip;
RASEntry.dwFramingProtocol = RASFP_Ppp;
RASEntry.dwfOptions = RASEO_RemoteDefaultGateway;
wcscpy( RASEntry.szLocalPhoneNumber, TEXT("~GPRS!internet") );
wcscpy( RASEntry.szDeviceType, TEXT("modem") );
wcscpy( RASEntry.szDeviceName, TEXT("Cellular Line") );
RasSetEntryProperties( NULL, TEXT("Custom GPRS"), &RASEntry,
sizeof(RASEntry), NULL, NULL );

RASDIALPARAMS RASDialParams;
memset( &RASDialParams, 0, sizeof(RASDialParams) );
RASDialParams.dwSize = sizeof(RASDialParams);
wcscpy( RASDialParams.szEntryName, TEXT("Custom GPRS") );
wcscpy( RASDialParams.szUserName, TEXT("web") );
wcscpy( RASDialParams.szPassword, TEXT("web") );
RasSetEntryDialParams( NULL, &RASDialParams, false );

USAGE CODE....
RASDIALPARAMS RASDialParameters;
memset( &RASDialParameters,0,sizeof( RASDIALPARAMS ) );
RASDialParameters.dwSize = sizeof( RASDIALPARAMS );
wcscpy( RASDialParameters.szEntryName, TEXT("Custom GPRS") );
BOOL Password = false;
RasGetEntryDialParams( NULL, &RASDialParameters, &Password );

RasDial( NULL, NULL, &RASDialParameters, 0xFFFFFFFF, m_hWnd,
&hRASConnection ) ;





.



Relevant Pages

  • RAS Entry in C - I really really need help
    ... There looks to be a connection but it fails on authorisation and yet if I ... SETUP CODE..... ... wcscpy(RASEntry.szDeviceType, TEXT("modem")); ... RasSetEntryDialParams(NULL, &RASDialParams, false); ...
    (microsoft.public.pocketpc.developer)
  • Help!! External Modem on Serial Port
    ... wcscpy(RasEntry.szLocalPhoneNumber, TEXT("744")); ... RasSetEntryProperties(NULL, argv, &RasEntry, sizeof(RASENTRY), ... memset (&RasDialParams, 0, sizeof (RASDIALPARAMS)); ...
    (microsoft.public.windowsce.platbuilder)
  • Re: Programmatically choosing between multiple RAS profiles
    ... Depends somewhat on how you are interfacing to the RAS api, ... api will take a 'profile name' as a property within a 'rasDialParams' ... > I used to have just one dial-up profile on my CE handheld and RasDial ... > need to access different backends using Web services. ...
    (microsoft.public.dotnet.framework.compactframework)