Wrox Home  
Search P2P Archive for: Go

  Return to Index  

pro_vb thread: Using MSComm Control in a Module


Message #1 by Ely Pinchover <elyamltd@n...> on Mon, 25 Feb 2002 22:32:33 +0200
Ely,


I think you can use WithEvents to get Comm's object events,too.


EP> Good News:  ( Which I found in the last minutes ....)
EP> This Code works without using any Form

EP> Ely Pinchover.



EP> Public Sub main()

EP> Dim Instring As String

EP> Dim MSComm1 As MSCommLib.MSComm
EP> Set MSComm1 = New MSCommLib.MSComm


EP>    MSComm1.CommPort = 3

EP>    ' Tell the control to read entire buffer when Input
EP>    ' is used.
EP>    MSComm1.InputLen = 0
EP>    ' Open the port.
EP>    MSComm1.PortOpen = True

EP>      ' Send the attention command to the modem.
EP>    MSComm1.Output = "ATV1Q0" & Chr$(13) ' Ensure that
EP>    ' the modem responds with "OK".

EP>    ' Close the serial port.
EP>    MSComm1.PortOpen = False

EP> End Sub







EP> -----Original Message-----
EP> From: Kim, Cardyin [mailto:CKim@s...]
EP> Sent: Monday, February 25, 2002 11:16 PM
EP> To: professional vb
EP> Subject: [pro_vb] RE: Using MSComm Control in a Module


EP> Bad news: you can't.  You will need to have a form if you want
EP> to use the MS Comm Control.

EP> Good news:  you can work around this by using an
EP> invisible form.  Simply "Load" a form in your
EP> Sub Main(), but don't "show" it.

EP> Hope this helps

EP> Cardyin

EP> -----------------------------------------
EP> Cardyin Kim
EP> Client/Server and Web Development Analyst
EP> San Antonio Community Hospital
EP> Upland, California
EP> ckim@s...        (xxx) xxx-xxxx
EP> -----------------------------------------


EP> -----Original Message-----
EP> From: Ely Pinchover [mailto:elyamltd@n...]
EP> Sent: Monday, February 25, 2002 12:33 PM
EP> To: professional vb
EP> Subject: [pro_vb] Using MSComm Control in a Module


EP> Hi all,
EP> I need to write a VB stand -alone application ( without Forms) that uses the
EP> MSComm control.
EP> How do I declare and set the MSComm control without having  it in a form ?
EP> Thanks,
EP> Ely Pinchover


EP> ---
EP> 
EP> to unsubscribe send a blank email to $subst('Email.Unsub')...

EP> ---
EP> 
EP> 


EP> ---
EP> 
EP> 



-- 

 Janeks                            mailto:janexx@k...


  Return to Index