<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0">
  <channel>
    <title>'How can I dial GPRS/EDGE in Win CE' Thread RSS Feed</title>
    <link>http://www.programmersheaven.com/</link>
    <description>Contains the latest posts from the thread 'How can I dial GPRS/EDGE in Win CE' posted on the 'Python' forum at Programmer's Heaven.</description>
    <language>en</language>
    <copyright>Copyright 2012 Programmers Heaven</copyright>
    <pubDate>Thu, 24 May 2012 00:11:43 -0700</pubDate>
    <lastBuildDate>Thu, 24 May 2012 00:11:43 -0700</lastBuildDate>
    <generator>Argotic Syndication Framework 2007.3.0.1, http://www.codeplex.com/Argotic</generator>
    <docs>http://www.rssboard.org/rss-specification</docs>
    <ttl>360</ttl>
    <image>
      <url>http://www.programmersheaven.com/images/ph.gif</url>
      <title>Programmers Heaven</title>
      <link>http://www.programmersheaven.com/</link>
      <width>88</width>
      <height>31</height>
    </image>
    <item>
      <title>How can I dial GPRS/EDGE in Win CE</title>
      <link>http://www.programmersheaven.com/mb/python/417145/417145/how-can-i-dial-gprsedge-in-win-ce/</link>
      <description>Hello all.&lt;br /&gt;
&lt;br /&gt;
I am developing application in python on Windows CE which needs connection to the internet (via GPRS/EDGE). When I turn on the device, the internet connection is not active. It becomes active if I open internet explorer. &lt;br /&gt;
&lt;br /&gt;
I would like to activate connection in my application. I'm trying to do this with RasDial function over ctypes library, but I can't get it to work. Is this the right way or I should do something else? &lt;br /&gt;
&lt;br /&gt;
Below is my current code. The ResDial function keeps returning error 87 – Invalid parameter. I don't know anymore what is wrong with it.&lt;br /&gt;
&lt;br /&gt;
I would really appreciate any kind of help. Thanks in advance.&lt;br /&gt;
&lt;br /&gt;
#encoding: utf-8&lt;br /&gt;
&lt;br /&gt;
import ppygui as gui&lt;br /&gt;
from ctypes import *&lt;br /&gt;
import os&lt;br /&gt;
&lt;br /&gt;
class MainFrame(gui.CeFrame):&lt;br /&gt;
    def __init__(self, parent = None):&lt;br /&gt;
        gui.CeFrame.__init__(self, title=u"Zgodovina dokumentov", menu="Menu")&lt;br /&gt;
        &lt;br /&gt;
        DWORD = c_ulong&lt;br /&gt;
        TCHAR = c_wchar&lt;br /&gt;
        ULONG_PTR = c_ulong &lt;br /&gt;
        &lt;br /&gt;
        class RASDIALPARAMS(Structure):&lt;br /&gt;
             _fields_ = [("dwSize", DWORD),&lt;br /&gt;
                         ("szEntryName", TCHAR*21),&lt;br /&gt;
                         ("szPhoneNumber", TCHAR*129),&lt;br /&gt;
                         ("szCallbackNumber", TCHAR*49),&lt;br /&gt;
                         ("szUserName", TCHAR*257),&lt;br /&gt;
                         ("szPassword", TCHAR*257),&lt;br /&gt;
                         ("szDomain", TCHAR*16),&lt;br /&gt;
                         ]&lt;br /&gt;
             &lt;br /&gt;
        try:&lt;br /&gt;
            param = RASDIALPARAMS()&lt;br /&gt;
            param.dwSize = 1462 # also tried 1464 and sizeof(RASDIALPARAMS()). Makes no difference.&lt;br /&gt;
            param.szEntryName = u"My Connection"&lt;br /&gt;
            param.szPhoneNumber = u"0"&lt;br /&gt;
            param.szCallbackNumber = u"0"&lt;br /&gt;
            param.szUserName = u"0"&lt;br /&gt;
            param.szPassword = u"0"&lt;br /&gt;
            param.szDomain = u"0"&lt;br /&gt;
            &lt;br /&gt;
            iNasConn = c_ulong(0)&lt;br /&gt;
            ras = windll.coredll.RasDial(None, None, param, c_ulong(0xFFFFFFFF), c_voidp(self._w32_hWnd), byref(iNasConn))&lt;br /&gt;
            print ras, repr(iNasConn) #this prints 87 c_ulong(0L)&lt;br /&gt;
        except Exception, e:&lt;br /&gt;
            print "Error"&lt;br /&gt;
            print e&lt;br /&gt;
            &lt;br /&gt;
if __name__ == '__main__':&lt;br /&gt;
   app = gui.Application(MainFrame(None))&lt;br /&gt;
   # create an application bound to our main frame instance&lt;br /&gt;
   app.run()&lt;br /&gt;
   #launch the app !&lt;br /&gt;
&lt;br /&gt;</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/python/417145/417145/how-can-i-dial-gprsedge-in-win-ce/</guid>
      <pubDate>Thu, 10 Jun 2010 14:13:40 -0700</pubDate>
      <category>Python</category>
    </item>
  </channel>
</rss>
