Announcement

Collapse
No announcement yet.

Creating a DUN File

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Creating a DUN File

    Does anyone have a sample piece of code to create a DUN file, ie to automate an ISP's setup procedure?

    My idea is to just create a DUN file so a user doesn't have to call tech support...


    Scott

    ------------------
    Scott
    mailto:[email protected][email protected]</A>
    Scott Turchin
    MCSE, MCP+I
    http://www.tngbbs.com
    ----------------------
    True Karate-do is this: that in daily life, one's mind and body be trained and developed in a spirit of humility; and that in critical times, one be devoted utterly to the cause of justice. -Gichin Funakoshi

  • #2
    Scott,

    I'm after the same thing.

    Come on folks! Where are your samples?

    ------------------
    mailto:[email protected][email protected]</A>
    www.basicguru.com/zijlema/

    Egbert Zijlema, journalist and programmer (zijlema at basicguru dot eu)
    http://zijlema.basicguru.eu
    *** Opinions expressed here are not necessarily untrue ***

    Comment


    • #3
      I know this much after searching for RSapi32.dll, it's an MFC thing, activex or whatever...
      It won't be easy in PB but I'm sure someone has a sample out there....


      Scott

      ------------------
      Scott
      mailto:[email protected][email protected]</A>
      Scott Turchin
      MCSE, MCP+I
      http://www.tngbbs.com
      ----------------------
      True Karate-do is this: that in daily life, one's mind and body be trained and developed in a spirit of humility; and that in critical times, one be devoted utterly to the cause of justice. -Gichin Funakoshi

      Comment


      • #4
        originally posted by scott turchin:
        does anyone have a sample piece of code to create a dun file

        if you mean create a ras entry, see http://www.powerbasic.com/support/pb...ad.php?t=22883
        i haven't tried it out, but it was posted by dave navarro.


        [this message has been edited by peter amick (edited january 12, 2001).]
        Peter Amick
        Baybuild Solutions

        Comment


        • #5
          Interesting, thanks,
          It's missing the TYPE for RASENTRY though, Dave do you still have that code? (that was a silly question)..
          Could you post the RASENTRY type?

          Thanks!

          Scott


          ------------------
          Scott
          mailto:[email protected][email protected]</A>
          Scott Turchin
          MCSE, MCP+I
          http://www.tngbbs.com
          ----------------------
          True Karate-do is this: that in daily life, one's mind and body be trained and developed in a spirit of humility; and that in critical times, one be devoted utterly to the cause of justice. -Gichin Funakoshi

          Comment


          • #6

            Scott

            Check the PBDLL directory:
            \PBDLL60\WINAPI\RAS32.INC
            You will find RASENTRY defined in there.

            Regards Errol

            ------------------

            Comment


            • #7
              I've included that file, but the compiler is still missing RASENTRY.
              I've altered it into RASENTRYNAME (though this is maybe not the same thing, I don't know).
              After that change the compiler does not know how to handle "RasenumDevices".
              In other words: Dave will you please post a complete sample?

              Does Dave's code fit for W95, BTW? And if this is not the case, does someone have an example
              for that platform?

              [This message has been edited by Egbert Zijlema (edited January 13, 2001).]

              Egbert Zijlema, journalist and programmer (zijlema at basicguru dot eu)
              http://zijlema.basicguru.eu
              *** Opinions expressed here are not necessarily untrue ***

              Comment


              • #8
                I took a stab at that, can't find the RAS32.inc tho, I'll check the website.

                Not sure this will work, common sense programming I suppose?
                You may have to adjust the string value lengths.
                Code:
                Type RASENTRY
                  dwCountryId        As Long
                  dwCountryCode      As Long
                  szAreaCode         As String * 3
                  szLocalPhoneNumber As String * 8
                  dwAlternateOffset  As Long
                  ipAddr             As Long
                  ipAddrDns          As Long
                  ipAddrDnsAlt       As Long
                  ipAddrWins         As Long
                  ipAddrWinsAlt      As Long
                  dwFrameSize        As Long
                  dwfNetProtocols    As Long
                  dwFramingProtocol  As Long
                  szScript           As String * 120
                  szAutodialDll      As String * 120
                  szAutodialFunc     As String * 120
                  szDeviceType       As String * 120
                  szDeviceName       As String * 120
                  szX25PadType       As String * 120
                  szX25Address       As String * 120
                  szX25Facilities    As String * 120
                  szX25UserData      As String * 120
                  dwChannels         As Long
                  dwReserved1        As Long
                  dwReserved2        As Long
                End Type
                ------------------
                Scott
                mailto:[email protected][email protected]</A>
                Scott Turchin
                MCSE, MCP+I
                http://www.tngbbs.com
                ----------------------
                True Karate-do is this: that in daily life, one's mind and body be trained and developed in a spirit of humility; and that in critical times, one be devoted utterly to the cause of justice. -Gichin Funakoshi

                Comment


                • #9
                  This was a great help, but appears identical to the RAS32.inc that I found in DDOC...
                  (Nice work Don!)..
                  http://vb.oreilly.com/news/dialup_0600.html


                  But it does not show how to CREATE a DUN entry...

                  I'll keep looking!

                  ------------------
                  Scott
                  mailto:[email protected][email protected]</A>
                  Scott Turchin
                  MCSE, MCP+I
                  http://www.tngbbs.com
                  ----------------------
                  True Karate-do is this: that in daily life, one's mind and body be trained and developed in a spirit of humility; and that in critical times, one be devoted utterly to the cause of justice. -Gichin Funakoshi

                  Comment


                  • #10
                    I've posted the UDT into Dave Navarro's posting in the Source Code Forum... see the link above for details.

                    ------------------
                    Lance
                    PowerBASIC Support
                    mailto:[email protected][email protected]</A>
                    Lance
                    mailto:[email protected]

                    Comment


                    • #11
                      Lance am I missing something here?
                      I'm getting errors on the following equates:

                      szAreaCode As Asciiz * %RAS_MAXAREACODE + 1


                      Those type, and this as well:

                      RasEnumDevices ByVal %NULL, cb, count

                      I don't think I have an up to date RAS32.INC file and I did not see it in the win32api.zip file I just downloaded


                      Thanks,

                      Scott

                      ------------------
                      Scott
                      mailto:[email protected][email protected]</A>
                      Scott Turchin
                      MCSE, MCP+I
                      http://www.tngbbs.com
                      ----------------------
                      True Karate-do is this: that in daily life, one's mind and body be trained and developed in a spirit of humility; and that in critical times, one be devoted utterly to the cause of justice. -Gichin Funakoshi

                      Comment


                      • #12
                        Same experience: Problems with RasEnumDevices.

                        Additional question: is it true that W98 behaves different from W95 in connection with DUN?
                        My app needs to install a dial-up entry (to our company), not knowing whether the computer is
                        W95 or W98 based.


                        ------------------
                        mailto:[email protected][email protected]</A>
                        www.basicguru.com/zijlema/

                        Egbert Zijlema, journalist and programmer (zijlema at basicguru dot eu)
                        http://zijlema.basicguru.eu
                        *** Opinions expressed here are not necessarily untrue ***

                        Comment


                        • #13
                          The file I have is an updated edition of Don Dickinson's RAS32.INC file. I've posted the complete file to the same Source Code forum message as above... (it's marked as public domain, courtesy of Don Dickinson and updated by Dave Navarro).

                          It seems that Dave had quite a few battles with the headers, so anyone playing with RAS should search the BBS for "ras32" and peruse some of the previous threads on the topic.




                          ------------------
                          Lance
                          PowerBASIC Support
                          mailto:[email protected][email protected]</A>
                          Lance
                          mailto:[email protected]

                          Comment


                          • #14
                            Still not working.
                            Now Dave's procedure is struggling with RASDEVINFO. RASDEVINFO (perhaps %RASDEVINFO?) does not exist in Don's include file.

                            ------------------
                            mailto:[email protected][email protected]</A>
                            www.basicguru.com/zijlema/

                            Egbert Zijlema, journalist and programmer (zijlema at basicguru dot eu)
                            http://zijlema.basicguru.eu
                            *** Opinions expressed here are not necessarily untrue ***

                            Comment


                            • #15
                              Originally posted by Egbert Zijlema:
                              Still not working.
                              Now Dave's procedure is struggling with RASDEVINFO. RASDEVINFO (perhaps %RASDEVINFO?) does not exist in Don's include file.
                              It doesn't, but I've posted a slightly modified version of the include file in the Source Code forum. It will work with the CreateRasEntry function (at least it does on my system, on NT4).

                              Peter Amick
                              Baybuild Solutions

                              Comment


                              • #16
                                Thanks guys!
                                We're getting somewhere now!

                                My function returns an 87, and is obviously failing...

                                I'm basically just using Dave's, no modifications yet, calling as such:

                                Code:
                                Function PbMain() As Long
                                Local lResult As Long
                                lResult = CreateRasEntry(ByVal "Sinclair",ByVal "360",ByVal "698-1234")
                                MsgBox Str$(lResult)
                                End Function
                                ------------------
                                Scott
                                mailto:[email protected][email protected]</A>
                                Scott Turchin
                                MCSE, MCP+I
                                http://www.tngbbs.com
                                ----------------------
                                True Karate-do is this: that in daily life, one's mind and body be trained and developed in a spirit of humility; and that in critical times, one be devoted utterly to the cause of justice. -Gichin Funakoshi

                                Comment


                                • #17
                                  Coming somewhere indeed, but where? That means, the compiler does no longer object, but that's all.
                                  On my PC (laptop, W95) the function returns zero (does that mean: success?),
                                  but I don't see a new RAS-entry in the DUN-folder.

                                  ------------------
                                  mailto:[email protected][email protected]</A>
                                  www.basicguru.com/zijlema/

                                  Egbert Zijlema, journalist and programmer (zijlema at basicguru dot eu)
                                  http://zijlema.basicguru.eu
                                  *** Opinions expressed here are not necessarily untrue ***

                                  Comment


                                  • #18
                                    That means you are not getting a count back:

                                    Code:
                                    I played a bit with both of these:
                                    
                                      RasEnumDevices ByVal %NULL, cb, count
                                    '  RasEnumConnections  ByVal %NULL, cb, count
                                      If IsFalse count Then
                                        Exit Function
                                      End If   
                                    
                                    This returns an 87 but still fails  [img]http://www.powerbasic.com/support/forums/smile.gif[/img]
                                    ------------------
                                    Scott
                                    mailto:[email protected][email protected]</A>
                                    Scott Turchin
                                    MCSE, MCP+I
                                    http://www.tngbbs.com
                                    ----------------------
                                    True Karate-do is this: that in daily life, one's mind and body be trained and developed in a spirit of humility; and that in critical times, one be devoted utterly to the cause of justice. -Gichin Funakoshi

                                    Comment


                                    • #19
                                      I woke up early this morning with a fresh brain (and a fresh cup of java!)and decided to tackle this.
                                      First off was understanding the RASDEVINFO type and the other types.

                                      Point of failure shown:
                                      Code:
                                      Function CreateRasEntry(ByVal entry As String, _
                                                              ByVal areacode As String, _
                                                              ByVal phone As String) As Long
                                      
                                        Local cb    As Long
                                        Local count As Long
                                        Local x     As Long
                                        Local modem As String
                                        Local r     As RASENTRY
                                        Local lResult As Long
                                      
                                        lResult = RasEnumDevices(ByVal %NULL, cb, count)
                                      '  RasEnumConnections  ByVal %NULL, cb, count
                                        If IsFalse count Then
                                          Exit Function
                                        End If
                                      
                                        cb = Len(RASDEVINFO) * count
                                      
                                        Dim rdi(1 To count) As RASDEVINFO
                                        rdi(1).dwSize = Len(RASDEVINFO)
                                      
                                      
                                        RasEnumDevices rdi(1), cb, count
                                        MsgBox "Device Type and name are: " & $CRLF & rdi(1).szDeviceType & $CRLF & rdi(1).szDeviceName
                                      
                                      ' FAILURE POINT RIGHT HERE
                                      ------------------
                                      Scott
                                      mailto:[email protected][email protected]</A>
                                      Scott Turchin
                                      MCSE, MCP+I
                                      http://www.tngbbs.com
                                      ----------------------
                                      True Karate-do is this: that in daily life, one's mind and body be trained and developed in a spirit of humility; and that in critical times, one be devoted utterly to the cause of justice. -Gichin Funakoshi

                                      Comment


                                      • #20
                                        Scott,

                                        Actually there are 3 RasEnum functions: devices, entries and connections.
                                        Devices is the one we need here, I think, because we should retrieve the proper
                                        ID for the modem, in order to pass it onto our new connection. I've tried to display
                                        the device name, but my MSGBOX does'nt display any. In other words: the function
                                        does'nt find one of my 2 modems, to begin with.

                                        BTW: I also get 87 as a result of the function, now.
                                        BTW (2): Scott, this is a reply for your 6:16 msg. I posted mine exactly at the same time as your latest one.


                                        ------------------
                                        mailto:[email protected][email protected]</A>
                                        www.basicguru.com/zijlema/

                                        [This message has been edited by Egbert Zijlema (edited January 15, 2001).]

                                        Egbert Zijlema, journalist and programmer (zijlema at basicguru dot eu)
                                        http://zijlema.basicguru.eu
                                        *** Opinions expressed here are not necessarily untrue ***

                                        Comment

                                        Working...
                                        X