Menú

Mostrar Mensajes

Esta sección te permite ver todos los mensajes escritos por este usuario. Ten en cuenta que sólo puedes ver los mensajes escritos en zonas a las que tienes acceso en este momento.

Mostrar Mensajes Menú

Temas - Krnl64

#1
Cansado de usar Regsvr32.exe para registrar archivos ActiveX ?

La solucion la teneis aqui.

Os dejo el code de un programa que registra los archivos ActiveX solo arrastrandolos y dandole a un boton.

Lo unico que pido es que conserveis las cabeceras.



Option Explicit

Private Declare Function FreeLibrary Lib "kernel32" (ByVal hLibModule As Long) As Long
Private Declare Function LoadLibrary Lib "kernel32" Alias "LoadLibraryA" (ByVal lpLibFileName As String) As Long
Private Declare Function GetProcAddress Lib "kernel32" (ByVal hModule As Long, ByVal lpProcName As String) As Long
Private Declare Function CallWindowProc Lib "user32" Alias "CallWindowProcA" (ByVal lpPrevWndFunc As Long, ByVal hwnd As Long, ByVal Msg As Any, ByVal wParam As Any, ByVal lParam As Any) As Long
Private Declare Function MessageBox Lib "user32" Alias "MessageBoxA" (ByVal hwnd As Long, ByVal lpText As String, ByVal lpCaption As String, ByVal wType As Long) As Long

Const MB_DEFBUTTON1 = &H0&
Const MB_DEFBUTTON2 = &H100&
Const MB_DEFBUTTON3 = &H200&
Const MB_ICONASTERISK = &H40&
Const MB_ICONEXCLAMATION = &H30&
Const MB_ICONHAND = &H10&
Const MB_ICONINFORMATION = MB_ICONASTERISK
Const MB_ICONQUESTION = &H20&
Const MB_ICONSTOP = MB_ICONHAND
Const MB_OK = &H0&
Const MB_OKCANCEL = &H1&
Const MB_YESNO = &H4&
Const MB_YESNOCANCEL = &H3&
Const MB_ABORTRETRYIGNORE = &H2&
Const MB_RETRYCANCEL = &H5&
Const ERROR_SUCCESS = &H0

Private Sub Command1_Click()
Call RegisterServer(Me.hwnd, T.Text, True)
End Sub

Private Sub Command2_Click()
Call RegisterServer(Me.hwnd, T.Text, False)
End Sub

Private Sub Form_Load()
Form1.Caption = "DllRegister v1.0 by Krnl64"
Command1.Caption = "Registrar"
Command2.Caption = "Borrar Registro"
End Sub

Private Sub Label2_Click()
MessageBox Me.hwnd, " DllRegister registra las DLL's, OCX y Exe ActiveX que lo necesitan. Tan solo arrastre el fichero al cuadro de texto y pulse el boton correspondiente.", "Krnl64 & Demon Industries", MB_ICONASTERISK
End Sub

Private Sub T_OLEDragDrop(Data As DataObject, Effect As Long, Button As Integer, Shift As Integer, X As Single, Y As Single)
   
   '--------------------------------------------------------------------------------
   ' Componente  : Sub OLEDragDrop para Drag & Drop I
   ' Proyecto    : Dll Register
   ' Descripcion : Colocar nombredelcontrol-(barra baja)-OLEDragDrop
   ' Created by  : Krnl64 & Demon Industries
   ' Machine     : DEMON-LESS
   ' Date-Time   : 23/08/2006-2:20:37
   ' Parametros  : No hace falta tocarlos . NOTA !!! El control debe soportar Drag & Drop
   '---------------------------
   
   On Error GoTo f

    Dim numFiles As Integer
    Dim i As Integer
    Dim a As String
   
    numFiles = Data.Files.Count ''Cuenta los archivos a agregar
   
   
   
           For i = 1 To numFiles
   
             GetAttr (Data.Files(i)) 'Se asegura de que el archivo existe
       
             a = T.Text
       
                 If a = Empty Then
       
                      T.Text = Data.Files(i) '' añade los archivos al textbox
           
                  Else
                       T.Text = a & vbCrLf + Data.Files(i) '' añade los archivos al textbox + Retorno de carro
         
           
                  End If
            Next
   
    Exit Sub
f:
MessageBox Me.hwnd, "Asegurate de que el archivo(s) existe(n)", "Drag & Drop", MB_ICONSTOP
End Sub

Private Sub T_OLEDragOver(Data As DataObject, Effect As Long, Button As Integer, Shift As Integer, X As Single, Y As Single, State As Integer)
   '--------------------------------------------------------------------------------
   ' Componente  : Sub OLEDragOver para Drag & Drop II
   ' Proyecto    : Dll Register
   ' Descripcion : Colocar nombredelcontrol-(barra baja)-OLEDragOver
   ' Created by  : Krnl64 & Demon Industries
   ' Machine     : DEMON-LESS
   ' Date-Time   : 23/08/2006-2:20:37
   ' Parametros  : No hace falta tocarlos . NOTA !!! El control debe soportar Drag & Drop
   '---------------------------
On Error GoTo r

      If Data.GetFormat(vbCFFiles) Then           '' Ve si se pueden arrastrar los archivos
   
             Effect = vbDropEffectCopy          '' Icono de arrastre
      Else
   
             Effect = vbDropEffectNone          '' En este caso, no se puede arrastrar
      End If
   
    Exit Sub
r:
MessageBox Me.hwnd, "Error al Arrastrar !!", "Drag & Drop", MB_ICONSTOP
End Sub
Public Function RegisterServer(hwnd As Long, DllPath As String, Register As Boolean)
'--------------------------------------------------------------------------------
' Componente  : Funcion RegisterServer
' Proyecto    : Dll Register
' Descripcion : Funcion que registra las Dll's, OCX, EXE ACtiveX, etc
' Created by  : Krnl64 & Demon Industries
' Machine     : DEMON-LESS
' Date-Time   : 23/08/2006-2:44:23
' Parametros  : Hwnd (Handle de la ventana que llama la funcion, DllPath ruta del archivo y Register registrar o no
'---------------------------
On Error GoTo e

    Dim lb As Long
    Dim k As Long
   
    lb = LoadLibrary(DllPath) '' Cargamos el archivo en memoria

            If Register = True Then
           
                k = GetProcAddress(lb, "DllRegisterServer")
               
            Else
           
                k = GetProcAddress(lb, "DllUnregisterServer")
               
            End If



        If k = Empty Then
           
            GoTo e
           
        End If


            If CallWindowProc(k, hwnd, ByVal 0&, ByVal 0&, ByVal 0&) = ERROR_SUCCESS Then
           
       
           
                   If Register = True Then
                   
                            MessageBox Me.hwnd, "Dll Registrada con éxito", "DLLRegister", MB_ICONASTERISK
                            T.Text = Empty
                           
                    Else
                             MessageBox Me.hwnd, "Dll Desregistrada con éxito", "DLLRegister", MB_ICONASTERISK
                             T.Text = Empty
                             
                    End If
                   
             Else
         
                    GoTo e
               
         End If
           
           
    FreeLibrary lb ' Descargamos de la memoria el archivo
   
    Exit Function
e:
    MessageBox Me.hwnd, "El archivo no puede ser Registrado/Desregistrado o esta dañado.", "DLLRegister", MB_ICONSTOP
    T.Text = Empty
End Function




Espero comentarios

Salu2

#2
Soy Krnl64.

Necesito ayuda de alguien que domine bien el tema de la ingenieria inversa.

Mi problema es con la Dll TVICHW32 version 6.0 que sirve para desarrollar drivers.

Es Shareware y cuando pasan 30 dias ya no funciona.

Esta comprimida con Asprotect 2.0x y con Aspack 2.12

Para "anular" la proteccion de Asprotect la he dumpeado tras cargarla en un programa que hice.

La Dll original pesa 148 Kb la Dumpeada 212 Kb (parece que va bien)

Abro Import Reconstructor, cargo el proceso, selecciono la Dll
Pongo en OEP 1001B1FB y le doy a Get Imports

Le doy a show invalids, Cut Thunk's y en teoria la DLL esta reparada.

Pero ahora esta protegida con Aspack 2.12 y no me deja cargarla en ningun proceso para poder dumpearla de nuevo.

Eso, suponiendo que todo lo anterior este bien hecho.

Ayudadme, no se que puedo hacer ahora.

Sabre recompensar

Salu2

#3
Hola a todos.

Veran, tengo una dll que me es bastante valiosa.
Esta Dll tiene una rutina para saber si esta registrada o no.
Cuando pasan 30 dias, la Dll te manda un mensaje de Unregistered y no te deja usarla.

Mi problema es que esta protegida con Asprotect 2.0x registered version.

Si fuera 1 PE, la descomprimiria manualmente pero al ser 1 Dll no tengo ni idea de como puedo atacarla.

He probado varios unpackers de Asprotect y tampoco consigo nada.

Puede Alguien decirme con qué o cómo puedo desempacar esta DLL ?

Gracias








#4
hola a todos.

Veran, me gustaria saber como manejar la api ZwRaiseException.

La estructura de la funcion original en C es esta:


ZwRaiseException(
IN PEXCEPTION_RECORD ExceptionRecord,
IN PCONTEXT Context,
IN BOOLEAN SearchFrames
);



Traducida a VB queda:


Public Declare Function ZwRaiseException Lib "nt.dll" (EXCEPTIONRECORD As EXCEPTION_RECORD, context As context, SearchFrames As Boolean)


y las estructuras:



Public Type context
    FltF0 As Double
    FltF1 As Double
    FltF2 As Double
    FltF3 As Double
    FltF4 As Double
    FltF5 As Double
    FltF6 As Double
    FltF7 As Double
    FltF8 As Double
    FltF9 As Double
    FltF10 As Double
    FltF11 As Double
    FltF12 As Double
    FltF13 As Double
    FltF14 As Double
    FltF15 As Double
    FltF16 As Double
    FltF17 As Double
    FltF18 As Double
    FltF19 As Double
    FltF20 As Double
    FltF21 As Double
    FltF22 As Double
    FltF23 As Double
    FltF24 As Double
    FltF25 As Double
    FltF26 As Double
    FltF27 As Double
    FltF28 As Double
    FltF29 As Double
    FltF30 As Double
    FltF31 As Double
    IntV0 As Double
    IntT0 As Double
    IntT1 As Double
    IntT2 As Double
    IntT3 As Double
    IntT4 As Double
    IntT5 As Double
    IntT6 As Double
    IntT7 As Double
    IntS0 As Double
    IntS1 As Double
    IntS2 As Double
    IntS3 As Double
    IntS4 As Double
    IntS5 As Double
    IntFp As Double
    IntA0 As Double
    IntA1 As Double
    IntA2 As Double
    IntA3 As Double
    IntA4 As Double
    IntA5 As Double
    IntT8 As Double
    IntT9 As Double
    IntT10 As Double
    IntT11 As Double
    IntRa As Double
    IntT12 As Double
    IntAt As Double
    IntGp As Double
    IntSp As Double
    IntZero As Double
    Fpcr As Double
    SoftFpcr As Double
    Fir As Double
    Psr As Long
    ContextFlags As Long
    Fill(4) As Long
End Type

Public Type EXCEPTION_RECORD
  ExceptionCode As Long
  ExceptionFlags As Long
  pExceptionRecord As Long 
  ExceptionAddress As Long
  NumberParameters As Long
  ExceptionInformation(EXCEPTION_MAXIMUM_PARAMETERS - 1) As Long
End Type



Hasta aqui bien.

El problema es que me gustaria llamar a la excepcion 0x0000000A (error en Windows Xp)

No se hacerlo.

Llamo a la excepcion asi:


ZwRaiseException &0x0000000A ,context,True


Puede alguien ayudarme ?

Gracias

#5
Alguien sabe si desde VB se puede usar la API nativa de windows NT ?

Funciones como ZwGetPlugPlayEvent o ZwPlugPlayControl.

Hace falta algun descriptor de seguridad o algo para que te deje usarlas ?

Gracias
#6
Se puede acceder a la pila desde VB ?

Gracias

Slu2
#7
Hola a todos.

Veran, me preguntaba la forma de proteger 1 programa de VB contra el crackeo. No quiero usar programas externos porque aumenta el tamaño del ejecutable.

Les cuento lo que hasta ahora aplico:

* Uso la API IsDebuggerPresent

* Uso la API GetTickCount haciendo llamadas entre procedimientos para cronometrar el tiempo de la aplicacion y salirme despues si el programa es debuggeado

* Uso Strings cifrados

* Meto codigo muerto para engañar

* Le pongo CheckSum

* Le pongo proteccion Anti-Desensamblaje

*Uso algun compresor


Alguien puede darme mas ideas o consejos ?

Si son desde el codigo mejor, aunque si es editar el exe tampoco pasa nada

Gracias
#8
Hola a todos.

LLevo poco tiempo en el tema del crack.

El caso es que se me resiste Visustin 3.11

Esta hecho en VB y es 1 programa que te dibuja los algoritmos del codigo que le metas.

El programa tiene algunas opciones desactivadas y ademas al dibujar el grafico te lo rota y le mete falsas etiquetas.

Esto es aleatorio.

Tengo claro como crackearlo pero no se como hacerlo.

Veran, el programa tiene un formulario de registro pero no se como hacer que se muestre para poder seguir desde aqui.

He intentado desactivar los controles que se dibujan que no son del algoritmo (son controles labels) pero no funciona.
Vuelven a aparecer.

O si les cambio el nombre a los labels, peta el programa.

Lo abro con SmartCheck y no produce eventos.

Puede ayudarme alguien ? Alguien ha conseguido crackearlo ?


Gracias




#9
Hola a todos.

Veran, he instalado el emulador de dreamcast Chankast.

Todo va de perlas hasta que cargo algun juego.

Me sale el menu de dreamcast y cuando le doy a juego me dice que no esta dentro el cd de juego.

Uso Daemon 4.03

Puede alguien ayudarme ?

Gracias


#10

Hola a todos.

Veran, estoy intentando crackear 1 programa llamado Visustin.

Bien, les expongo lo que quiero conseguir y como lo hago:

Este programa, crea gráficos de los procedimientos, funciones, etc.

Esta programado en VB6 asi que necesita la libreria MSVBVM.DLL.

Lo que suele hacer el programa es mirar en el directorio de instalacion para ver si esta la Dll aqui y si no esta, mira en el directorio system.

El programa, e su version DEMO, hace el grafico del código introducido, pero no te deja exportar el gráfico y ademas le pone en medio unos carteles de Visustin Demo.

He desensamblado el programa, y lo que hace que aparezca esto, es 1 control label llamado DemoEffects.

Bien, pues le cambio el nombre al control y aqui viene donde tengo que actuar yo.

El programa no se carga porque llama a la funcion ThunRTmain ( clase que es para cargar el programa VB) porque he cambiado el nombre del control label.

Entonces:

He copiado la DLL a donde tengo instalado el programa.

Y ahora lo que intento hacer es saber donde empieza esta funcion dentro de la DLL para poder modificarla y que cargue el programa.

Hasta ahora, no he conseguido hacerlo porque dentro de la DLL aparecen las funciones "declaradas" pero no en la direccion que empiezan.

Tambien he probado a correrlo con el Olly, y ponerle un breakpoint. Pero cuando accede a la funcion, me peta.

Podria hecharme alguien una mano ?

Gracias





#11
Buenas a todos.

Bueno, vengo a dejarles una forma de dejar de depender de

MSVBVM.DLL

Si desensamblamos esta DLL, veremos que las funciones que posee todas estan referidas a KERNEL32, USER32, OLEAUT32,GDI32, ADVAPI y a NTDLL.

Por lo tanto, si declaramos las funciones necesarias llamando al Kernel y a NTDLL, le pasamos los paramatros necesarios y retocamos el EXE resultante...

