Announcement

Collapse
No announcement yet.

PowerBasic is Great!!!!!!!

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

  • #21
    Peter,
    I need to open a PCI (Win-Modem) and dial a phone number then
    after connecting transmit some data in a slave/master routine.
    Also, I need to set the modems speed to 2400 baud, with data
    compression and error correction turned off. Can you give me any
    suggestion or sample code that may help me accomplish this task?
    ...Marty

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

    Comment


    • #22
      Unfortunately no.

      For a winmodem, you need to use the higher-level API's such as MAPI, TAPI, or RAS.

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

      Comment


      • #23
        In at least four of those post, I received no responses or
        only one. I eventually spent days writing code and testing
        it and answered my own question. (But very time consuming.)
        That's the fun of programming if you ask me...

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

        Comment


        • #24
          Code for PBWin

          Peter, you are phenomenal. I've updated your nifty code to work on PBWin:

          '
          Code:
                 
          'PBWin 8.04  XP Pro(SP3)
          'http://www.powerbasic.com/support/pbforums/showthread.php?t=6468&highlight=modem+detection
          'by Peter Lameijn      'Changes by GHL
          '==================================================================================================
          ' Modem detection example. PST_xxx equates are in Winbase.h
          '==================================================================================================
          '==================================================================================================
          #Include "win32api.inc"
          Function PBMain () As Long
          Local lCnt&, lRet&, lComm&, lCommProp As CommProp, lCommName As Asciiz * 128,lVal As Long
          Local Ports_Found$
          '  Color 15,0
            For lCnt = 1 To 8
             lCommName = "COM" + Trim$(Str$(lCnt))
             lComm& = CreateFile (lCommName, _
                                  %GENERIC_READ Or %GENERIC_WRITE, _
                                  0, _
                                  ByVal %Null, _
                                  %OPEN_EXISTING, _
                                  0, _
                                  ByVal %Null)
              Reset lval '<<< necessary
              If (lComm& <> %INVALID_HANDLE_VALUE) Then
                lRet = GetCommModemStatus (lComm&,lVal)
                If lVal Then 
                    Ports_Found$ =  Ports_Found$ & lCommName & $CrLf 
                   CloseHandle lComm
                End If   
               Else
          '      Print lCommName + " - No such port"
                ? "%INVALID_HANDLE_VALUE",,"Bummer"
                Exit Function
              End If
            Next
            If Ports_Found$ > "" Then
               ? Ports_Found$,, "Modems Found" 
              Else
               ? "",, "No Modems Found"
            End If
          End Function
          '
          =============================================
          "Sex is not the answer. Sex is the question."
          "Yes" is the answer.
          Swami X
          =============================================
          Last edited by Gösta H. Lovgren-2; 11 Aug 2008, 10:03 PM.
          It's a pretty day. I hope you enjoy it.

          Gösta

          JWAM: (Quit Smoking): http://www.SwedesDock.com/smoking
          LDN - A Miracle Drug: http://www.SwedesDock.com/LDN/

          Comment

          Working...
          X