Mensaje enviado por Daniel Natali <dnatali@vision.com.ar>
Una vez baje esto de planet-source-code, fijate si te sirve.
Saludos
'**************************************
' Name: CGI and Visual Basic
' Description:Can't remember where I pic
' ked this up, but it works. (Mike Ubis,mi
' ke@may.com)
' By: Newsgroup Posting
'
'
' Inputs:None
'
' Returns:None
'
'Assumes:None
'
'Side Effects:None
'
'Warranty:
'Code provided by Planet Source Code(tm)
' (http://www.Planet-Source-Code.com) 'as
' is', without warranties as to performanc
' e, fitness, merchantability,and any othe
' r warranty (whether expressed or implied
' ).
'Terms of Agreement:
'By using this source code, you agree to
' the following terms...
' 1) You may use this source code in per
' sonal projects and may compile it into a
' n .exe/.dll/.ocx and distribute it in bi
' nary format freely and with no charge.
' 2) You MAY NOT redistribute this sourc
' e code (for example to a web site) witho
' ut written permission from the original
' author.Failure to do so is a violation o
' f copyright laws.
' 3) You may link to this code from anot
' her website, provided it is not wrapped
' in a frame.
' 4) The author of this code may have re
' tained certain additional copyright righ
' ts.If so, this is indicated in the autho
' r's description.
'**************************************
type OVERLAPPED
Internal As Long
InternalHigh As Long
offset As Long
OffsetHigh As Long
hEvent As Long
End Type
Declare Function GetLastError Lib "kernel32" () As Long
Private Declare Function GetStdHandle Lib "kernel32" (ByVal nStdHandle As
Long) As Long
Private Declare Function WriteFile Lib "kernel32" (ByVal hFile As Long,
lpBuffer As Any, ByVal nNumberOfBytesToWrite As Long,
lpNumberOfBytesWritten As Long, lpOverlapped As Any) As Long
Private Declare Function ReadFile Lib "kernel32" (ByVal hFile As Long,
lpBuffer As Any, ByVal nNumberOfBytesToRead As Long, lpNumberOfBytesRead
As Long, lpOverlapped As Any) As Long
Private Const STD_INPUT_HANDLE As Long = -10&
Private Const STD_OUTPUT_HANDLE As Long = -11&
Private Const STD_ERROR_HANDLE As Long = -12&
Private Const INVALID_HANDLE_VALUE As Long = -1
Private StdIn As Long
Private StdOut As Long
Private StdErr As Long
Public Function StdIOInit()
Dim ErrCode As Long
StdIn = GetStdHandle(STD_INPUT_HANDLE)
ErrCode = GetLastError
If StdIn = INVALID_HANDLE_VALUE Then
StdIOInit = False
Exit Function
End If
StdOut = GetStdHandle(STD_OUTPUT_HANDLE)
ErrCode = GetLastError
If StdOut = INVALID_HANDLE_VALUE Then
StdIOInit = False
Exit Function
End If
StdErr = GetStdHandle(STD_ERROR_HANDLE)
ErrCode = GetLastError
If StdErr = INVALID_HANDLE_VALUE Then
StdIOInit = False
Exit Function
End If
StdIOInit = True
End Function
Public Sub StdIOWrite(Str As String)
Dim Written As Long
Dim ErrCode As Long
WriteFile StdOut, ByVal Str, Len(Str), Written, ByVal 0&
ErrCode = GetLastError
End Sub
Daniel Natali
dnatali@vision.com.ar
-------sistemas--------