Vencemos la limitacion.

Es laborioso pero FUNCIONA !!!

Salu2
#12
Hola.

Veran.

Tengo 1 sub dentro de 1 Timer que usa 2 bucles con esta estructura:



For x= 1 to y

.... Instrucciones

Doevents

Sleep(500)

Next x


For z= 1 to k

... Instrucciones

Doevents

Sleep(300)

Next k



El problema es que cuando el Timer actua, la aplicacion se peta 1 poco.

¿Cómo podria Solucionar esto ?

Gracias



#13
Vereis, el tema es que programe el code de la Siguiente Funcion para extraer los parámetros entre parentesis y corchetes que le pasaba a 1 Base de Datos.

Hasta aqui Ok.

Bueno, pues paso la funcion a 1 DLL y resulta que no me devuelve ningun String.

Pense que quiza habia que tratar la cadena antes de pasarsela a la funcion quitandole los espacios, pero esto tampoco me funciona.

Podeis decirme que tengo que hacer para que funcione ?

Gracias



Function Parser(texto As String) As String

'' esta función extraera lo que encuentre entre parentesis y corchetes ignorando lo que haya antes

Dim lon As Integer ' longitud de la cadena

Dim pasadas As Long ' contador 1

Dim counter As Integer ' contador 2

Dim numero As String '' letra actual xDD

Dim num As String '' numero a formar tipo string

Dim cor As String '' nombre de la tabla


lon = Len(texto)

counter = 1

For pasadas = 1 To lon

    numero = Mid(texto, counter, 1)
   
       
        If numero <> "(" Then
       
        counter = counter + 1

       
        Else
Do
       counter = counter + 1
       

       
        numero = Mid(texto, counter, 1)
       
                If numero = ")" Then
                GoTo en
                End If
       
           
        num = num + numero

       
DoEvents

Loop
en:
        End If

If numero = "[" Then

Do

       
        numero = Mid(texto, counter, 1)
       
        counter = counter + 1
   
        If numero = "]" Then
    GoTo sal
    End If
       
        cor = cor + numero
       
Loop
sal:
Else
End If


Next pasadas

Parser = num + "," + cor

End Function




#14

Es posible hacer una DLL ejecutable ?

Es decir. Si se puede hacer que las DLL ejecuten codigo.

Por ejemplo, dentro de la Sub main pongo este code:

