We help IT Professionals succeed at work.

We've partnered with Certified Experts, Carl Webster and Richard Faulkner, to bring you two Citrix podcasts. Learn about 2020 trends and get answers to your biggest Citrix questions!Listen Now


Configuring (GPRS) connections (programmatically)

OnixExp asked
Medium Priority
Last Modified: 2013-12-27
Fellow Experts,

Assuming a freshly installed Windows Mobile 2003/2005 device, I need to programmatically add/configure connections. I think the settings are normally done through the Settings / Connections / "Add a new modem connection" menu, so I figured there must be a way to let an application do that.

My question is two-fold:
1a. Can I get some specific pointers on which methods/API's I should look into to accomplish this (i.e. not just "TAPI" or something but necessary methods)?

1b. Partially or fully working examples?

I'm looking to add a GPRS / UMTS connection, and later also a WiFi connection (but that probably needs to be a different Q, if somebody knows this though I can setup that Q for points). Shouldn't be that difficult but it's a short term thing..
Watch Question


Found this example in the SDK:

BOOL GetPhonebookEntries (HWND hDlgWnd)
  int index;
  DWORD dwSize, dwEntries;
  HWND hWndListBox;

  // Allocate an array of RASENTRYNAME structures. Assume
  // no more than 20 entries to be configured on the
  // Windows CE-based device.

  if (!(lpRasEntryName = new RASENTRYNAME [20]))
    MessageBox (hDlgWnd, TEXT("Not enough memory"), szTitle, MB_OK);
    return FALSE;

  // Initialize the dwSize member of the first RASENTRYNAME structure
  // in the array to the size of the structure to identify
  // the version of the structure being passed.
  lpRasEntryName[0].dwSize = sizeof (RASENTRYNAME);

  // Size of the array, in bytes
  dwSize = sizeof (RASENTRYNAME) * 20;

  // List all entry names in a remote access Phone book.
  if ((RasEnumEntries (
          NULL,               // Reserved, must be NULL
          NULL,               // Phone book is stored in the Windows CE
                              // registry.
          lpRasEntryName,     // Pointer to structure to receive entries
          &dwSize,            // Size of lpRasEntryName, in bytes
          &dwEntries)) != 0)  // Number of entries placed in array
    MessageBox (hDlgWnd, TEXT("Could not obtain RAS entries"), szTitle,
    return FALSE;

  // Get the HWND of the list box control.
  hWndListBox = GetDlgItem (hDlgWnd, IDC_RASNAMES);

  // Remove all items from a list box.
  SendMessage (hWndListBox, LB_RESETCONTENT, 0, 0);

  // Add the names of each RAS connection to the list box.
  for (index = 0; index < (int)dwEntries; ++index)
    SendMessage (hWndListBox, LB_INSERTSTRING, index,

  return TRUE;

So it seems like I've foudn the answer to my questions.
Closed, 500 points refunded.
Community Support Moderator

Not the solution you were looking for? Getting a personalized solution is easy.

Ask the Experts
Access more of Experts Exchange with a free account
Thanks for using Experts Exchange.

Create a free account to continue.

Limited access with a free account allows you to:

  • View three pieces of content (articles, solutions, posts, and videos)
  • Ask the experts questions (counted toward content limit)
  • Customize your dashboard and profile

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.


Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.