Results 1 to 8 of 8

Thread: Setup Internet connection on Windows Mobile device.

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Nov 2010
    Posts
    6
    Thanks
    2
    Thanked 3 Times in 3 Posts
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Windows Symbian S60

    Default Re: Setup Internet connection on Windows Mobile device.

    I've managed to do it with windows functions. At first you must prepare a cellular line connection in conections menu.
    Next you should do something like this :

    Qt Code:
    1. #include <aygshell.h>
    2. #include <initguid.h>
    3. #include <connmgr.h>
    4.  
    5. bool connectHSDPANetwork()
    6. {
    7. CONNMGR_CONNECTIONINFO cci = {0};
    8. cci.cbSize = sizeof(CONNMGR_CONNECTIONINFO);
    9. cci.dwParams = CONNMGR_PARAM_GUIDDESTNET;
    10. cci.dwPriority = CONNMGR_PRIORITY_USERINTERACTIVE;
    11. cci.guidDestNet = IID_DestNetCorp;
    12.  
    13. DWORD dwResult;
    14.  
    15. HRESULT hr = ConnMgrEstablishConnectionSync( &cci, &cHandle, 0, &dwResult ) ;
    16. if (hr == S_OK)
    17. return true;
    18. else
    19. return false;
    20. }
    To copy to clipboard, switch view to plain text mode 

  2. The following user says thank you to grublik for this useful post:

    sergey_m (7th January 2011)

  3. #2
    Join Date
    Jan 2011
    Location
    Russia
    Posts
    6
    Thanks
    3

    Default Re: Setup Internet connection on Windows Mobile device.

    Thanks for your answer.

    I also implemented it with connection manager. hust tested it.

    Now will remove all unnecessary code.

    Qt Code:
    1. GUID guid;
    2. LPCTSTR url = L"http://www.msn.com";
    3. HRESULT hresult = ConnMgrMapURL((LPCTSTR)url,&guid,NULL);
    4. if (!SUCCEEDED(hresult))
    5. {
    6. delete [] url;
    7. return NULL;
    8. }
    9.  
    10. // Get a connection.
    11. CONNMGR_CONNECTIONINFO cinfo;
    12. memset(&cinfo,0,sizeof(cinfo));
    13. cinfo.cbSize = sizeof(cinfo);
    14. cinfo.bDisabled = FALSE;
    15. cinfo.bExclusive = FALSE;
    16. cinfo.guidDestNet = guid;
    17. cinfo.dwParams = CONNMGR_PARAM_GUIDDESTNET;
    18. cinfo.dwFlags = CONNMGR_FLAG_PROXY_HTTP;
    19. cinfo.dwPriority = CONNMGR_PRIORITY_USERINTERACTIVE;
    20. DWORD status;
    21. hresult = ConnMgrEstablishConnectionSync(&cinfo,&iConnectionHandle,15000,&status);
    22.  
    23. timer->start(5000);
    24.  
    25. if (!SUCCEEDED(iConnectionHandle))
    26. {
    27. QMessageBox::information(0, tr("N"), tr("Connection opened"));
    28. emit connectionFound();
    29. bIsConnectionEnabled = true;
    30. return true;
    31. }
    32. QMessageBox::information(0, tr("N"), tr("Connection closed"));
    33. emit connectionLost();
    34. return false;
    To copy to clipboard, switch view to plain text mode 
    Last edited by sergey_m; 7th January 2011 at 08:35.

Similar Threads

  1. Detection usb device connection/disconnection
    By binaural in forum Qt Programming
    Replies: 9
    Last Post: 18th September 2012, 10:59
  2. setup QTcreator and carbide C++ for S60 5th on windows 7
    By nhs_0702 in forum Qt for Embedded and Mobile
    Replies: 3
    Last Post: 29th May 2011, 18:55
  3. How to detect an internet connection ?
    By ouekah in forum Newbie
    Replies: 1
    Last Post: 29th March 2010, 22:08
  4. Windows SDK setup fails (required for phonon)
    By pospiech in forum Installation and Deployment
    Replies: 14
    Last Post: 28th January 2010, 13:37
  5. Getting windows internet proxy settings
    By jdd81 in forum Qt Programming
    Replies: 2
    Last Post: 10th June 2009, 22:27

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Qt is a trademark of The Qt Company.