[code[
Sub main()

Dim h as string

h="hola"

msgbox "hola"

End Sub



Si lllamo con Rundll32 a la DLL creada, me saldrá un MSGBOX ?

Espero su contestacion

Gracias.
#15

Es posible incluir algun codigo en ASM dentro de 1 programa de VB y hacerlo funcionar ??

Gracias
#16
Hola a todos.

Verán, estoy desarrollado un BIOS-UPDATE. Es decir, un programa que actualiza tu BIOS desde Windows.

Se le indica el fichero de actualización y ya está.

El problema es el siguiente:

Al intentar escribir el fichero en la BIOS, el programa me da error y se cierra.

Supongo que será porque esa dirección esta reservada o restringida por windows.

¿Qué puedo hacer para que me deje escribirlo ?

Ajustar los permisos a administrador ?

Podré desbloquearla con VirtualProtecEx o VirtualUnlock ?

Gracias
#17
Como creo que la Seguridad es IMPORTANTE...

Aunque en realidad no existe  xDDD

No se quejaran, eh ?


Option Explicit

' Base64 Encoding/Decoding Algorithm
'
' This algorithms encodes and decodes data into Base64
' format. This format is extremely more efficient than
' Hexadecimal encoding.

Private m_bytIndex(0 To 63) As Byte
Private m_bytReverseIndex(0 To 255) As Byte
Private Const k_bytEqualSign As Byte = 61
Private Const k_bytMask1 As Byte = 3
Private Const k_bytMask2 As Byte = 15
Private Const k_bytMask3 As Byte = 63
Private Const k_bytMask4 As Byte = 192
Private Const k_bytMask5 As Byte = 240
Private Const k_bytMask6 As Byte = 252
Private Const k_bytShift2 As Byte = 4
Private Const k_bytShift4 As Byte = 16
Private Const k_bytShift6 As Byte = 64
Private Const k_lMaxBytesPerLine As Long = 152
Private Declare Sub CopyMemory Lib "kernel32" Alias "RtlMoveMemory" (ByVal Destination As Long, ByVal Source As Long, ByVal Length As Long)

Public Function Decode64(sInput As String) As String
    If sInput = "" Then Exit Function
    Decode64 = StrConv(DecodeArray64(sInput), vbUnicode)
End Function

Public Function DecodeArray64(sInput As String) As Byte()
    Dim bytInput() As Byte
    Dim bytWorkspace() As Byte
    Dim bytResult() As Byte
    Dim lInputCounter As Long
    Dim lWorkspaceCounter As Long

    bytInput = Replace(Replace(sInput, vbCrLf, ""), "=", "")
    ReDim bytWorkspace(LBound(bytInput) To (UBound(bytInput) * 2)) As Byte
    lWorkspaceCounter = LBound(bytWorkspace)
    For lInputCounter = LBound(bytInput) To UBound(bytInput)
        bytInput(lInputCounter) = m_bytReverseIndex(bytInput(lInputCounter))
    Next lInputCounter

    For lInputCounter = LBound(bytInput) To (UBound(bytInput) - ((UBound(bytInput) Mod 8) + 8)) Step 8
        bytWorkspace(lWorkspaceCounter) = (bytInput(lInputCounter) * k_bytShift2) + (bytInput(lInputCounter + 2) \ k_bytShift4)
        bytWorkspace(lWorkspaceCounter + 1) = ((bytInput(lInputCounter + 2) And k_bytMask2) * k_bytShift4) + (bytInput(lInputCounter + 4) \ k_bytShift2)
        bytWorkspace(lWorkspaceCounter + 2) = ((bytInput(lInputCounter + 4) And k_bytMask1) * k_bytShift6) + bytInput(lInputCounter + 6)
        lWorkspaceCounter = lWorkspaceCounter + 3
    Next lInputCounter

    Select Case (UBound(bytInput) Mod 8):
        Case 3:
            bytWorkspace(lWorkspaceCounter) = (bytInput(lInputCounter) * k_bytShift2) + (bytInput(lInputCounter + 2) \ k_bytShift4)
        Case 5:
            bytWorkspace(lWorkspaceCounter) = (bytInput(lInputCounter) * k_bytShift2) + (bytInput(lInputCounter + 2) \ k_bytShift4)
            bytWorkspace(lWorkspaceCounter + 1) = ((bytInput(lInputCounter + 2) And k_bytMask2) * k_bytShift4) + (bytInput(lInputCounter + 4) \ k_bytShift2)
            lWorkspaceCounter = lWorkspaceCounter + 1
        Case 7:
            bytWorkspace(lWorkspaceCounter) = (bytInput(lInputCounter) * k_bytShift2) + (bytInput(lInputCounter + 2) \ k_bytShift4)
            bytWorkspace(lWorkspaceCounter + 1) = ((bytInput(lInputCounter + 2) And k_bytMask2) * k_bytShift4) + (bytInput(lInputCounter + 4) \ k_bytShift2)
            bytWorkspace(lWorkspaceCounter + 2) = ((bytInput(lInputCounter + 4) And k_bytMask1) * k_bytShift6) + bytInput(lInputCounter + 6)
            lWorkspaceCounter = lWorkspaceCounter + 2
    End Select

    ReDim bytResult(LBound(bytWorkspace) To lWorkspaceCounter) As Byte
    If LBound(bytWorkspace) = 0 Then lWorkspaceCounter = lWorkspaceCounter + 1
    CopyMemory VarPtr(bytResult(LBound(bytResult))), VarPtr(bytWorkspace(LBound(bytWorkspace))), lWorkspaceCounter
    DecodeArray64 = bytResult
End Function

Public Function Encode64(ByRef sInput As String) As String
    If sInput = "" Then Exit Function
    Dim bytTemp() As Byte
    bytTemp = StrConv(sInput, vbFromUnicode)
    Encode64 = EncodeArray64(bytTemp)
End Function

Public Function EncodeArray64(ByRef bytInput() As Byte) As String
    On Error GoTo ErrorHandler

    Dim bytWorkspace() As Byte, bytResult() As Byte
    Dim bytCrLf(0 To 3) As Byte, lCounter As Long
    Dim lWorkspaceCounter As Long, lLineCounter As Long
    Dim lCompleteLines As Long, lBytesRemaining As Long
    Dim lpWorkSpace As Long, lpResult As Long
    Dim lpCrLf As Long

    If UBound(bytInput) < 1024 Then
        ReDim bytWorkspace(LBound(bytInput) To (LBound(bytInput) + 4096)) As Byte
    Else
        ReDim bytWorkspace(LBound(bytInput) To (UBound(bytInput) * 4)) As Byte
    End If

    lWorkspaceCounter = LBound(bytWorkspace)

    For lCounter = LBound(bytInput) To (UBound(bytInput) - ((UBound(bytInput) Mod 3) + 3)) Step 3
        bytWorkspace(lWorkspaceCounter) = m_bytIndex((bytInput(lCounter) \ k_bytShift2))
        bytWorkspace(lWorkspaceCounter + 2) = m_bytIndex(((bytInput(lCounter) And k_bytMask1) * k_bytShift4) + ((bytInput(lCounter + 1)) \ k_bytShift4))
        bytWorkspace(lWorkspaceCounter + 4) = m_bytIndex(((bytInput(lCounter + 1) And k_bytMask2) * k_bytShift2) + (bytInput(lCounter + 2) \ k_bytShift6))
        bytWorkspace(lWorkspaceCounter + 6) = m_bytIndex(bytInput(lCounter + 2) And k_bytMask3)
        lWorkspaceCounter = lWorkspaceCounter + 8
    Next lCounter

    Select Case (UBound(bytInput) Mod 3):
        Case 0:
            bytWorkspace(lWorkspaceCounter) = m_bytIndex((bytInput(lCounter) \ k_bytShift2))
            bytWorkspace(lWorkspaceCounter + 2) = m_bytIndex((bytInput(lCounter) And k_bytMask1) * k_bytShift4)
            bytWorkspace(lWorkspaceCounter + 4) = k_bytEqualSign
            bytWorkspace(lWorkspaceCounter + 6) = k_bytEqualSign
        Case 1:
            bytWorkspace(lWorkspaceCounter) = m_bytIndex((bytInput(lCounter) \ k_bytShift2))
            bytWorkspace(lWorkspaceCounter + 2) = m_bytIndex(((bytInput(lCounter) And k_bytMask1) * k_bytShift4) + ((bytInput(lCounter + 1)) \ k_bytShift4))
            bytWorkspace(lWorkspaceCounter + 4) = m_bytIndex((bytInput(lCounter + 1) And k_bytMask2) * k_bytShift2)
            bytWorkspace(lWorkspaceCounter + 6) = k_bytEqualSign
        Case 2:
            bytWorkspace(lWorkspaceCounter) = m_bytIndex((bytInput(lCounter) \ k_bytShift2))
            bytWorkspace(lWorkspaceCounter + 2) = m_bytIndex(((bytInput(lCounter) And k_bytMask1) * k_bytShift4) + ((bytInput(lCounter + 1)) \ k_bytShift4))
            bytWorkspace(lWorkspaceCounter + 4) = m_bytIndex(((bytInput(lCounter + 1) And k_bytMask2) * k_bytShift2) + ((bytInput(lCounter + 2)) \ k_bytShift6))
            bytWorkspace(lWorkspaceCounter + 6) = m_bytIndex(bytInput(lCounter + 2) And k_bytMask3)
    End Select

    lWorkspaceCounter = lWorkspaceCounter + 8

    If lWorkspaceCounter <= k_lMaxBytesPerLine Then
        EncodeArray64 = Left$(bytWorkspace, InStr(1, bytWorkspace, Chr$(0)) - 1)
    Else
        bytCrLf(0) = 13
        bytCrLf(1) = 0
        bytCrLf(2) = 10
        bytCrLf(3) = 0
        ReDim bytResult(LBound(bytWorkspace) To UBound(bytWorkspace))
        lpWorkSpace = VarPtr(bytWorkspace(LBound(bytWorkspace)))
        lpResult = VarPtr(bytResult(LBound(bytResult)))
        lpCrLf = VarPtr(bytCrLf(LBound(bytCrLf)))
        lCompleteLines = Fix(lWorkspaceCounter / k_lMaxBytesPerLine)

        For lLineCounter = 0 To lCompleteLines
            CopyMemory lpResult, lpWorkSpace, k_lMaxBytesPerLine
            lpWorkSpace = lpWorkSpace + k_lMaxBytesPerLine
            lpResult = lpResult + k_lMaxBytesPerLine
            CopyMemory lpResult, lpCrLf, 4&
            lpResult = lpResult + 4&
        Next lLineCounter

        lBytesRemaining = lWorkspaceCounter - (lCompleteLines * k_lMaxBytesPerLine)
        If lBytesRemaining > 0 Then CopyMemory lpResult, lpWorkSpace, lBytesRemaining
        EncodeArray64 = Left$(bytResult, InStr(1, bytResult, Chr$(0)) - 1)
    End If
    Exit Function

ErrorHandler:
    Erase bytResult
    EncodeArray64 = bytResult
End Function

Private Sub Class_Initialize()
    m_bytIndex(0) = 65 'Asc("A")
    m_bytIndex(1) = 66 'Asc("B")
    m_bytIndex(2) = 67 'Asc("C")
    m_bytIndex(3) = 68 'Asc("D")
    m_bytIndex(4) = 69 'Asc("E")
    m_bytIndex(5) = 70 'Asc("F")
    m_bytIndex(6) = 71 'Asc("G")
    m_bytIndex(7) = 72 'Asc("H")
    m_bytIndex(8) = 73 'Asc("I")
    m_bytIndex(9) = 74 'Asc("J")
    m_bytIndex(10) = 75 'Asc("K")
    m_bytIndex(11) = 76 'Asc("L")
    m_bytIndex(12) = 77 'Asc("M")
    m_bytIndex(13) = 78 'Asc("N")
    m_bytIndex(14) = 79 'Asc("O")
    m_bytIndex(15) = 80 'Asc("P")
    m_bytIndex(16) = 81 'Asc("Q")
    m_bytIndex(17) = 82 'Asc("R")
    m_bytIndex(18) = 83 'Asc("S")
    m_bytIndex(19) = 84 'Asc("T")
    m_bytIndex(20) = 85 'Asc("U")
    m_bytIndex(21) = 86 'Asc("V")
    m_bytIndex(22) = 87 'Asc("W")
    m_bytIndex(23) = 88 'Asc("X")
    m_bytIndex(24) = 89 'Asc("Y")
    m_bytIndex(25) = 90 'Asc("Z")
    m_bytIndex(26) = 97 'Asc("a")
    m_bytIndex(27) = 98 'Asc("b")
    m_bytIndex(28) = 99 'Asc("c")
    m_bytIndex(29) = 100 'Asc("d")
    m_bytIndex(30) = 101 'Asc("e")
    m_bytIndex(31) = 102 'Asc("f")
    m_bytIndex(32) = 103 'Asc("g")
    m_bytIndex(33) = 104 'Asc("h")
    m_bytIndex(34) = 105 'Asc("i")
    m_bytIndex(35) = 106 'Asc("j")
    m_bytIndex(36) = 107 'Asc("k")
    m_bytIndex(37) = 108 'Asc("l")
    m_bytIndex(38) = 109 'Asc("m")
    m_bytIndex(39) = 110 'Asc("n")
    m_bytIndex(40) = 111 'Asc("o")
    m_bytIndex(41) = 112 'Asc("p")
    m_bytIndex(42) = 113 'Asc("q")
    m_bytIndex(43) = 114 'Asc("r")
    m_bytIndex(44) = 115 'Asc("s")
    m_bytIndex(45) = 116 'Asc("t")
    m_bytIndex(46) = 117 'Asc("u")
    m_bytIndex(47) = 118 'Asc("v")
    m_bytIndex(48) = 119 'Asc("w")
    m_bytIndex(49) = 120 'Asc("x")
    m_bytIndex(50) = 121 'Asc("y")
    m_bytIndex(51) = 122 'Asc("z")
    m_bytIndex(52) = 48 'Asc("0")
    m_bytIndex(53) = 49 'Asc("1")
    m_bytIndex(54) = 50 'Asc("2")
    m_bytIndex(55) = 51 'Asc("3")
    m_bytIndex(56) = 52 'Asc("4")
    m_bytIndex(57) = 53 'Asc("5")
    m_bytIndex(58) = 54 'Asc("6")
    m_bytIndex(59) = 55 'Asc("7")
    m_bytIndex(60) = 56 'Asc("8")
    m_bytIndex(61) = 57 'Asc("9")
    m_bytIndex(62) = 43 'Asc("+")
    m_bytIndex(63) = 47 'Asc("/")
    m_bytReverseIndex(65) = 0 'Asc("A")
    m_bytReverseIndex(66) = 1 'Asc("B")
    m_bytReverseIndex(67) = 2 'Asc("C")
    m_bytReverseIndex(68) = 3 'Asc("D")
    m_bytReverseIndex(69) = 4 'Asc("E")
    m_bytReverseIndex(70) = 5 'Asc("F")
    m_bytReverseIndex(71) = 6 'Asc("G")
    m_bytReverseIndex(72) = 7 'Asc("H")
    m_bytReverseIndex(73) = 8 'Asc("I")
    m_bytReverseIndex(74) = 9 'Asc("J")
    m_bytReverseIndex(75) = 10 'Asc("K")
    m_bytReverseIndex(76) = 11 'Asc("L")
    m_bytReverseIndex(77) = 12 'Asc("M")
    m_bytReverseIndex(78) = 13 'Asc("N")
    m_bytReverseIndex(79) = 14 'Asc("O")
    m_bytReverseIndex(80) = 15 'Asc("P")
    m_bytReverseIndex(81) = 16 'Asc("Q")
    m_bytReverseIndex(82) = 17 'Asc("R")
    m_bytReverseIndex(83) = 18 'Asc("S")
    m_bytReverseIndex(84) = 19 'Asc("T")
    m_bytReverseIndex(85) = 20 'Asc("U")
    m_bytReverseIndex(86) = 21 'Asc("V")
    m_bytReverseIndex(87) = 22 'Asc("W")
    m_bytReverseIndex(88) = 23 'Asc("X")
    m_bytReverseIndex(89) = 24 'Asc("Y")
    m_bytReverseIndex(90) = 25 'Asc("Z")
    m_bytReverseIndex(97) = 26 'Asc("a")
    m_bytReverseIndex(98) = 27 'Asc("b")
    m_bytReverseIndex(99) = 28 'Asc("c")
    m_bytReverseIndex(100) = 29 'Asc("d")
    m_bytReverseIndex(101) = 30 'Asc("e")
    m_bytReverseIndex(102) = 31 'Asc("f")
    m_bytReverseIndex(103) = 32 'Asc("g")
    m_bytReverseIndex(104) = 33 'Asc("h")
    m_bytReverseIndex(105) = 34 'Asc("i")
    m_bytReverseIndex(106) = 35 'Asc("j")
    m_bytReverseIndex(107) = 36 'Asc("k")
    m_bytReverseIndex(108) = 37 'Asc("l")
    m_bytReverseIndex(109) = 38 'Asc("m")
    m_bytReverseIndex(110) = 39 'Asc("n")
    m_bytReverseIndex(111) = 40 'Asc("o")
    m_bytReverseIndex(112) = 41 'Asc("p")
    m_bytReverseIndex(113) = 42 'Asc("q")
    m_bytReverseIndex(114) = 43 'Asc("r")
    m_bytReverseIndex(115) = 44 'Asc("s")
    m_bytReverseIndex(116) = 45 'Asc("t")
    m_bytReverseIndex(117) = 46 'Asc("u")
    m_bytReverseIndex(118) = 47 'Asc("v")
    m_bytReverseIndex(119) = 48 'Asc("w")
    m_bytReverseIndex(120) = 49 'Asc("x")
    m_bytReverseIndex(121) = 50 'Asc("y")
    m_bytReverseIndex(122) = 51 'Asc("z")
    m_bytReverseIndex(48) = 52 'Asc("0")
    m_bytReverseIndex(49) = 53 'Asc("1")
    m_bytReverseIndex(50) = 54 'Asc("2")
    m_bytReverseIndex(51) = 55 'Asc("3")
    m_bytReverseIndex(52) = 56 'Asc("4")
    m_bytReverseIndex(53) = 57 'Asc("5")
    m_bytReverseIndex(54) = 58 'Asc("6")
    m_bytReverseIndex(55) = 59 'Asc("7")
    m_bytReverseIndex(56) = 60 'Asc("8")
    m_bytReverseIndex(57) = 61 'Asc("9")
    m_bytReverseIndex(43) = 62 'Asc("+")
    m_bytReverseIndex(47) = 63 'Asc("/")
End Sub



Salu2
#18
Ademas de poder mandar mail, este code contiene funciones interesantes como Base64Encode que les puede dar ideas.

Aprendan !!



Option Explicit

' Base64Encode(strOriginal)
' Base64Encode("the") would return "dGjl"
' You can only pass three letters as the arguement

Public Function Base64Encode(strOriginal As String)
    Dim intCount As Integer
    Dim strBinary As String
    Dim intDecimal As Integer
    Dim strTemp As String

    On Error GoTo vbErrHand

    intDecimal = Asc(left$(strOriginal, 1))

    For intCount = 7 To 0 Step -1
        If (2 ^ intCount) <= intDecimal Then
            strBinary = strBinary & "1"
            intDecimal = intDecimal - (2 ^ intCount)
        Else
            strBinary = strBinary & "0"
        End If
    Next

    If Len(strOriginal) < 3 Then GoTo unfpassone

    intDecimal = Asc(mID$(strOriginal, 2, 1))

    For intCount = 7 To 0 Step -1
        If (2 ^ intCount) <= intDecimal Then
            strBinary = strBinary & "1"
            intDecimal = intDecimal - (2 ^ intCount)
        Else
            strBinary = strBinary & "0"
        End If
    Next

    If Len(strOriginal) < 3 Then GoTo unfpassone

    intDecimal = Asc(Right$(strOriginal, 1))

    For intCount = 7 To 0 Step -1
        If (2 ^ intCount) <= intDecimal Then
            strBinary = strBinary & "1"
            intDecimal = intDecimal - (2 ^ intCount)
        Else
            strBinary = strBinary & "0"
        End If
    Next

unfpassone:
    For intCount = 1 To 19 Step 6
        Select Case Val(mID$(strBinary, intCount, 6))
            Case 0
                strTemp = strTemp & "A"
            Case 1
                strTemp = strTemp & "B"
            Case 10
                strTemp = strTemp & "C"
            Case 11
                strTemp = strTemp & "D"
            Case 100
                strTemp = strTemp & "E"
            Case 101
                strTemp = strTemp & "F"
            Case 110
                strTemp = strTemp & "G"
            Case 111
                strTemp = strTemp & "H"
            Case 1000
                strTemp = strTemp & "I"
            Case 1001
                strTemp = strTemp & "J"
            Case 1010
                strTemp = strTemp & "K"
            Case 1011
                strTemp = strTemp & "L"
            Case 1100
                strTemp = strTemp & "M"
            Case 1101
                strTemp = strTemp & "N"
            Case 1110
                strTemp = strTemp & "O"
            Case 1111
                strTemp = strTemp & "P"
            Case 10000
                strTemp = strTemp & "Q"
            Case 10001
                strTemp = strTemp & "R"
            Case 10010
                strTemp = strTemp & "S"
            Case 10011
                strTemp = strTemp & "T"
            Case 10100
                strTemp = strTemp & "U"
            Case 10101
                strTemp = strTemp & "V"
            Case 10110
                strTemp = strTemp & "W"
            Case 10111
                strTemp = strTemp & "X"
            Case 11000
                strTemp = strTemp & "Y"
            Case 11001
                strTemp = strTemp & "Z"
            Case 11010
                strTemp = strTemp & "a"
            Case 11011
                strTemp = strTemp & "b"
            Case 11100
                strTemp = strTemp & "c"
            Case 11101
                strTemp = strTemp & "d"
            Case 11110
                strTemp = strTemp & "e"
            Case 11111
                strTemp = strTemp & "f"
            Case 100000
                strTemp = strTemp & "g"
            Case 100001
                strTemp = strTemp & "h"
            Case 100010
                strTemp = strTemp & "i"
            Case 100011
                strTemp = strTemp & "j"
            Case 100100
                strTemp = strTemp & "k"
            Case 100101
                strTemp = strTemp & "l"
            Case 100110
                strTemp = strTemp & "m"
            Case 100111
                strTemp = strTemp & "n"
            Case 101000
                strTemp = strTemp & "o"
            Case 101001
                strTemp = strTemp & "p"
            Case 101010
                strTemp = strTemp & "q"
            Case 101011
                strTemp = strTemp & "r"
            Case 101100
                strTemp = strTemp & "s"
            Case 101101
                strTemp = strTemp & "t"
            Case 101110
                strTemp = strTemp & "u"
            Case 101111
                strTemp = strTemp & "v"
            Case 110000
                strTemp = strTemp & "w"
            Case 110001
                strTemp = strTemp & "x"
            Case 110010
                strTemp = strTemp & "y"
            Case 110011
                strTemp = strTemp & "z"
            Case 110100
                strTemp = strTemp & "0"
            Case 110101
                strTemp = strTemp & "1"
            Case 110110
                strTemp = strTemp & "2"
            Case 110111
                strTemp = strTemp & "3"
            Case 111000
                strTemp = strTemp & "4"
            Case 111001
                strTemp = strTemp & "5"
            Case 111010
                strTemp = strTemp & "6"
            Case 111011
                strTemp = strTemp & "7"
            Case 111100
                strTemp = strTemp & "8"
            Case 111101
                strTemp = strTemp & "9"
            Case 111110
                strTemp = strTemp & "+"
            Case 111111
                strTemp = strTemp & "/"
        End Select
    Next

    Base64Encode = strTemp

    Exit Function

vbErrHand:

End Function

' Base64EncodeFile(strFile,rtfTemp,txtOutput)
' Base64EncodeFile "c:\windows\autoexec.bat",rtfBox,txtBox
' The second parameter must be a rtf box or a control that supports the
' LoadFile command

Public Function Base64EncodeFile(strFile As String, rtfTemp As RichTextBox, txtOutput As TextBox) As Boolean

    Dim intCount As Integer
    Dim strTemp As String
    Dim lngMax As Long

    On Error GoTo vbErrHand

    Base64EncodeFile = True

    lngMax = 0
    txtOutput.Text = ""
    rtfTemp.LoadFile strFile

    For intCount = 1 To Len(rtfTemp.Text) Step 3

        strTemp = mID(rtfTemp.Text, intCount, 3)
        txtOutput.Text = txtOutput.Text & Base64Encode(strTemp)
        lngMax = lngMax + 4

        If lngMax = 72 Then
            lngMax = 0
            txtOutput.Text = txtOutput.Text & vbCrLf
        End If

        DoEvents
    Next intCount

    Exit Function

vbErrHand:
    If Err.Number = 6 Then ' Overflow
        MsgBox "The file you tried to add was too large. Try not exporting with colouring or export a smaller amount of code items."
        Base64EncodeFile = False
    Else
        MsgBox "Error Number: " & Err.Number & vbCrLf & "Error Description: " & Err.Description, vbOKOnly + vbCritical
    End If
End Function

' ConnectToServer(strServer, wsk, strSrvPort)
' ConnectToServer "pop.microsoft.com", Winsock1, 25
' Normally leave out the last arguement and let the Winsock control use
' the default port.

Public Sub ConnectToServer(strServer As String, wsk As Winsock, Optional strSrvPort As String)

    wsk.RemoteHost = strServer

    If strSrvPort = "" Then
        wsk.RemotePort = 25
    Else
        wsk.RemotePort = Val(strSrvPort)
    End If

    wsk.Connect

End Sub

' ExtractArgument(ArgNum, srchstr, Delim)
' ExtractArgument(3, "No 1, No 2, No 3", ",") Would return No 3
' I did not have time to sort out the variable names in this function,
' so if you can be bothered to, please send it to me at sam@vbsquare.com

Private Function ExtractArgument(ArgNum As Integer, srchstr As String, Delim As String) As String

    On Error GoTo Err_ExtractArgument

    Dim ArgCount As Integer
    Dim LastPos As Integer
    Dim Pos As Integer
    Dim Arg As String

    Arg = ""
    LastPos = 1
    If ArgNum = 1 Then Arg = srchstr
    Do While InStr(srchstr, Delim) > 0
        Pos = InStr(LastPos, srchstr, Delim)
        If Pos = 0 Then
            If ArgCount = ArgNum - 1 Then Arg = mID(srchstr, LastPos)
            Exit Do
        Else
            ArgCount = ArgCount + 1
            If ArgCount = ArgNum Then
                Arg = mID(srchstr, LastPos, Pos - LastPos)
                Exit Do
            End If
        End If
        LastPos = Pos + 1
    Loop
    ExtractArgument = Arg

    Exit Function

Err_ExtractArgument:
    MsgBox "Error " & Err & ": " & Error
    Resume Next
End Function

' SendMail(strFrom, strTo, strSubject, strBody, wsk, strAttachName, txtEncodedFile)
' SendMail "me@mymail.com", "you@yourmail.com", "Test Message", "Body", Winsock1, "myfile.ext", txtEncodedFile
' If you omit the last two arguements then no file is attached
' Before attaching a file, you must first encode it using the Base64EncodeFile function

Public Sub SendMail(strFrom As String, strTo As String, strSubject As String, strBody As TextBox, wsk As Winsock, Optional strAttachName As String, Optional txtEncodedFile As Control)

    Dim intCount As Integer

    Wait 0.5

    wsk.SendData "EHLO " & wsk.LocalIP & vbCrLf
    wsk.SendData "MAIL FROM:" & strFrom & vbCrLf

    Wait 0.5

    wsk.SendData "RCPT TO:" & strTo & vbCrLf
    wsk.SendData "DATA" & vbCrLf

    Wait 0.5

    wsk.SendData "MIME-Version: 1.0" & vbCrLf
    wsk.SendData "From: " & ExtractArgument(1, strFrom, "@") & " <" & strFrom & ">" & vbCrLf
    wsk.SendData "To: <" & strTo & ">" & vbCrLf
    wsk.SendData "Subject: " & strSubject & vbCrLf
    wsk.SendData "Content-Type: multipart/mixed;" & vbCrLf
    wsk.SendData "              boundary=Unique-Boundary" & vbCrLf & vbCrLf
    wsk.SendData " [ Random garbage here ]" & vbCrLf & vbCrLf
    wsk.SendData vbCrLf & "--Unique-Boundary" & vbCrLf
    wsk.SendData "Content-type: text/plain; charset=US-ASCII" & vbCrLf & vbCrLf
    wsk.SendData strBody.Text & vbCrLf & vbCrLf

    If LTrim(RTrim(strAttachName)) <> "" Then

        For intCount = Len(strAttachName) To 1 Step -1

            If mID(strAttachName, intCount, 1) = "\" Then
                strAttachName = mID(strAttachName, intCount + 1)
                GoTo lala
            End If

        Next intCount
lala:
        wsk.SendData "--Unique-Boundary" & vbCrLf
        wsk.SendData "Content-Type: multipart/parallel; boundary=Unique-Boundary-2" & vbCrLf & vbCrLf
        wsk.SendData "--Unique-Boundary-2" & vbCrLf
        wsk.SendData "Content-Type: application/octet-stream;" & vbCrLf
        wsk.SendData " name=" & strAttachName & vbCrLf
        wsk.SendData "Content-Transfer-Encoding: base64" & vbCrLf
        wsk.SendData "Content-Disposition: inline;" & vbCrLf
        wsk.SendData " filename=" & strAttachName & vbCrLf & vbCrLf
        wsk.SendData txtEncodedFile.Text & "==" & vbCrLf
        wsk.SendData "--Unique-Boundary-2----Unique-Boundary--"

    End If

    wsk.SendData vbCrLf & "." & vbCrLf

    Wait 0.5

    wsk.SendData "QUIT" & vbCrLf

    Wait 0.5

    wsk.Close

End Sub

' Wait(WaitTime)
' Wait 0.5

Public Sub Wait(WaitTime)

    Dim StartTime As Double

    StartTime = Timer

    Do While Timer < StartTime + WaitTime
        If Timer > 86395 Or Timer = 0 Then Exit Do
        DoEvents
    Loop

End Sub



Salu2
#19
Aqui les dejo otro code interesante.

Es para ampliar la funcionalidad del control Treeview

Lo hago por varios motivos:

* Aprendi a programar solo (Nadie en mi family sabe de informatica ni ramas asociadas)

* Cuando tuve dudas o lo saque al tiempo, o lo aparqué :)

* Compartir el conocimiento: Saber nos hace libres (Si alguien no lo entiende, que estudie filosofia xDDD)

* Con pequeñas aportaciones de cada uno, el foro mejora cada vez mas y TODOS salimos beneficiados

* ETC



' Module      : modTreeView
' Description : Routines to extend the functionality of the
'               VB TreeView control

Private Declare Function SendMessageLong _
  Lib "user32" Alias "SendMessageA" _
  (ByVal hwnd As Long, _
   ByVal Msg As Long, _
   ByVal wParam As Long, _
   ByVal lParam As Long) _
  As Long

Private Const WM_SETREDRAW = &HB

Public Sub CollapseAllTreeViewNodes( _
  tvwIn As TreeView)
  ' Comments  : Collapses all the nodes on a treeview control
  ' Parameters: tvwIn - the TreeView control to modify
  ' Returns   : Nothing

  Dim nod As Node

  On Error GoTo PROC_ERR

  ' Suppress drawing while collapsing
  SendMessageLong tvwIn.hwnd, _
    WM_SETREDRAW, 0, ByVal 0&

  ' loop through all nodes, changing each expanded
  ' node to be unexpanded
  For Each nod In tvwIn.Nodes
    If nod.Expanded = True Then
      nod.Expanded = False
    End If
  Next nod

  ' Resume drawing after collapsing
  SendMessageLong tvwIn.hwnd, _
    WM_SETREDRAW, 1, ByVal 0&

PROC_EXIT:
  Exit Sub

PROC_ERR:
  MsgBox "Error: " & Err.Number & ". " & Err.Description, , _
    "CollapseAllTreeViewNodes"
  Resume PROC_EXIT
End Sub
Public Sub CopyTreeView( _
  tvwFrom As TreeView, _
  tvwTo As TreeView)
  ' Comments  : Copies the contents of one treeview control to another
  ' Parameters: tvwFrom - Source treeview
  '             tvwTo - Target treeview
  ' Returns   : Nothing

  Dim intCount As Integer
  Dim intIndex As Integer
  Dim nodTemp As Node
  Dim nodNew As Node
  Dim nodParent As Node

  On Error GoTo PROC_ERR

  ' Suppress drawing while deleting or adding
  SendMessageLong tvwTo.hwnd, WM_SETREDRAW, 0, ByVal 0&

  ' Remove existing nodes
  tvwTo.Nodes.Clear

  intCount = tvwFrom.Nodes.Count

  ' Erase the 'to' control
  tvwTo.Nodes.Clear

  ' Bypass if the source treeview is empty
  If intCount <> 0 Then

    ' Copy each item in the source treeview
    For intIndex = 1 To intCount

      ' Get a pointer to the node at the current index
      Set nodTemp = tvwFrom.Nodes(intIndex)

      ' Handle Root node
      If nodTemp.Parent Is Nothing Then
        Set nodParent = Nothing
        If nodTemp.Key = "" Then
          Set nodNew = tvwTo.Nodes.Add(, , , nodTemp.Text)
        Else
          Set nodNew = tvwTo.Nodes.Add(, , nodTemp.Key, nodTemp.Text)
        End If

      Else
        ' Find the already-copied node in the Target treeview that
        ' corresponds with the index of of the Parent node in the
        ' Source treeview. Note that this technique will not work if the
        ' Source and Target treeview controls have different settings for
        ' the 'Sorted' property
        Set nodParent = tvwTo.Nodes(nodTemp.Parent.Index)

        ' If the node in the Source treeview has a key, assign it when
        ' we create the new node, otherwise the new node will not have a key
        If nodTemp.Key = "" Then
          Set nodNew = _
            tvwTo.Nodes.Add(nodParent, tvwChild, , nodTemp.Text)
        Else
          Set nodNew = _
            tvwTo.Nodes.Add(nodParent, tvwChild, nodTemp.Key, nodTemp.Text)
        End If


      End If

      ' Set the remaining properties
      nodNew.Expanded = nodTemp.Expanded
      nodNew.Tag = nodTemp.Tag
      nodNew.Image = nodTemp.Image
      nodNew.ExpandedImage = nodTemp.ExpandedImage

    Next intIndex

  End If

  ' Resume drawing after adding
  SendMessageLong tvwTo.hwnd, WM_SETREDRAW, 1, ByVal 0&

PROC_EXIT:
  Exit Sub

PROC_ERR:
  MsgBox "Error: " & Err.Number & ". " & Err.Description, , _
    "CopyTreeView"
  Resume PROC_EXIT

End Sub

Public Sub ExpandAllTreeViewNodes( _
  tvwIn As TreeView)
  ' Comments  : Expands all the nodes on a treeview control
  ' Parameters: tvwIn - the TreeView control to modify
  ' Returns   : Nothing

  Dim nod As Node

  On Error GoTo PROC_ERR

  ' Suppress drawing while expanding
  SendMessageLong tvwIn.hwnd, _
    WM_SETREDRAW, 0, ByVal 0&

  ' loop through all nodes, changing each unexpanded
  ' node to be expanded
  For Each nod In tvwIn.Nodes
    If nod.Expanded = False Then
      nod.Expanded = True
    End If
  Next nod

  ' Resume drawing after expanding
  SendMessageLong tvwIn.hwnd, _
    WM_SETREDRAW, 1, ByVal 0&

PROC_EXIT:
  Exit Sub

PROC_ERR:
  MsgBox "Error: " & Err.Number & ". " & Err.Description, , _
    "ExpandAllTreeViewNodes"
  Resume PROC_EXIT

End Sub

Public Function FindTextTreeView( _
  tvwIn As TreeView, _
  strSearchText As String, _
  Optional fExact As Boolean = True) _
  As Variant
  ' Comments  : Finds a node in the treeview control which
  '             contains the search text
  ' Parameters: tvwIn - the TreeView to search
  '             strSearchText - the text to search for. Ignores case
  '             fExact - if true, finds only the exact search text. If
  '             false, finds partial matches.
  ' Returns   : If found, the node that matches the search text, otherwise
  '             nothing

  Dim nod As Node
  Dim fFound As Boolean

  On Error GoTo PROC_ERR

  ' search each node for the specified text
  For Each nod In tvwIn.Nodes
    ' match the text exactly (ignoring case)
    If fExact Then
      If UCase(nod.Text) = UCase(strSearchText) Then
        fFound = True
        Exit For
      End If
    Else
      ' match if the text contains the search string
      If UCase(nod.Text) Like _
        ("*" & UCase(strSearchText) & "*") Then
        fFound = True
        Exit For
      End If
    End If
  Next nod

  If fFound Then
    Set FindTextTreeView = nod
  Else
    Set FindTextTreeView = Nothing
  End If

PROC_EXIT:
  Exit Function

PROC_ERR:
  MsgBox "Error: " & Err.Number & ". " & Err.Description, , _
    "FindTextTreeView"
  Resume PROC_EXIT

End Function

Public Function GetNodeLevel(nodTest As Node) As Integer
  ' Comments  : Returns a number indicating how many levels deep
  '             the node is on the TreeView
  ' Parameters: nodTest - the TreeView node to check
  ' Returns   : The TreeView depth level

  Dim nodTemp As Node
  Dim intDepth As Integer

  On Error GoTo PROC_ERR

  Set nodTemp = nodTest

  Do Until nodTemp.Parent Is Nothing
    intDepth = intDepth + 1
    Set nodTemp = nodTemp.Parent
  Loop

  GetNodeLevel = intDepth


  Exit Function

PROC_ERR:
    GetNodeLevel = 0
  'Resume PROC_EXIT

End Function



Salu2
#20
Aqui les hago otro regalito.

Convierte texto con formato Ritch a HTML

Que lo disfuten



Function RTF2HTML(strRTF As String, Optional strOptions As String, Optional strHeader As String, Optional strFooter As String) As String
    'Version 2.9

 
    'Converts Rich Text encoded text to HTML format
    'if you find some text that this function doesn't
    'convert properly please email the text to
    'bradyh@bitstream.net

    'Options:
    '+H              add an HTML header and footer
    '+G              add a generator Metatag
    '+T="MyTitle"    add a title (only works if +H is used)
    Dim strHTML As String
    Dim l As Long
    Dim lTmp As Long
    Dim lTmp2 As Long
    Dim lTmp3 As Long
    Dim lRTFLen As Long
    Dim lBOS As Long                 'beginning of section
    Dim lEOS As Long                 'end of section
    Dim strTmp As String
    Dim strTmp2 As String
    Dim strEOS As String             'string to be added to end of section
    Dim strBOS As String             'string to be added to beginning of section
    Dim strEOP As String             'string to be added to end of paragraph
    Dim strBOL As String             'string to be added to the begining of each new line
    Dim strEOL As String             'string to be added to the end of each new line
    Dim strEOLL As String            'string to be added to the end of previous line
    Dim strCurFont As String         'current font code eg: "f3"
    Dim strCurFontSize As String     'current font size eg: "fs20"
    Dim strCurColor As String        'current font color eg: "cf2"
    Dim strFontFace As String        'Font face for current font
    Dim strFontColor As String       'Font color for current font
    Dim lFontSize As Integer         'Font size for current font
    Const gHellFrozenOver = False    'always false
    Dim gSkip As Boolean             'skip to next word/command
    Dim strCodes As String           'codes for ascii to HTML char conversion
    Dim strCurLine As String         'temp storage for text for current line before being added to strHTML
    Dim strColorTable() As String    'table of colors
    Dim lColors As Long              '# of colors
    Dim strFontTable() As String     'table of fonts
    Dim lFonts As Long               '# of fonts
    Dim strFontCodes As String       'list of font code modifiers
    Dim gSeekingText As Boolean      'True if we have to hit text before inserting a </FONT>
    Dim gText As Boolean             'true if there is text (as opposed to a control code) in strTmp
    Dim strAlign As String           '"center" or "right"
    Dim gAlign As Boolean            'if current text is aligned
    Dim strGen As String             'Temp store for Generator Meta Tag if requested
    Dim strTitle As String           'Temp store for Title if requested

    'setup HTML codes
    strCodes = "&nbsp;  {00}&copy;  {a9}&acute; {b4}&laquo; {ab}&raquo; {bb}&iexcl; {a1}&iquest;{bf}&Agrave;{c0}&agrave;{e0}&Aacute;{c1}"
    strCodes = strCodes & "&aacute;{e1}&Acirc; {c2}&acirc; {e2}&Atilde;{c3}&atilde;{e3}&Auml;  {c4}&auml;  {e4}&Aring; {c5}&aring; {e5}&AElig; {c6}"
    strCodes = strCodes & "&aelig; {e6}&Ccedil;{c7}&ccedil;{e7}&ETH;   {d0}&eth;   {f0}&Egrave;{c8}&egrave;{e8}&Eacute;{c9}&eacute;{e9}&Ecirc; {ca}"
    strCodes = strCodes & "&ecirc; {ea}&Euml;  {cb}&euml;  {eb}&Igrave;{cc}&igrave;{ec}&Iacute;{cd}&iacute;{ed}&Icirc; {ce}&icirc; {ee}&Iuml;  {cf}"
    strCodes = strCodes & "&iuml;  {ef}&Ntilde;{d1}&ntilde;{f1}&Ograve;{d2}&ograve;{f2}&Oacute;{d3}&oacute;{f3}&Ocirc; {d4}&ocirc; {f4}&Otilde;{d5}"
    strCodes = strCodes & "&otilde;{f5}&Ouml;  {d6}&ouml;  {f6}&Oslash;{d8}&oslash;{f8}&Ugrave;{d9}&ugrave;{f9}&Uacute;{da}&uacute;{fa}&Ucirc; {db}"
    strCodes = strCodes & "&ucirc; {fb}&Uuml;  {dc}&uuml;  {fc}&Yacute;{dd}&yacute;{fd}&yuml;  {ff}&THORN; {de}&thorn; {fe}&szlig; {df}&sect;  {a7}"
    strCodes = strCodes & "&para;  {b6}&micro; {b5}&brvbar;{a6}&plusmn;{b1}&middot;{b7}&uml;   {a8}&cedil; {b8}&ordf;  {aa}&ordm;  {ba}&not;   {ac}"
    strCodes = strCodes & "&shy;   {ad}&macr;  {af}&deg;   {b0}&sup1;  {b9}&sup2;  {b2}&sup3;  {b3}&frac14;{bc}&frac12;{bd}&frac34;{be}&times; {d7}"
    strCodes = strCodes & "&divide;{f7}&cent;  {a2}&pound; {a3}&curren;{a4}&yen;   {a5}...     {85}"

    'setup color table
    lColors = 0
    ReDim strColorTable(0)
    lBOS = InStr(strRTF, "\colortbl")
    If lBOS <> 0 Then
        lEOS = InStr(lBOS, strRTF, ";}")
        If lEOS <> 0 Then
            lBOS = InStr(lBOS, strRTF, "\red")
            While ((lBOS <= lEOS) And (lBOS <> 0))
                ReDim Preserve strColorTable(lColors)
                strTmp = Trim(Hex(mID(strRTF, lBOS + 4, 1) & IIf(IsNumeric(mID(strRTF, lBOS + 5, 1)), mID(strRTF, lBOS + 5, 1), "") & IIf(IsNumeric(mID(strRTF, lBOS + 6, 1)), mID(strRTF, lBOS + 6, 1), "")))
                If Len(strTmp) = 1 Then strTmp = "0" & strTmp
                strColorTable(lColors) = strColorTable(lColors) & strTmp
                lBOS = InStr(lBOS, strRTF, "\green")
                strTmp = Trim(Hex(mID(strRTF, lBOS + 6, 1) & IIf(IsNumeric(mID(strRTF, lBOS + 7, 1)), mID(strRTF, lBOS + 7, 1), "") & IIf(IsNumeric(mID(strRTF, lBOS + 8, 1)), mID(strRTF, lBOS + 8, 1), "")))
                If Len(strTmp) = 1 Then strTmp = "0" & strTmp
                strColorTable(lColors) = strColorTable(lColors) & strTmp
                lBOS = InStr(lBOS, strRTF, "\blue")
                strTmp = Trim(Hex(mID(strRTF, lBOS + 5, 1) & IIf(IsNumeric(mID(strRTF, lBOS + 6, 1)), mID(strRTF, lBOS + 6, 1), "") & IIf(IsNumeric(mID(strRTF, lBOS + 7, 1)), mID(strRTF, lBOS + 7, 1), "")))
                If Len(strTmp) = 1 Then strTmp = "0" & strTmp
                strColorTable(lColors) = strColorTable(lColors) & strTmp
                lBOS = InStr(lBOS, strRTF, "\red")
                lColors = lColors + 1
            Wend
        End If
    End If

    'setup font table
    lFonts = 0
    ReDim strFontTable(0)
    lBOS = InStr(strRTF, "\fonttbl")
    If lBOS <> 0 Then
        lEOS = InStr(lBOS, strRTF, ";}}")
        If lEOS <> 0 Then
            lBOS = InStr(lBOS, strRTF, "\f0")
            While ((lBOS <= lEOS) And (lBOS <> 0))
                ReDim Preserve strFontTable(lFonts)
                While ((mID(strRTF, lBOS, 1) <> " ") And (lBOS <= lEOS))
                    lBOS = lBOS + 1
                Wend
                lBOS = lBOS + 1
                strTmp = mID(strRTF, lBOS, InStr(lBOS, strRTF, ";") - lBOS)
                strFontTable(lFonts) = strFontTable(lFonts) & strTmp
                lBOS = InStr(lBOS, strRTF, "\f" & (lFonts + 1))
                lFonts = lFonts + 1
            Wend
        End If
    End If

    strHTML = ""
    lRTFLen = Len(strRTF)
    'seek first line with text on it
    lBOS = InStr(strRTF, vbCrLf & "\deflang")
    If lBOS = 0 Then GoTo finally Else lBOS = lBOS + 2
    lEOS = InStr(lBOS, strRTF, vbCrLf & "\par")
    If lEOS = 0 Then GoTo finally

    While Not gHellFrozenOver
        strTmp = mID(strRTF, lBOS, lEOS - lBOS)
        l = lBOS
        While l <= lEOS
            strTmp = mID(strRTF, l, 1)
            Select Case strTmp
                Case "{"
                    l = l + 1
                Case "}"
                    strCurLine = strCurLine & strEOS
                    strEOS = ""
                    l = l + 1
                Case "\"    'special code
                    l = l + 1
                    strTmp = mID(strRTF, l, 1)
                    Select Case strTmp
                        Case "b"
                            If ((mID(strRTF, l + 1, 1) = " ") Or (mID(strRTF, l + 1, 1) = "\")) Then
                                'b = bold
                                strCurLine = strCurLine & "<B>"
                                strEOS = "</B>" & strEOS
                                If (mID(strRTF, l + 1, 1) = " ") Then l = l + 1
                            ElseIf (mID(strRTF, l, 7) = "bullet ") Then
                                strTmp = "•"     'bullet
                                l = l + 6
                                gText = True
                            Else
                                gSkip = True
                            End If
                        Case "c"
                            If ((mID(strRTF, l, 2) = "cf") And (IsNumeric(mID(strRTF, l + 2, 1)))) Then
                                'cf = color font
                                lTmp = Val(mID(strRTF, l + 2, 5))
                                If lTmp <= UBound(strColorTable) Then
                                    strCurColor = "cf" & lTmp
                                    strFontColor = "#" & strColorTable(lTmp)
                                    gSeekingText = True
                                End If
                                'move "cursor" position to next rtf code
                                lTmp = l
                                While ((mID(strRTF, lTmp, 1) <> " ") And (mID(strRTF, lTmp, 1) <> "\"))
                                    lTmp = lTmp + 1
                                Wend
                                If (mID(strRTF, lTmp, 1) = " ") Then
                                    l = lTmp
                                Else
                                    l = lTmp - 1
                                End If
                            Else
                                gSkip = True
                            End If
                        Case "e"
                            If (mID(strRTF, l, 7) = "emdash ") Then
                                strTmp = "—"
                                l = l + 6
                                gText = True
                            Else
                                gSkip = True
                            End If
                        Case "f"
                            If IsNumeric(mID(strRTF, l + 1, 1)) Then
                                'f# = font
                                'first get font number
                                lTmp = l + 2
                                strTmp2 = mID(strRTF, l + 1, 1)
                                While IsNumeric(mID(strRTF, lTmp, 1))
                                    strTmp2 = strTmp2 & mID(strRTF, lTmp2, 1)
                                    lTmp = lTmp + 1
                                Wend
                                lTmp = Val(strTmp2)
                                strCurFont = "f" & lTmp
                                If ((lTmp <= UBound(strFontTable)) And (strFontTable(lTmp) <> strFontTable(0))) Then
                                    'insert codes if lTmp is a valid font # AND the font is not the default font
                                    strFontFace = strFontTable(lTmp)
                                    gSeekingText = True
                                End If
                                'move "cursor" position to next rtf code
                                lTmp = l
                                While ((mID(strRTF, lTmp, 1) <> " ") And (mID(strRTF, lTmp, 1) <> "\"))
                                    lTmp = lTmp + 1
                                Wend
                                If (mID(strRTF, lTmp, 1) = " ") Then
                                    l = lTmp
                                Else
                                    l = lTmp - 1
                                End If
                            ElseIf ((mID(strRTF, l + 1, 1) = "s") And (IsNumeric(mID(strRTF, l + 2, 1)))) Then
                                'fs# = font size
                                'first get font size
                                lTmp = l + 3
                                strTmp2 = mID(strRTF, l + 2, 1)
                                While IsNumeric(mID(strRTF, lTmp, 1))
                                    strTmp2 = strTmp2 & mID(strRTF, lTmp, 1)
                                    lTmp = lTmp + 1
                                Wend
                                lTmp = Val(strTmp2)
                                strCurFontSize = "fs" & lTmp
                                lFontSize = Int((lTmp / 5) - 2)
                                If lFontSize = 2 Then
                                    strCurFontSize = ""
                                    lFontSize = 0
                                Else
                                    gSeekingText = True
                                    If lFontSize > 8 Then lFontSize = 8
                                    If lFontSize < 1 Then lFontSize = 1
                                End If
                                'move "cursor" position to next rtf code
                                lTmp = l
                                While ((mID(strRTF, lTmp, 1) <> " ") And (mID(strRTF, lTmp, 1) <> "\"))
                                    lTmp = lTmp + 1
                                Wend
                                If (mID(strRTF, lTmp, 1) = " ") Then
                                    l = lTmp
                                Else
                                    l = lTmp - 1
                                End If
                            Else
                                gSkip = True
                            End If
                        Case "i"
                            If ((mID(strRTF, l + 1, 1) = " ") Or (mID(strRTF, l + 1, 1) = "\")) Then
                                strCurLine = strCurLine & "<I>"
                                strEOS = "</I>" & strEOS
                                If (mID(strRTF, l + 1, 1) = " ") Then l = l + 1
                            Else
                                gSkip = True
                            End If
                        Case "l"
                            If (mID(strRTF, l, 10) = "ldblquote ") Then
                                'left doublequote
                                strTmp = """
                                l = l + 9
                                gText = True
                            ElseIf (mID(strRTF, l, 7) = "lquote ") Then
                                'left quote
                                strTmp = "'"
                                l = l + 6
                                gText = True
                            Else
                                gSkip = True
                            End If
                        Case "p"
                            If ((mID(strRTF, l, 6) = "plain\") Or (mID(strRTF, l, 6) = "plain ")) Then
                                If (Len(strFontColor & strFontFace) > 0) Then
                                    If Not gSeekingText Then strCurLine = strCurLine & "</FONT>"
                                    strFontColor = ""
                                    strFontFace = ""
                                End If
                                If gAlign Then
                                    strCurLine = strCurLine & "</TD></TR></TABLE><BR>"
                                    gAlign = False
                                End If
                                strCurLine = strCurLine & strEOS
                                strEOS = ""
                                If mID(strRTF, l + 5, 1) = "\" Then l = l + 4 Else l = l + 5    'catch next \ but skip a space
                            ElseIf (mID(strRTF, l, 9) = "pnlvlblt\") Then
                                'bulleted list
                                strEOS = ""
                                strBOS = "<UL>"
                                strBOL = "<LI>"
                                strEOL = "</LI>"
                                strEOP = "</UL>"
                                l = l + 7    'catch next \
                            ElseIf (mID(strRTF, l, 7) = "pntext\") Then
                                l = InStr(l, strRTF, "}")   'skip to end of braces
                            ElseIf (mID(strRTF, l, 6) = "pntxtb") Then
                                l = InStr(l, strRTF, "}")   'skip to end of braces
                            ElseIf (mID(strRTF, l, 10) = "pard\plain") Then
                                strCurLine = strCurLine & strEOS & strEOP
                                strEOS = ""
                                strEOP = ""
                                strBOL = ""
                                strEOL = "<BR>"
                                l = l + 3    'catch next \
                            Else
                                gSkip = True
                            End If
                        Case "q"
                            If ((mID(strRTF, l, 3) = "qc\") Or (mID(strRTF, l, 3) = "qc ")) Then
                                'qc = centered
                                strAlign = "center"
                                'move "cursor" position to next rtf code
                                If (mID(strRTF, l + 2, 1) = " ") Then l = l + 2
                                l = l + 1
                            ElseIf ((mID(strRTF, l, 3) = "qr\") Or (mID(strRTF, l, 3) = "qr ")) Then
                                'qr = right justified
                                strAlign = "right"
                                'move "cursor" position to next rtf code
                                If (mID(strRTF, l + 2, 1) = " ") Then l = l + 2
                                l = l + 1
                            Else
                                gSkip = True
                            End If
                        Case "r"
                            If (mID(strRTF, l, 7) = "rquote ") Then
                                'reverse quote
                                strTmp = "'"
                                l = l + 6
                                gText = True
                            ElseIf (mID(strRTF, l, 10) = "rdblquote ") Then
                                'reverse doublequote
                                strTmp = """
                                l = l + 9
                                gText = True
                            Else
                                gSkip = True
                            End If
                        Case "s"
                            'strikethrough
                            If ((mID(strRTF, l, 7) = "strike\") Or (mID(strRTF, l, 7) = "strike ")) Then
                                strCurLine = strCurLine & "<STRIKE>"
                                strEOS = "</STRIKE>" & strEOS
                                l = l + 6
                            Else
                                gSkip = True
                            End If
                        Case "t"
                            If (mID(strRTF, l, 4) = "tab ") Then
                                strTmp = "&#9;"   'tab
                                l = l + 2
                                gText = True
                            Else
                                gSkip = True
                            End If
                        Case "u"
                            'underline
                            If ((mID(strRTF, l, 3) = "ul ") Or (mID(strRTF, l, 3) = "ul\")) Then
                                strCurLine = strCurLine & "<U>"
                                strEOS = "</U>" & strEOS
                                l = l + 1
                            Else
                                gSkip = True
                            End If
                        Case "'"
                            'special characters
                            strTmp2 = "{" & mID(strRTF, l + 1, 2) & "}"
                            lTmp = InStr(strCodes, strTmp2)
                            If lTmp = 0 Then
                                strTmp = Chr("&H" & mID(strTmp2, 2, 2))
                            Else
                                strTmp = Trim(mID(strCodes, lTmp - 8, 8))
                            End If
                            l = l + 1
                            gText = True
                        Case "~"
                            strTmp = " "
                            gText = True
                        Case "{", "}", "\"
                            gText = True
                        Case vbLf, vbCr, vbCrLf    'always use vbCrLf
                            strCurLine = strCurLine & vbCrLf
                        Case Else
                            gSkip = True
                    End Select
                    If gSkip = True Then
                        'skip everything up until the next space or "\" or "}"
                        While InStr(" \}", mID(strRTF, l, 1)) = 0
                            l = l + 1
                        Wend
                        gSkip = False
                        If (mID(strRTF, l, 1) = "\") Then l = l - 1
                    End If
                    l = l + 1
                Case vbLf, vbCr, vbCrLf
                    l = l + 1
                Case Else
                    gText = True
            End Select
            If gText Then
                If ((Len(strFontColor & strFontFace) > 0) And gSeekingText) Then
                    If Len(strAlign) > 0 Then
                        gAlign = True
                        If strAlign = "center" Then
                            strCurLine = strCurLine & "<TABLE ALIGN=""left"" CELLSPACING=0 CELLPADDING=0 WIDTH=""100%""><TR ALIGN=""center""><TD>"
                        ElseIf strAlign = "right" Then
                            strCurLine = strCurLine & "<TABLE ALIGN=""left"" CELLSPACING=0 CELLPADDING=0 WIDTH=""100%""><TR ALIGN=""right""><TD>"
                        End If
                        strAlign = ""
                    End If
                    If Len(strFontFace) > 0 Then
                        strFontCodes = strFontCodes & " FACE=" & strFontFace
                    End If
                    If Len(strFontColor) > 0 Then
                        strFontCodes = strFontCodes & " COLOR=" & strFontColor
                    End If
                    If Len(strCurFontSize) > 0 Then
                        strFontCodes = strFontCodes & " SIZE = " & lFontSize
                    End If
                    strCurLine = strCurLine & "<FONT" & strFontCodes & ">"
                    strFontCodes = ""
                End If
                strCurLine = strCurLine & strTmp
                l = l + 1
                gSeekingText = False
                gText = False
            End If
        Wend

        lBOS = lEOS + 2
        lEOS = InStr(lEOS + 1, strRTF, vbCrLf & "\par")
        strHTML = strHTML & strEOLL & strBOS & strBOL & strCurLine & vbCrLf
        strEOLL = strEOL
        If Len(strEOL) = 0 Then strEOL = "<BR>"

        If lEOS = 0 Then GoTo finally
        strBOS = ""
        strCurLine = ""
    Wend

finally:
    strHTML = strHTML & strEOS
    'clear up any hanging fonts
    If (Len(strFontColor & strFontFace) > 0) Then strHTML = strHTML & "</FONT>" & vbCrLf

    'Add Generator Metatag if requested
    If InStr(strOptions, "+G") <> 0 Then
        strGen = "<META NAME=""GENERATOR"" CONTENT=""RTF2HTML by Brady Hegberg"">"
    Else
        strGen = ""
    End If

    'Add Title if requested
    If InStr(strOptions, "+T") <> 0 Then
        lTmp = InStr(strOptions, "+T") + 3
        lTmp2 = InStr(lTmp + 1, strOptions, """")
        strTitle = mID(strOptions, lTmp, lTmp2 - lTmp)
    Else
        strTitle = ""
    End If

    'add header and footer if requested
    If InStr(strOptions, "+H") <> 0 Then strHTML = strHeader & vbCrLf _
            & strHTML _
            & strFooter
    RTF2HTML = strHTML
End Function



Salu2

#21
Aqui les dejo un regalito sobre OBDC de 32 bits

Son 2 partes




'' modulo
'' Parte I

#If Win32 Then
'
'|========================================================================|
'| ODBC Module Core Definitions                                           |
'|========================================================================|
'
'  ODBC Core API's Definitions -- 32 bit versions
'
Declare Function SQLAllocConnect Lib "odbc32.dll" (ByVal henv&, phdbc&) As Integer
Declare Function SQLAllocEnv Lib "odbc32.dll" (phenv&) As Integer
Declare Function SQLAllocStmt Lib "odbc32.dll" (ByVal hdbc&, phstmt&) As Integer
Declare Function SQLBindCol Lib "odbc32.dll" (ByVal hstmt&, ByVal icol%, ByVal fCType%, rgbValue As Any, ByVal cbValueMax&, pcbValue&) As Integer
Declare Function SQLCancel Lib "odbc32.dll" (ByVal hstmt&) As Integer

Declare Function SQLColAttributes Lib "odbc32.dll" (ByVal hstmt&, ByVal icol%, ByVal fDescType%, rgbDesc As Any, ByVal cbDescMax%, pcbDesc%, pfDesc&) As Integer
Declare Function SQLColAttributesString Lib "odbc32.dll" Alias "SQLColAttributes" (ByVal hstmt&, ByVal icol%, ByVal fDescType%, ByVal rgbDesc As String, ByVal cbDescMax%, pcbDesc%, pfDesc&) As Integer

Declare Function SQLConnect Lib "odbc32.dll" (ByVal hdbc&, ByVal szDSN$, ByVal cbDSN%, ByVal szUID$, ByVal cbUID%, ByVal szAuthStr$, ByVal cbAuthStr%) As Integer
Declare Function SQLDescribeCol Lib "odbc32.dll" (ByVal hstmt&, ByVal icol%, ByVal szColName$, ByVal cbColNameMax%, pcbColName%, pfSqlType%, pcbColDef&, pibScale%, pfNullable%) As Integer
Declare Function SQLDisconnect Lib "odbc32.dll" (ByVal hdbc&) As Integer
Declare Function SQLError Lib "odbc32.dll" (ByVal henv&, ByVal hdbc&, ByVal hstmt&, ByVal szSqlState$, pfNativeError&, ByVal szErrorMsg$, ByVal cbErrorMsgMax%, pcbErrorMsg%) As Integer
Declare Function SQLExecDirect Lib "odbc32.dll" (ByVal hstmt&, ByVal szSqlStr$, ByVal cbSqlStr&) As Integer
Declare Function SQLExecute Lib "odbc32.dll" (ByVal hstmt&) As Integer
Declare Function SQLFetch Lib "odbc32.dll" (ByVal hstmt&) As Integer
Declare Function SQLFreeConnect Lib "odbc32.dll" (ByVal hdbc&) As Integer
Declare Function SQLFreeEnv Lib "odbc32.dll" (ByVal henv&) As Integer
Declare Function SQLFreeStmt Lib "odbc32.dll" (ByVal hstmt&, ByVal fOption%) As Integer
Declare Function SQLGetCursorName Lib "odbc32.dll" (ByVal hstmt&, ByVal szCursor$, ByVal cbCursorMax%, pcbCursor%) As Integer
Declare Function SQLNumResultCols Lib "odbc32.dll" (ByVal hstmt&, pccol%) As Integer
Declare Function SQLPrepare Lib "odbc32.dll" (ByVal hstmt&, ByVal szSqlStr$, ByVal cbSqlStr&) As Integer
Declare Function SQLRowCount Lib "odbc32.dll" (ByVal hstmt&, pcrow&) As Integer
Declare Function SQLSetCursorName Lib "odbc32.dll" (ByVal hstmt&, ByVal szCursor$, ByVal cbCursor%) As Integer
Declare Function SQLSetParam Lib "odbc32.dll" (ByVal hstmt&, ByVal ipar%, ByVal fCType%, ByVal fSqlType%, ByVal cbColDef&, ByVal ibScale%, rgbValue As Any, pcbValue&) As Integer
Declare Function SQLTransact Lib "odbc32.dll" (ByVal henv&, ByVal hdbc&, ByVal fType%) As Integer
'
'|========================================================================|
'| ODBC Module Extended Definitions                                       |
'|========================================================================|
''  Level 1 Prototypes
'
Declare Function SQLBindParameter Lib "odbc32.dll" (ByVal hstmt&, ByVal ipar%, ByVal fParamType%, ByVal fCType%, ByVal fSqlType%, ByVal cbColDef&, ByVal ibScale%, rgbValue As Any, ByVal cbValueMax&, pcbValue As Long) As Integer
Declare Function SQLColumns Lib "odbc32.dll" (ByVal hstmt&, szTblQualifier As Any, ByVal cbTblQualifier%, szTblOwner As Any, ByVal cbTblOwner%, szTblName As Any, ByVal cbTblName%, szColName As Any, ByVal cbColName%) As Integer
Declare Function SQLDriverConnect Lib "odbc32.dll" (ByVal hdbc&, ByVal hWnd As Long, ByVal szCSIn$, ByVal cbCSIn%, ByVal szCSOut$, ByVal cbCSMax%, cbCSOut%, ByVal fDrvrComp%) As Integer

Declare Function SQLGetConnectOption Lib "odbc32.dll" (ByVal hdbc&, ByVal fOption%, ByRef pvParam As Any) As Integer
Declare Function SQLGetConnectOptionString Lib "odbc32.dll" Alias "SQLGetConnectOption" (ByVal hdbc&, ByVal fOption%, ByVal pvParam As String) As Integer

Declare Function SQLGetData Lib "odbc32.dll" (ByVal hstmt&, ByVal icol%, ByVal fCType%, ByVal rgbValue As String, ByVal cbValueMax&, pcbValue&) As Integer
Declare Function SQLGetNumericData Lib "odbc32.dll" Alias "SQLGetData" (ByVal hstmt&, ByVal icol%, ByVal fCType%, ByRef rgbValue As Any, ByVal cbValueMax&, pcbValue&) As Integer

Declare Function SQLGetFunctions Lib "odbc32.dll" (ByVal hdbc&, ByVal fFunction%, pfExists%) As Integer

Declare Function SQLGetInfo Lib "odbc32.dll" (ByVal hdbc&, ByVal fInfoType%, ByRef rgbInfoValue As Any, ByVal cbInfoMax%, cbInfoOut%) As Integer
Declare Function SQLGetInfoString Lib "odbc32.dll" Alias "SQLGetInfo" (ByVal hdbc&, ByVal fInfoType%, ByVal rgbInfoValue As String, ByVal cbInfoMax%, cbInfoOut%) As Integer

Declare Function SQLGetStmtOption Lib "odbc32.dll" (ByVal hstmt&, ByVal fOption%, ByRef pvParam As Any) As Integer
Declare Function SQLGetStmtOptionString Lib "odbc32.dll" Alias "SQLGetStmtOption" (ByVal hstmt&, ByVal fOption%, ByVal pvParam As String) As Integer

Declare Function SQLGetTypeInfo Lib "odbc32.dll" (ByVal hstmt&, ByVal fSqlType%) As Integer
Declare Function SQLParamData Lib "odbc32.dll" (ByVal hstmt&, prgbValue As Any) As Integer
Declare Function SQLPutData Lib "odbc32.dll" (ByVal hstmt&, rgbValue As Any, ByVal cbValue&) As Integer
Declare Function SQLSetConnectOption Lib "odbc32.dll" (ByVal hdbc&, ByVal fOption%, ByVal vParam As Any) As Integer
Declare Function SQLSetConnectStringOption Lib "odbc32.dll" Alias "SQLSetConnectOption" (ByVal hdbc&, ByVal fOption%, vParam$) As Integer

Declare Function SQLSetStmtOption Lib "odbc32.dll" (ByVal hstmt&, ByVal fOption%, ByVal vParam&) As Integer
Declare Function SQLSpecialColumns Lib "odbc32.dll" (ByVal hstmt&, ByVal fColType%, szTblQualifier As Any, ByVal cbTblQualifier%, szTblOwner As Any, ByVal cbTblOwner%, szTblName As Any, ByVal cbTblName%, ByVal fScope%, ByVal fNullable%) As Integer
Declare Function SQLStatistics Lib "odbc32.dll" (ByVal hstmt&, szTblQualifier As Any, ByVal cbTblQualifier%, szTblOwner As Any, ByVal cbTblOwner%, szTblName As Any, ByVal cbTblName%, ByVal fUnique%, ByVal fAccuracy%) As Integer
Declare Function SQLTables Lib "odbc32.dll" (ByVal hstmt&, szTblQualifier As Any, ByVal cbTblQualifier%, szTblOwner As Any, ByVal cbTblOwner%, szTblName As Any, ByVal cbTblName%, szTblType As Any, ByVal cbTblType%) As Integer

'  Level 2 Prototypes

Declare Function SQLBrowseConnect Lib "odbc32.dll" (ByVal hdbc&, ByVal szConnStrIn$, ByVal cbConnStrIn%, ByVal szConnStrOut$, ByVal cbConnStrOutMax%, pcbConnStrOut%) As Integer
Declare Function SQLColumnPrivileges Lib "odbc32.dll" (ByVal hstmt&, szTQf As Any, ByVal cbTQf%, szTOwn As Any, ByVal cbTOwn%, szTName As Any, ByVal cbTName%, szColName As Any, ByVal cbColName%) As Integer
Declare Function SQLDrivers Lib "odbc32.dll" (ByVal henv&, ByVal fDirection%, ByVal szDriverDesc$, ByVal cbDriverDescMax%, pcbDriverDesc%, ByVal szDriverAttr$, ByVal cbDrvrAttrMax%, pcbDrvrAttr%) As Integer
Declare Function SQLDataSources Lib "odbc32.dll" (ByVal henv&, ByVal fDirection%, ByVal szDSN$, ByVal cbDSNMax%, pcbDSN%, ByVal szDescription$, ByVal cbDescriptionMax%, pcbDescription%) As Integer
Declare Function SQLDescribeParam Lib "odbc32.dll" (ByVal hstmt&, ByVal ipar%, pfSqlType%, pcbColDef&, pibScale%, pfNullable%) As Integer
Declare Function SQLExtendedFetch Lib "odbc32.dll" (ByVal hstmt&, ByVal fFetchType%, ByVal irow&, pcrow&, rgfRowStatus%) As Integer
Declare Function SQLForeignKeys Lib "odbc32.dll" (ByVal hstmt&, ByVal PTQual&, ByVal PTQual%, ByVal PTOwnr&, ByVal PTOwnr%, ByVal PTName&, ByVal PTName%, ByVal FTQual&, ByVal FTQf%, ByVal FTOwnr&, ByVal FTOwnr%, ByVal FTName&, ByVal FTName%) As Integer
Declare Function SQLMoreResults Lib "odbc32.dll" (ByVal hstmt&) As Integer
Declare Function SQLNativeSql Lib "odbc32.dll" (ByVal hdbc&, ByVal szSqlStrIn$, ByVal cbSqlStrIn&, ByVal szSqlStr$, ByVal cbSqlStrMax&, pcbSqlStr&) As Integer
Declare Function SQLNumParams Lib "odbc32.dll" (ByVal hstmt&, pcpar%) As Integer
Declare Function SQLParamOptions Lib "odbc32.dll" (ByVal hstmt&, ByVal crow%, pirow&) As Integer
Declare Function SQLPrimaryKeys Lib "odbc32.dll" (ByVal hstmt&, szTblQualifier As Any, ByVal cbTblQualifier%, szTblOwner As Any, ByVal cbTblOwner%, szTblName As Any, ByVal cbTblName%) As Integer
Declare Function SQLProcedureColumns Lib "odbc32.dll" (ByVal hstmt&, szProcQualifier As Any, ByVal cbProcQualifier%, szProcOwner As Any, ByVal cbProcOwner%, szProcName As Any, ByVal cbProcName%, szColName As Any, ByVal cbColName%) As Integer
Declare Function SQLProcedures Lib "odbc32.dll" (ByVal hstmt&, szProcQualifier As Any, ByVal cbProcQualifier%, szProcOwner As Any, ByVal cbProcOwner%, szProcName As Any, ByVal cbProcName%) As Integer
Declare Function SQLSetPos Lib "odbc32.dll" (ByVal hstmt&, ByVal irow%, ByVal fOption%, ByVal fLock%) As Integer
Declare Function SQLSetScrollOptions Lib "odbc32.dll" (ByVal hstmt&, ByVal fConcurrency%, ByVal crowKeyset&, ByVal crowRowset%) As Integer
Declare Function SQLTablePrivileges Lib "odbc32.dll" (ByVal hstmt&, szTblQualifier As Any, ByVal cbTblQualifier%, szTblOwner As Any, ByVal cbTblOwner%, szTblName As Any, ByVal cbTblName%) As Integer

  32 Bit declares
'  ODBC Constants/Types

'  generally useful constants

Global Const SQL_NTS As Long = -3                  '  NTS = Null Terminated String
Global Const SQL_SQLSTATE_SIZE As Long = 5         '  size of SQLSTATE
Global Const SQL_MAX_MESSAGE_LENGTH As Long = 512  '  message buffer size
Global Const SQL_MAX_DSN_LENGTH As Long = 32       '  maximum data source name size

'  RETCODEs

Global Const SQL_ERROR As Long = -1
Global Const SQL_INVALID_HANDLE As Long = -2
Global Const SQL_NO_DATA_FOUND As Long = 100
Global Const SQL_SUCCESS As Long = 0
Global Const SQL_SUCCESS_WITH_INFO As Long = 1

'  SQLFreeStmt defines

Global Const SQL_CLOSE As Long = 0
Global Const SQL_DROP As Long = 1
Global Const SQL_UNBIND As Long = 2
Global Const SQL_RESET_PARAMS As Long = 3

'  SQLSetParam defines

Global Const SQL_C_DEFAULT As Long = 99

'  SQLTransact defines

Global Const SQL_COMMIT As Long = 0
Global Const SQL_ROLLBACK As Long = 1

'  Standard SQL datatypes, using ANSI type numbering

Global Const SQL_CHAR As Long = 1
Global Const SQL_NUMERIC As Long = 2
Global Const SQL_DECIMAL As Long = 3
Global Const SQL_INTEGER As Long = 4
Global Const SQL_SMALLINT As Long = 5
Global Const SQL_FLOAT As Long = 6
Global Const SQL_REAL As Long = 7
Global Const SQL_DOUBLE As Long = 8
Global Const SQL_VARCHAR As Long = 12
Global Const SQL_TYPE_MIN As Long = 1
Global Const SQL_TYPE_NULL As Long = 0
Global Const SQL_TYPE_MAX As Long = 12

'  C datatype to SQL datatype mapping    SQL types

Global Const SQL_C_CHAR As Long = SQL_CHAR         '  CHAR, VARCHAR, DECIMAL, NUMERIC
Global Const SQL_C_LONG As Long = SQL_INTEGER      '  INTEGER
Global Const SQL_C_SHORT As Long = SQL_SMALLINT    '  SMALLINT
Global Const SQL_C_FLOAT As Long = SQL_REAL        '  REAL
Global Const SQL_C_DOUBLE As Long = SQL_DOUBLE     '  FLOAT, DOUBLE

'  NULL status constants.  These are used in SQLColumns, SQLColAttributes,
'  SQLDescribeCol, and SQLSpecialColumns to describe the nullablity of a
'  column in a table.  SQL_NULLABLE_UNKNOWN can be returned only by
'  SQLDescribeCol or SQLColAttributes.  It is used when the DBMS's meta-data
'  does not contain this info.
'
Global Const SQL_NO_NULLS As Long = 0
Global Const SQL_NULLABLE As Long = 1
Global Const SQL_NULLABLE_UNKNOWN As Long = 2

'  Special length values

Global Const SQL_NULL_DATA As Long = -1
Global Const SQL_DATA_AT_EXEC As Long = -2

'  SQLColAttributes defines

Global Const SQL_COLUMN_COUNT As Long = 0
Global Const SQL_COLUMN_NAME As Long = 1
Global Const SQL_COLUMN_TYPE As Long = 2
Global Const SQL_COLUMN_LENGTH As Long = 3
Global Const SQL_COLUMN_PRECISION As Long = 4
Global Const SQL_COLUMN_SCALE As Long = 5
Global Const SQL_COLUMN_DISPLAY_SIZE As Long = 6
Global Const SQL_COLUMN_NULLABLE As Long = 7
Global Const SQL_COLUMN_UNSIGNED As Long = 8
Global Const SQL_COLUMN_MONEY As Long = 9
Global Const SQL_COLUMN_UPDATABLE As Long = 10
Global Const SQL_COLUMN_AUTO_INCREMENT As Long = 11
Global Const SQL_COLUMN_CASE_SENSITIVE As Long = 12
Global Const SQL_COLUMN_SEARCHABLE As Long = 13
Global Const SQL_COLUMN_TYPE_NAME As Long = 14
Global Const SQL_COLUMN_TABLE_NAME As Long = 15
Global Const SQL_COLUMN_OWNER_NAME As Long = 16
Global Const SQL_COLUMN_QUALIFIER_NAME As Long = 17
Global Const SQL_COLUMN_LABEL As Long = 18
Global Const SQL_COLATT_OPT_MAX As Long = SQL_COLUMN_LABEL

'  SQLColAttributes subdefines for SQL_COLUMN_UPDATABLE

Global Const SQL_ATTR_READONLY As Long = 0
Global Const SQL_ATTR_WRITE As Long = 1
Global Const SQL_ATTR_READWRITE_UNKNOWN As Long = 2

'  SQLColAttributes subdefines for SQL_COLUMN_SEARCHABLE
'  These are also used by SQLGetInfo

Global Const SQL_UNSEARCHABLE As Long = 0
Global Const SQL_LIKE_ONLY As Long = 1
Global Const SQL_ALL_EXCEPT_LIKE As Long = 2
Global Const SQL_SEARCHABLE As Long = 3

'  SQLError defines

Global Const SQL_NULL_HENV As Long = 0
Global Const SQL_NULL_HDBC As Long = 0
Global Const SQL_NULL_HSTMT As Long = 0

'|========================================================================|
'| ODBC Global Extended Definitions                                       |
'|========================================================================|

' Level 1 Definitions/Functions
' Generally useful constants

Global Const SQL_MAX_OPTION_STRING_LENGTH = 256

' Additional return codes

Global Const SQL_STILL_EXECUTING As Long = 2
Global Const SQL_NEED_DATA As Long = 99

' SQL extended datatypes

Global Const SQL_DATE As Long = 9
Global Const SQL_TIME As Long = 10
Global Const SQL_TIMESTAMP As Long = 11
Global Const SQL_LONGVARCHAR As Long = -1
Global Const SQL_BINARY As Long = -2
Global Const SQL_VARBINARY As Long = -3
Global Const SQL_LONGVARBINARY As Long = -4
Global Const SQL_BIGINT As Long = -5
Global Const SQL_TINYINT As Long = -6
Global Const SQL_BIT As Long = -7
Global Const SQL_TYPE_DRIVER_START As Long = -80

' C datatype to SQL datatype mapping

Global Const SQL_SIGNED_OFFSET As Long = -20
Global Const SQL_UNSIGNED_OFFSET As Long = -22
Global Const SQL_C_DATE As Long = SQL_DATE
Global Const SQL_C_TIME As Long = SQL_TIME
Global Const SQL_C_TIMESTAMP As Long = SQL_TIMESTAMP
Global Const SQL_C_BINARY As Long = SQL_BINARY
Global Const SQL_C_BIT As Long = SQL_BIT
Global Const SQL_C_TINYINT As Long = SQL_TINYINT
Global Const SQL_C_SLONG As Long = SQL_C_LONG + SQL_SIGNED_OFFSET
Global Const SQL_C_SSHORT As Long = SQL_C_SHORT + SQL_SIGNED_OFFSET
Global Const SQL_C_STINYINT As Long = SQL_TINYINT + SQL_SIGNED_OFFSET
Global Const SQL_C_ULONG As Long = SQL_C_LONG + SQL_UNSIGNED_OFFSET
Global Const SQL_C_USHORT As Long = SQL_C_SHORT + SQL_UNSIGNED_OFFSET
Global Const SQL_C_UTINYINT As Long = SQL_TINYINT + SQL_UNSIGNED_OFFSET
Global Const SQL_C_BOOKMARK As Long = SQL_C_ULONG
Global Const SQL_ALL_TYPES As Long = 0

'  Date/Time/Timestamp Structs

Type DATE_STRUCT
  year      As Integer
  month     As Integer
  day       As Integer
End Type

Type TIME_STRUCT
  hour      As Integer
  minute    As Integer
  second    As Integer
End Type

Type TIMESTAMP_STRUCT
  year      As Integer
  month     As Integer
  day       As Integer
  hour      As Integer
  minute    As Integer
  second    As Integer
  fraction  As Long
End Type

' Options for SQLDriverConnect

Global Const SQL_DRIVER_NOPROMPT As Long = 0
Global Const SQL_DRIVER_COMPLETE As Long = 1
Global Const SQL_DRIVER_PROMPT As Long = 2
Global Const SQL_DRIVER_COMPLETE_REQUIRED As Long = 3

' Special return values for SQLGetData

Global Const SQL_NO_TOTAL As Long = -4

' SQLSetParam extensions

Global Const SQL_DEFAULT_PARAM As Long = -5
Global Const SQL_IGNORE As Long = -6
Global Const SQL_LEN_DATA_AT_EXEC_OFFSET As Long = -100

' Defines for SQLGetFunctions
' Core Functions

Global Const SQL_API_SQLALLOCCONNECT As Long = 1
Global Const SQL_API_SQLALLOCENV As Long = 2
Global Const SQL_API_SQLALLOCSTMT As Long = 3
Global Const SQL_API_SQLBINDCOL As Long = 4
Global Const SQL_API_SQLCANCEL As Long = 5
Global Const SQL_API_SQLCOLATTRIBUTES As Long = 6
Global Const SQL_API_SQLCONNECT As Long = 7
Global Const SQL_API_SQLDESCRIBECOL As Long = 8
Global Const SQL_API_SQLDISCONNECT As Long = 9
Global Const SQL_API_SQLERROR As Long = 10
Global Const SQL_API_SQLEXECDIRECT As Long = 11
Global Const SQL_API_SQLEXECUTE As Long = 12
Global Const SQL_API_SQLFETCH As Long = 13
Global Const SQL_API_SQLFREECONNECT As Long = 14
Global Const SQL_API_SQLFREEENV As Long = 15
Global Const SQL_API_SQLFREESTMT As Long = 16
Global Const SQL_API_SQLGETCURSORNAME As Long = 17
Global Const SQL_API_SQLNUMRESULTCOLS As Long = 18
Global Const SQL_API_SQLPREPARE As Long = 19
Global Const SQL_API_SQLROWCOUNT As Long = 20
Global Const SQL_API_SQLSETCURSORNAME As Long = 21
Global Const SQL_API_SQLSETPARAM As Long = 22
Global Const SQL_API_SQLTRANSACT As Long = 23
Global Const SQL_NUM_FUNCTIONS As Long = 23
Global Const SQL_EXT_API_START As Long = 40

' Level 1 Functions

Global Const SQL_API_SQLCOLUMNS As Long = 40
Global Const SQL_API_SQLDRIVERCONNECT As Long = 41
Global Const SQL_API_SQLGETCONNECTOPTION As Long = 42
Global Const SQL_API_SQLGETDATA As Long = 43
Global Const SQL_API_SQLGETFUNCTIONS As Long = 44
Global Const SQL_API_SQLGETINFO As Long = 45
Global Const SQL_API_SQLGETSTMTOPTION As Long = 46
Global Const SQL_API_SQLGETTYPEINFO As Long = 47
Global Const SQL_API_SQLPARAMDATA As Long = 48
Global Const SQL_API_SQLPUTDATA As Long = 49
Global Const SQL_API_SQLSETCONNECTOPTION As Long = 50
Global Const SQL_API_SQLSETSTMTOPTION As Long = 51
Global Const SQL_API_SQLSPECIALCOLUMNS As Long = 52
Global Const SQL_API_SQLSTATISTICS As Long = 53
Global Const SQL_API_SQLTABLES As Long = 54

' Level 2 Functions

Global Const SQL_API_SQLBROWSECONNECT As Long = 55
Global Const SQL_API_SQLCOLUMNPRIVILEGES As Long = 56
Global Const SQL_API_SQLDATASOURCES As Long = 57
Global Const SQL_API_SQLDESCRIBEPARAM As Long = 58
Global Const SQL_API_SQLEXTENDEDFETCH As Long = 59
Global Const SQL_API_SQLFOREIGNKEYS As Long = 60
Global Const SQL_API_SQLMORERESULTS As Long = 61
Global Const SQL_API_SQLNATIVESQL As Long = 62
Global Const SQL_API_SQLNUMPARAMS As Long = 63
Global Const SQL_API_SQLPARAMOPTIONS As Long = 64
Global Const SQL_API_SQLPRIMARYKEYS As Long = 65
Global Const SQL_API_SQLPROCEDURECOLUMNS As Long = 66
Global Const SQL_API_SQLPROCEDURES As Long = 67
Global Const SQL_API_SQLSETPOS As Long = 68
Global Const SQL_API_SQLSETSCROLLOPTIONS As Long = 69
Global Const SQL_API_SQLTABLEPRIVILEGES As Long = 70
Global Const SQL_API_SQLDRIVERS As Long = 71
Global Const SQL_API_SQLBINDPARAMETER As Long = 72
Global Const SQL_EXT_API_LAST As Long = 72
Global Const SQL_API_ALL_FUNCTIONS As Long = 0
Global Const SQL_NUM_EXTENSIONS As Long = (SQL_EXT_API_LAST - SQL_EXT_API_START + 1)

' Defines for SQLGetInfo

Global Const SQL_INFO_FIRST As Long = 0
Global Const SQL_ACTIVE_CONNECTIONS As Long = 0
Global Const SQL_ACTIVE_STATEMENTS As Long = 1
Global Const SQL_DATA_SOURCE_NAME As Long = 2
Global Const SQL_DRIVER_HDBC As Long = 3
Global Const SQL_DRIVER_HENV As Long = 4
Global Const SQL_DRIVER_HSTMT As Long = 5
Global Const SQL_DRIVER_NAME As Long = 6
Global Const SQL_DRIVER_VER As Long = 7
Global Const SQL_FETCH_DIRECTION As Long = 8
Global Const SQL_ODBC_API_CONFORMANCE As Long = 9
Global Const SQL_ODBC_VER As Long = 10
Global Const SQL_ROW_UPDATES As Long = 11
Global Const SQL_ODBC_SAG_CLI_CONFORMANCE As Long = 12
Global Const SQL_SERVER_NAME As Long = 13
Global Const SQL_SEARCH_PATTERN_ESCAPE As Long = 14
Global Const SQL_ODBC_SQL_CONFORMANCE As Long = 15
Global Const SQL_DBMS_NAME As Long = 17
Global Const SQL_DBMS_VER As Long = 18
Global Const SQL_ACCESSIBLE_TABLES As Long = 19
Global Const SQL_ACCESSIBLE_PROCEDURES As Long = 20
Global Const SQL_PROCEDURES As Long = 21
Global Const SQL_CONCAT_NULL_BEHAVIOR As Long = 22
Global Const SQL_CURSOR_COMMIT_BEHAVIOR As Long = 23
Global Const SQL_CURSOR_ROLLBACK_BEHAVIOR As Long = 24
Global Const SQL_DATA_SOURCE_READ_ONLY As Long = 25
Global Const SQL_DEFAULT_TXN_ISOLATION As Long = 26
Global Const SQL_EXPRESSIONS_IN_ORDERBY As Long = 27
Global Const SQL_IDENTIFIER_CASE As Long = 28
Global Const SQL_IDENTIFIER_QUOTE_CHAR As Long = 29
Global Const SQL_MAX_COLUMN_NAME_LEN As Long = 30
Global Const SQL_MAX_CURSOR_NAME_LEN As Long = 31
Global Const SQL_MAX_OWNER_NAME_LEN As Long = 32
Global Const SQL_MAX_PROCEDURE_NAME_LEN As Long = 33
Global Const SQL_MAX_QUALIFIER_NAME_LEN As Long = 34
Global Const SQL_MAX_TABLE_NAME_LEN As Long = 35
Global Const SQL_MULT_RESULT_SETS As Long = 36
Global Const SQL_MULTIPLE_ACTIVE_TXN As Long = 37
Global Const SQL_OUTER_JOINS As Long = 38
Global Const SQL_OWNER_TERM As Long = 39
Global Const SQL_PROCEDURE_TERM As Long = 40
Global Const SQL_QUALIFIER_NAME_SEPARATOR As Long = 41
Global Const SQL_QUALIFIER_TERM As Long = 42
Global Const SQL_SCROLL_CONCURRENCY As Long = 43
Global Const SQL_SCROLL_OPTIONS As Long = 44
Global Const SQL_TABLE_TERM As Long = 45
Global Const SQL_TXN_CAPABLE As Long = 46
Global Const SQL_USER_NAME As Long = 47
Global Const SQL_CONVERT_FUNCTIONS As Long = 48
Global Const SQL_NUMERIC_FUNCTIONS As Long = 49
Global Const SQL_STRING_FUNCTIONS As Long = 50
Global Const SQL_SYSTEM_FUNCTIONS As Long = 51
Global Const SQL_TIMEDATE_FUNCTIONS As Long = 52
Global Const SQL_CONVERT_BIGINT As Long = 53
Global Const SQL_CONVERT_BINARY As Long = 54
Global Const SQL_CONVERT_BIT As Long = 55
Global Const SQL_CONVERT_CHAR As Long = 56
Global Const SQL_CONVERT_DATE As Long = 57
Global Const SQL_CONVERT_DECIMAL As Long = 58
Global Const SQL_CONVERT_DOUBLE As Long = 59
Global Const SQL_CONVERT_FLOAT As Long = 60
Global Const SQL_CONVERT_INTEGER As Long = 61
Global Const SQL_CONVERT_LONGVARCHAR As Long = 62
Global Const SQL_CONVERT_NUMERIC As Long = 63
Global Const SQL_CONVERT_REAL As Long = 64
Global Const SQL_CONVERT_SMALLINT As Long = 65
Global Const SQL_CONVERT_TIME As Long = 66
Global Const SQL_CONVERT_TIMESTAMP As Long = 67
Global Const SQL_CONVERT_TINYINT As Long = 68
Global Const SQL_CONVERT_VARBINARY As Long = 69
Global Const SQL_CONVERT_VARCHAR As Long = 70
Global Const SQL_CONVERT_LONGVARBINARY As Long = 71
Global Const SQL_TXN_ISOLATION_OPTION As Long = 72
Global Const SQL_ODBC_SQL_OPT_IEF As Long = 73
Global Const SQL_CORRELATION_NAME As Long = 74
Global Const SQL_NON_NULLABLE_COLUMNS As Long = 75
Global Const SQL_DRIVER_HLIB As Long = 76
Global Const SQL_DRIVER_ODBC_VER As Long = 77
Global Const SQL_LOCK_TYPES As Long = 78
Global Const SQL_POS_OPERATIONS As Long = 79
Global Const SQL_POSITIONED_STATEMENTS As Long = 80
Global Const SQL_GETDATA_EXTENSIONS As Long = 81
Global Const SQL_BOOKMARK_PERSISTENCE As Long = 82
Global Const SQL_STATIC_SENSITIVITY As Long = 83
Global Const SQL_FILE_USAGE As Long = 84
Global Const SQL_NULL_COLLATION As Long = 85
Global Const SQL_ALTER_TABLE As Long = 86
Global Const SQL_COLUMN_ALIAS As Long = 87
Global Const SQL_GROUP_BY As Long = 88
Global Const SQL_KEYWORDS As Long = 89
Global Const SQL_ORDER_BY_COLUMNS_IN_SELECT As Long = 90
Global Const SQL_OWNER_USAGE As Long = 91
Global Const SQL_QUALIFIER_USAGE As Long = 92
Global Const SQL_QUOTED_IDENTIFIER_CASE As Long = 93
Global Const SQL_SPECIAL_CHARACTERS As Long = 94
Global Const SQL_SUBQUERIES As Long = 95
Global Const SQL_UNION As Long = 96
Global Const SQL_MAX_COLUMNS_IN_GROUP_BY As Long = 97
Global Const SQL_MAX_COLUMNS_IN_INDEX As Long = 98
Global Const SQL_MAX_COLUMNS_IN_ORDER_BY As Long = 99
Global Const SQL_MAX_COLUMNS_IN_SELECT As Long = 100
Global Const SQL_MAX_COLUMNS_IN_TABLE As Long = 101
Global Const SQL_MAX_INDEX_SIZE As Long = 102
Global Const SQL_MAX_ROW_SIZE_INCLUDES_LONG As Long = 103
Global Const SQL_MAX_ROW_SIZE As Long = 104
Global Const SQL_MAX_STATEMENT_LEN As Long = 105
Global Const SQL_MAX_TABLES_IN_SELECT As Long = 106
Global Const SQL_MAX_USER_NAME_LEN As Long = 107
Global Const SQL_MAX_CHAR_LITERAL_LEN As Long = 108
Global Const SQL_TIMEDATE_ADD_INTERVALS As Long = 109
Global Const SQL_TIMEDATE_DIFF_INTERVALS As Long = 110
Global Const SQL_NEED_LONG_DATA_LEN As Long = 111
Global Const SQL_MAX_BINARY_LITERAL_LEN As Long = 112
Global Const SQL_LIKE_ESCAPE_CLAUSE As Long = 113
Global Const SQL_QUALIFIER_LOCATION As Long = 114
Global Const SQL_INFO_LAST As Long = SQL_QUALIFIER_LOCATION
Global Const SQL_INFO_DRIVER_START As Long = 1000

' "SQL_CONVERT_" return value bitmasks

Global Const SQL_CVT_CHAR As Long = &H1&
Global Const SQL_CVT_NUMERIC As Long = &H2&
Global Const SQL_CVT_DECIMAL As Long = &H4&
Global Const SQL_CVT_INTEGER As Long = &H8&
Global Const SQL_CVT_SMALLINT As Long = &H10&
Global Const SQL_CVT_FLOAT As Long = &H20&
Global Const SQL_CVT_REAL As Long = &H40&
Global Const SQL_CVT_DOUBLE As Long = &H80&
Global Const SQL_CVT_VARCHAR As Long = &H100&
Global Const SQL_CVT_LONGVARCHAR As Long = &H200&
Global Const SQL_CVT_BINARY As Long = &H400&
Global Const SQL_CVT_VARBINARY As Long = &H800&
Global Const SQL_CVT_BIT As Long = &H1000&
Global Const SQL_CVT_TINYINT As Long = &H2000&
Global Const SQL_CVT_BIGINT As Long = &H4000&
Global Const SQL_CVT_DATE As Long = &H8000&
Global Const SQL_CVT_TIME As Long = &H10000
Global Const SQL_CVT_TIMESTAMP As Long = &H20000
Global Const SQL_CVT_LONGVARBINARY As Long = &H40000

' Conversion functions

Global Const SQL_FN_CVT_CONVERT As Long = &H1&

' String functions

Global Const SQL_FN_STR_CONCAT As Long = &H1&
Global Const SQL_FN_STR_INSERT As Long = &H2&
Global Const SQL_FN_STR_LEFT As Long = &H4&
Global Const SQL_FN_STR_LTRIM As Long = &H8&
Global Const SQL_FN_STR_LENGTH As Long = &H10&
Global Const SQL_FN_STR_LOCATE As Long = &H20&
Global Const SQL_FN_STR_LCASE As Long = &H40&
Global Const SQL_FN_STR_REPEAT As Long = &H80&
Global Const SQL_FN_STR_REPLACE As Long = &H100&
Global Const SQL_FN_STR_RIGHT As Long = &H200&
Global Const SQL_FN_STR_RTRIM As Long = &H400&
Global Const SQL_FN_STR_SUBSTRING As Long = &H800&
Global Const SQL_FN_STR_UCASE As Long = &H1000&
Global Const SQL_FN_STR_ASCII As Long = &H2000&
Global Const SQL_FN_STR_CHAR As Long = &H4000&
Global Const SQL_FN_STR_DIFFERENCE As Long = &H8000&
Global Const SQL_FN_STR_LOCATE_2 As Long = &H10000
Global Const SQL_FN_STR_SOUNDEX As Long = &H20000
Global Const SQL_FN_STR_SPACE As Long = &H40000

' Numeric functions

Global Const SQL_FN_NUM_ABS As Long = &H1&
Global Const SQL_FN_NUM_ACOS As Long = &H2&
Global Const SQL_FN_NUM_ASIN As Long = &H4&
Global Const SQL_FN_NUM_ATAN As Long = &H8&
Global Const SQL_FN_NUM_ATAN2 As Long = &H10&
Global Const SQL_FN_NUM_CEILING As Long = &H20&
Global Const SQL_FN_NUM_COS As Long = &H40&
Global Const SQL_FN_NUM_COT As Long = &H80&
Global Const SQL_FN_NUM_EXP As Long = &H100&
Global Const SQL_FN_NUM_FLOOR As Long = &H200&
Global Const SQL_FN_NUM_LOG As Long = &H400&
Global Const SQL_FN_NUM_MOD As Long = &H800&
Global Const SQL_FN_NUM_SIGN As Long = &H1000&
Global Const SQL_FN_NUM_SIN As Long = &H2000&
Global Const SQL_FN_NUM_SQRT As Long = &H4000&
Global Const SQL_FN_NUM_TAN As Long = &H8000&
Global Const SQL_FN_NUM_PI As Long = &H10000
Global Const SQL_FN_NUM_RAND As Long = &H20000
Global Const SQL_FN_NUM_DEGREES As Long = &H40000
Global Const SQL_FN_NUM_LOG10 As Long = &H80000
Global Const SQL_FN_NUM_POWER As Long = &H100000
Global Const SQL_FN_NUM_RADIANS As Long = &H200000
Global Const SQL_FN_NUM_ROUND As Long = &H400000
Global Const SQL_FN_NUM_TRUNCATE As Long = &H800000

' Time/date functions

Global Const SQL_FN_TD_NOW As Long = &H1&
Global Const SQL_FN_TD_CURDATE As Long = &H2&
Global Const SQL_FN_TD_DAYOFMONTH As Long = &H4&
Global Const SQL_FN_TD_DAYOFWEEK As Long = &H8&
Global Const SQL_FN_TD_DAYOFYEAR As Long = &H10&
Global Const SQL_FN_TD_MONTH As Long = &H20&
Global Const SQL_FN_TD_QUARTER As Long = &H40&
Global Const SQL_FN_TD_WEEK As Long = &H80&
Global Const SQL_FN_TD_YEAR As Long = &H100&
Global Const SQL_FN_TD_CURTIME As Long = &H200&
Global Const SQL_FN_TD_HOUR As Long = &H400&
Global Const SQL_FN_TD_MINUTE As Long = &H800&
Global Const SQL_FN_TD_SECOND As Long = &H1000&
Global Const SQL_FN_TD_TIMESTAMPADD As Long = &H2000&
Global Const SQL_FN_TD_TIMESTAMPDIFF As Long = &H4000&
Global Const SQL_FN_TD_DAYNAME As Long = &H8000&
Global Const SQL_FN_TD_MONTHNAME As Long = &H10000

' System functions

Global Const SQL_FN_SYS_USERNAME As Long = &H1&
Global Const SQL_FN_SYS_DBNAME As Long = &H2&
Global Const SQL_FN_SYS_IFNULL As Long = &H4&

' Timedate intervals

Global Const SQL_FN_TSI_FRAC_SECOND As Long = &H1&
Global Const SQL_FN_TSI_SECOND As Long = &H2&
Global Const SQL_FN_TSI_MINUTE As Long = &H4&
Global Const SQL_FN_TSI_HOUR As Long = &H8&
Global Const SQL_FN_TSI_DAY As Long = &H10&
Global Const SQL_FN_TSI_WEEK As Long = &H20&
Global Const SQL_FN_TSI_MONTH As Long = &H40&
Global Const SQL_FN_TSI_QUARTER As Long = &H80&
Global Const SQL_FN_TSI_YEAR As Long = &H100&

' ODBC API conformance

Global Const SQL_OAC_NONE As Long = 0
Global Const SQL_OAC_LEVEL1 As Long = 1
Global Const SQL_OAC_LEVEL2 As Long = 2

' SAG CLI conformance

Global Const SQL_OSCC_NOT_COMPLIANT As Long = 0
Global Const SQL_OSCC_COMPLIANT As Long = 1

' ODBC SQL conformance

Global Const SQL_OSC_MINIMUM As Long = 0
Global Const SQL_OSC_CORE As Long = 1
Global Const SQL_OSC_EXTENDED As Long = 2

' Concatenation behavior

Global Const SQL_CB_NULL As Long = 0
Global Const SQL_CB_NON_NULL As Long = 1

' Cursor commit behavior

Global Const SQL_CB_DELETE As Long = 0
Global Const SQL_CB_CLOSE As Long = 1
Global Const SQL_CB_PRESERVE As Long = 2

' Identifier case

Global Const SQL_IC_UPPER As Long = 1
Global Const SQL_IC_LOWER As Long = 2
Global Const SQL_IC_SENSITIVE As Long = 3
Global Const SQL_IC_MIXED As Long = 4

' Transaction capable

Global Const SQL_TC_NONE As Long = 0
Global Const SQL_TC_DML As Long = 1
Global Const SQL_TC_ALL As Long = 2
Global Const SQL_TC_DDL_COMMIT As Long = 3
Global Const SQL_TC_DDL_IGNORE As Long = 4
#22
Hola a todos.

Es posible programar una aplicacion en VB en modo Kernel ?

Es decir, que se ancle a él no programarla como servicio

Gracias
#23

Hola a todos.

Veran, intento averiguar como ejecutar 1 linea de codigo almacenada en 1 string.

Les explico:

Supongamos que la constante A es 1 string y contiene

Me.show

como podria hacer que se ejecutara esa orden ?

Estoy buscando a ver si encuentro algun metodo o API que me permita hacerlo, pero por ahora en VB no se hacerlo.

No me vale un if y then ejecutar orden.

No se si la funcion ExecuteLine vale en VB y tampoco se
como se declara.

Estoy buscando.

Podria alguien hecharme 1 mano ?





#24
Hola a todos.

Mi duda es la siguiente:

Cómo puedo pasarle parámetros a 1 ejecutable en VB ?

Es decir, si mi programa se llama ex.exe que al llamar al programa asi: ex.exe /s ejecute una rutina.

Gracias
#25
Hola a todos.

Veran, resulta que le he agregado 1 fichero de recursos a mi proyecto.

El fichero de recursos contiene 1 TXT y 1 ZIP y para poder extraerlos tengo copiarlos a una matriz byte y de ahi a 1 fichero.

Si no los copio a la matriz byte, los ficheros me dan error.

Es posible que me ahorre el copiarlos a la matriz byte ?

Gracias
#26
Hola a todos.

Veran, los programas compilados en VB6 dependen de msvbvm6.dll y oleaut32.dll y los controles OCX que tengan asociados.

Mi duda es si hay forma de hacer que no dependan de estas librerias, porque aunque no pongas ningun OCX personalizado, tienen que estar presentes ambas DLL's en el sistema.

Lo que se me ocurrio, fue comprimir ambas librerias junto con el ejecutable pero ocupa bastante espacio.

Sabe alguien alguna otra forma de eliminar las dependencias ??


Gracias


#27
Hola a todos.

Tengo 1 problema al conectar varias aplicaciones con el control winsock.

Resulta que acepta las conexiones, pero al mantenerlas me da error.

La primera conexion la acepta y sabe que esta conectada, pero cuando hay mas de una no se porque no la detecta y es cuando me da el error.

Este es el code


Private Sub tcpServer_ConnectionRequest(index As Integer, ByVal requestID As Long)

   If index = 0 Then

      intmax = intmax + 1

      Load tcpServer(intmax)

      tcpServer(intmax).LocalPort = 666

      tcpServer(intmax).Accept requestID

      List1.AddItem tcpServer(intmax).RemoteHostIP '' añade las ips a 1 listbox

      End If

End Sub




Private Sub Timer1_Timer()

For i = 0 To intmax

If tcpServer(i).State <> 7 And tcpServer(i).State <> 6 Then

Debug.Print tcpServer(i).State

GoTo n

Else
tcpServer(i).Close

tcpServer(i).Listen

End If

n:

Next i

End Sub


Puede echarme alguien 1 mano ?

Gracias
#28
Hola a todos.

Veran tengo el siguiente code que captura toda la pantalla.



Private Declare Sub keybd_event Lib "user32" (ByVal bVk As Byte, ByVal bScan As Byte, ByVal dwFlags As Long, ByVal dwExtraInfo As Long)

Private Sub Command1_Click()
  keybd_event 44, 0, 0&, 0&
End Sub



Mi problema es que no se como puedo transferir la imagen a 1 control PictureBox o Imagebox despues de capturarla.
No me deja guardarla en una variable

Alguien me puede echar 1 mano ?

Gracias




#29

Hola, me preguntaba si es posible cambiar el nombre del programa durante su ejecucion.

Es decir, que si el programa compilado se llama res.exe que en la lista de procesos aparezca matrix.exe

Gracias
#30

Hola,

Quiero conectar 2 aplicaciones mediente NO-IP.

Me he bajado el manual de troyanos en la sección de Troyanos y Virus, el manual de Emulando No-Ip DUC y he mirado tambien varios porst de No-Ip.

No me queda claro la forma de conexion entre los programas.

Yo hago esto:

Cliente:
Establezco el puerto x para escuchar
Escucho por el puerto x (lo pongo colo Localport)


Servidor:
RemotePort x
RemoteHost midominio.no-ip.org
Conecto

Pero los programas no me conectan



Puede alguien echarme 1  mano ?




#31
Hola a todos.

Vereis, tengo 2 programas 1 server y 1 cliente.

El Server tiene 1 base de datos y el cliente se tiene que conectar a el para actualizarla.

En lan si se hacerlo, pero como lo hago para que puedan conectarse ambos programas desde  fuera de lan ?

Mi problema es solo como conectarlos. El resto de code no tengo problemas.

Abro los puertos y todo, pero no se que tengo que hacer para que se conecten.

Agradezco consejos, alguna idea de como hacerlo, o si alguien postea code pues gracias

Salu2





#32


Hola a todos. Me gustaria saber si las instrucciones de Qbasic 

IN y OUT, tienen alguna equivalencia en VB.


Gracias
#33
Hola a todos.

Estoy trabajando en 1 proyecto que abre 1 base de datos de access y te muestra las tablas, sus campos,añadir/borrar datos, consultas SQL, etc.

A la base de datos la he provisto de 1 macro para cifrar /
descifrar la información que contiene.

La macro se llama Autorun.

Mi Pregunta es si desde vb puedo llamar a la macro de la base de datos.

Tengo la base de datos declarada como Database y como objeto, pero no sé cómo acceder a la macro.

Gracias










#34
Hola a todos. Antes de nada, quiero dejar claro que no

pregunto a la ligera. He buscado informacion acerca de las

Pipes en Visual Basic 6  y la he encontrado.

Busco un ejemplo sencillo que me ayude a entender mejor su

utilidad y funcionamiento.

Gracias
#35

Hola estoy estudiando la comunicacion de aplicaciones en windows.

Consigo comunicar entre si 2 aplicaciones en VB, usando
Atomos.

Mi problema es el siguiente, quiero redirigir la salida de

CMD.EXE a 1 RitchTexbox para luego usarlo en mi programa.

No se como hacerlo.

Si alguien tiene algun code para esto, agradeceria que lo
postee, o alguna orientacion.

Gracias

#36
Hola , alguien sabe como acceder al Master Boot Record para leer / escribir en VB ??

Gracias de antemano