Click here to Skip to main content
15,898,134 members
Home / Discussions / Mobile
   

Mobile

 
AnswerRe: Transfer data faster Pin
Mike Dimmick27-Sep-07 6:46
Mike Dimmick27-Sep-07 6:46 
AnswerRe: Transfer data faster Pin
DigiOz Multimedia16-Oct-07 16:11
DigiOz Multimedia16-Oct-07 16:11 
QuestionNo PPC skin in designer view Pin
Szymon Kamycki22-Sep-07 7:50
Szymon Kamycki22-Sep-07 7:50 
QuestionBackground color for progressbarctrl Pin
MuthiahR21-Sep-07 12:37
MuthiahR21-Sep-07 12:37 
AnswerRe: Background color for progressbarctrl Pin
Alain Rist21-Sep-07 21:37
Alain Rist21-Sep-07 21:37 
GeneralRe: Background color for progressbarctrl Pin
MuthiahR24-Sep-07 4:45
MuthiahR24-Sep-07 4:45 
GeneralRe: Background color for progressbarctrl Pin
MuthiahR27-Sep-07 5:31
MuthiahR27-Sep-07 5:31 
QuestionRAS connection using GSM - GPRS Modem [modified] Pin
BschroederNEC20-Sep-07 10:57
BschroederNEC20-Sep-07 10:57 
How do I programmatically set the Extra Initialization string on the modem when making a RAS connection through a GSM – GPRS modem device to get TCP/IP connectivity through the ISP provider to the internet??

Here’s the Extra Initialization string needed on the modem for RAS: +CGDCONT=1,"IP,"IPS.CINGULAR"

Here’s my targeted device environment:
OS: Windows CE 5.0 (using .Net Compact Framework 2.0)

Here’s the sample code that I’m calling to connect to a RAS phonebook entry profile.

namespace TestDevices
{
class RasWrapperII
{
[DllImport("coredll.dll")]
public static extern uint RasDial(IntPtr dialExtensions,
IntPtr phoneBookPath,
IntPtr rasDialParam,
uint NotifierType,
IntPtr notifier,
ref IntPtr pRasConn);

[DllImport("coredll.dll")]
public static extern uint RasHangUp(IntPtr pRasConn);

///
/// EntryName ,UserName,Password - same as in RASDIALPARAMS structure (see MSDN)
///

/// <param name="EntryName" />
/// <param name="UserName" />
/// <param name="Password" />
/// <param name="RasConn" />
/// <returns>
unsafe public static uint myRasDial(string EntryName, string UserName, string Password, out IntPtr RasConn)
{
uint r = 0;
RasConn = IntPtr.Zero;
byte[] bRASDIALPARAMS = new byte[1464];
fixed (byte* pAddr = bRASDIALPARAMS)
{
byte* pCurrent = pAddr;
Marshal.WriteInt32((IntPtr)pCurrent, bRASDIALPARAMS.Length);
pCurrent += 4;
foreach (byte b in Encoding.Unicode.GetBytes(EntryName))
{
Marshal.WriteByte((IntPtr)pCurrent, b);
pCurrent++;
}
pCurrent = pAddr + 0x192; //0x192 - offset for RASDIALPARAMS.UserName
foreach (byte b in Encoding.Unicode.GetBytes(UserName))
{
Marshal.WriteByte((IntPtr)pCurrent, b);
pCurrent++;
}
pCurrent = pAddr + 0x394; //0x394 - offset for RASDIALPARAMS.Password
foreach (byte b in Encoding.Unicode.GetBytes(Password))
{
Marshal.WriteByte((IntPtr)pCurrent, b);
pCurrent++;
}
r = RasDial(IntPtr.Zero, IntPtr.Zero, (IntPtr)pAddr, 0, IntPtr.Zero, ref RasConn);
}
return r;
}
}
}

The Call Code:

IntPtr conn; // connection handle
uint rc = RasWrapperII.myRasDial(this.txtPhoneNbr.Text, this.txtUserName.Text, this.txtPassword.Text, out conn);
if (rc == 0)
{
try
{
TcpClient client = new TcpClient();
client.Connect("www.amazon.com", 80);
MessageBox.Show("Successful Connection!", "TCP Client Call", MessageBoxButtons.OK,
MessageBoxIcon.Exclamation, MessageBoxDefaultButton.Button1);
}
catch (Exception ex)
{
MessageBox.Show("Connection Failed! Reason=" + ex.Message, "TCP Client Call", MessageBoxButtons.OK,
MessageBoxIcon.Exclamation, MessageBoxDefaultButton.Button1);
}
RasWrapperII.RasHangUp(conn);
}
else throw new ApplicationException("Return Code: " + rc.ToString());

Thanks in advance for any help that someone can provide.

-Bill




-- modified at 18:04 Friday 21st September, 2007
AnswerRe: RAS connection using GSM - GPRS Modem Pin
Mike Dimmick27-Sep-07 6:16
Mike Dimmick27-Sep-07 6:16 
GeneralRe: RAS connection using GSM - GPRS Modem Pin
BschroederNEC27-Sep-07 6:54
BschroederNEC27-Sep-07 6:54 
GeneralRe: RAS connection using GSM - GPRS Modem Pin
A P Prajwal29-Jun-09 21:45
A P Prajwal29-Jun-09 21:45 
QuestionHelp regarding sending sms Pin
anu8120-Sep-07 1:16
anu8120-Sep-07 1:16 
QuestionGet Current Directory Pin
chemipoo13-Sep-07 3:10
chemipoo13-Sep-07 3:10 
AnswerRe: Get Current Directory Pin
Alain Rist14-Sep-07 0:42
Alain Rist14-Sep-07 0:42 
QuestionFAST FUNCTION TO WRITE A FILE? Pin
AlexB4712-Sep-07 23:28
AlexB4712-Sep-07 23:28 
QuestionWin Mobile: How to draw an "always on top" graphical element? Pin
thomanil12-Sep-07 1:43
thomanil12-Sep-07 1:43 
QuestionWifi connection through a java/j2me program Pin
haimasree11-Sep-07 5:04
haimasree11-Sep-07 5:04 
QuestionFind character position into .txt file Pin
k.giannis_198010-Sep-07 3:59
k.giannis_198010-Sep-07 3:59 
QuestionSending SMS from a PC that is connected to a Windows Mobile Phone Pin
Hadi Dayvary10-Sep-07 0:16
professionalHadi Dayvary10-Sep-07 0:16 
Questionvisual studio express? Pin
ruanr7-Sep-07 0:25
ruanr7-Sep-07 0:25 
AnswerRe: visual studio express? Pin
leckey8-Sep-07 13:31
leckey8-Sep-07 13:31 
QuestionBlack Barry Application.... Pin
PavanPareta6-Sep-07 2:23
PavanPareta6-Sep-07 2:23 
QuestionTerrible Stack Overflow Exception error.... Pin
SKP245-Sep-07 22:49
SKP245-Sep-07 22:49 
QuestionAccessing phone functions on Windows Mobile 2003 Pin
Crumpler794-Sep-07 16:28
Crumpler794-Sep-07 16:28 
Question.exp file Pin
George_George4-Sep-07 5:08
George_George4-Sep-07 5:08 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.