elhacker.net cabecera Bienvenido(a), Visitante. Por favor Ingresar o Registrarse
¿Perdiste tu email de activación?.

 

 


Tema destacado: Arreglado, de nuevo, el registro del warzone (wargame) de EHN


  Mostrar Mensajes
Páginas: 1 2 [3] 4 5
21  Programación / Programación Visual Basic / formatear texto visual basic en: 8 Abril 2008, 16:02 pm
Pues eso, estoy haciendo una aplicacion y quiero que aparezca un cuadro de texto con informacion ya escrita y me gustaria q eso apareciese es unos colores, pero que si el usuario introduce texto aparezca en otro color
Es posible eso???
También me gustaria saber si se puede hacer pestañas desplegables en VB60, de las que cuando pulsas en ellas se te despliega parte de la ventana
Gracias y Saludos
22  Programación / Programación Visual Basic / host activoo en VB en: 31 Marzo 2008, 12:38 pm
Hola:
Estoy programando una aplicación y necesito comprobar si un host esta activo antes de interactuar con el. Cómo se podría hacer esto en VB6?
Gracias y Saludos
23  Programación / Programación Visual Basic / paso de valores de clase a form en: 10 Marzo 2008, 11:04 am
Hola: resulta que tengo el siguiente código, lo que hago es lanzar un form para que el usuario meta valores y luego pasarselos al .class pero no se porque no me coge el string.
El codigo del .class es el siguiente:
Código:
'These members represent the main TestType object properties.

Public RemoteAgentCLSID As String ' Run Remote Agent Class ID

Public ScriptViewerCLSID As String ' ActiveX script viewer Class ID

Public TestingToolName As String ' Remote Agent name

Public ExecConfigCLSID As String ' Configuration Class ID

Public CanCreateScriptTemplate As Long ' Flag

Public LastErrorMessage As String ' Most common error message

Public ResultViewerCLSID As String ' ActiveX result viewer Class ID

Private td As TDConnection

Dim f As New Form1





Private Sub Class_Initialize()

'This sub-routine is run when the TestType is loaded.

'Note that at this time, none of the optional controls is

' supported, as their class ID strings are empty.

'Also note that the remote agent class ID is empty,

' as no such agent yet exists.

'This example does not support script templates,

' and has only one error type.

 

    ExecConfigCLSID = "" ' No configuration utility provided

    RemoteAgentCLSID = "{78888EDF-6BCB-4477-AB18-9DA7D483CC52}"

    ScriptViewerCLSID = "{472B9CAC-C738-43BE-A0A7-EB6AB1B8BDEA}"

    TestingToolName = "Script"

    CanCreateScriptTemplate = 1 ' create new test feature turned on

    LastErrorMessage = "" ' Testing issues

    ResultViewerCLSID = "" ' No result viewer ActiveX provided

    LoadPicture ""
   
    nPath = "empty"
   
    closing = False
   
   

End Sub



Public Sub Init(mytd As Variant)

    ' You may need a TDConnection to use OTA functions in your application.

    ' If you do, add a project reference to the OTA:

    ' In Projects > References, check the "OTA COM 8.0 Type Library."

    ' and declare a module-level variable: Private td As TDConnection

    Set td = mytd 'Get the td object to be used if needed

End Sub



Public Function CreateScriptTemplate(TestKey As Long, _
        ByRef LocalPath As String) As Long
       
   
    ' Create test script template

    ' this example

    Dim myf As String
   
    Dim path As String
   
    'The form is loaded
    f.Execute
    path = f.getpath
    If closing = True Then
     Unload Form1
    End If
     
    LocalPath = "c:\temp"
    myf = "C:\temp\batch.bat"

    Open myf For Output As #1

    Print #1, "cd \ " & vbCrLf & path & vbCrLf & "pause"
    Print #1, "La ruta es " & path
    Print #1, "La ruta es " & nPath
   
    Close #1
    CreateScriptTemplate = 1
     
   

End Function


Private Sub Form_Unload(Cancel As Integer)

   'on closing the form set the object f to point to nothing

    Set f = Nothing

End Sub

Public Function GetBitmap(Status As Long) As Long

      GetBitmap = 0 'no bitmap

   End Function



Tengo tambien un archivo .bas:
Código:
Option Explicit

'global variable which stores the item

Public nPath As String

Public closing As Boolean


Y el codigo del form:

Código:
Option Explicit
Dim pathDef As String

'This method show the form
Public Sub Execute()
    Form1.Show
End Sub

Private Sub Command1_Click()
    Dim path As String
    'If Option1 button is selected
    If Option1.Value = True Then
      'Dialog box to interact with the user and get the data
       Do
        path = InputBox("Enter the path where Nunit is installed:", "Path needed")
       Loop Until path <> ""
       pathDef = path
       MsgBox "Has introducido " & pathDef
       nPath = pathDef
       MsgBox "Has introducido " & nPath
       Command2.Enabled = True
    End If
    'If Option2 is selected
    If Option2.Value = True Then
       'Dialog box to interact with the user and get the data
       Do
        path = InputBox("Enter the path where you have your tests located:", "Path needed")
       Loop Until path <> ""
       pathDef = path
       Command2.Enabled = True
    End If
End Sub



Public Function getpath() As String

   'function that gets the item selected in the drop-down box

   nPath = pathDef
   

End Function


Private Sub Command2_Click()

    closing = True

End Sub

Cuando lanzo el cuadro de dialogo en el form, la variable contiene el string, pero no se porque razon no crea el archivo de texto.
Luego tambien me gustaria saber como se podria hacer para que cuando el form sea lanzado el otro programa quede inactivo hasta terminar la ejecucion del form
Gracias y Saludos
24  Programación / Programación Visual Basic / Re: problema con DCOM en VB en: 25 Febrero 2008, 13:22 pm
Hola, no he podido encontrar el fallo asi que he decido replantearme el camino a seguir. He creado otro activeX que es llamado por el primero para coger los datos.
El problem aes que al compilar me aparece el siguiente error:
No se encuentra el miembro o metodo de datos:
Este es el codigo:
Código:
'These members represent the main TestType object properties.

Public RemoteAgentCLSID As String ' Run Remote Agent Class ID

Public ScriptViewerCLSID As String ' ActiveX script viewer Class ID

Public TestingToolName As String ' Remote Agent name

Public ExecConfigCLSID As String ' Configuration Class ID

Public CanCreateScriptTemplate As Long ' Flag

Public LastErrorMessage As String ' Most common error message

Public ResultViewerCLSID As String ' ActiveX result viewer Class ID

Private td As TDConnection
'variable of type clsActivexEx class in Activex_ex component

'create an object for class clsActivexEx in AxtivexEx component
Dim actvixTest As Class1




Private Sub Class_Initialize()

'This sub-routine is run when the TestType is loaded.

'Note that at this time, none of the optional controls is

' supported, as their class ID strings are empty.

'Also note that the remote agent class ID is empty,

' as no such agent yet exists.

'This example does not support script templates,

' and has only one error type.

 

    ExecConfigCLSID = "" ' No configuration utility provided

    RemoteAgentCLSID = "{78888EDF-6BCB-4477-AB18-9DA7D483CC52}"

    ScriptViewerCLSID = "{472B9CAC-C738-43BE-A0A7-EB6AB1B8BDEA}"

    TestingToolName = "Script"

    CanCreateScriptTemplate = 1 ' create new test feature turned on

    LastErrorMessage = "" ' Testing issues

    ResultViewerCLSID = "" ' No result viewer ActiveX provided

    LoadPicture ""
   
   

End Sub



Public Sub Init(mytd As Variant)

    ' You may need a TDConnection to use OTA functions in your application.

    ' If you do, add a project reference to the OTA:

    ' In Projects > References, check the "OTA COM 8.0 Type Library."

    ' and declare a module-level variable: Private td As TDConnection

    Set td = mytd 'Get the td object to be used if needed

End Sub



Public Function CreateScriptTemplate(TestKey As Long, _
        ByRef LocalPath As String) As Long
       
    Set actvixTest = New Class1
   
    ' Create a batch file to emulate a test script for

    ' this example

    Dim myf As String
   
    Dim path As String

    'Load the form to interact with the user and get the data
    [b]actvixTest.LoadForm[/b]
    path = actvixTest.getselectedchar
    actvixTest.Form_Unload
   
    LocalPath = "c:\temp"

    myf = "C:\temp\batch.bat"

    Open myf For Output As #1

    Print #1, "cd C:\Archivos de Programa\NUnit 2.4.5\bin" & vbCrLf & "nunit.exe" & vbCrLf & "pause"
    Print #1, vbCrLf & path
   
    Close #1

    CreateScriptTemplate = 1

End Function



Public Function GetBitmap(Status As Long) As Long

      GetBitmap = 0 'no bitmap

   End Function


Private Sub Form_Unload(Cancel As Integer)

   'on closing the form set the object actvixTest to point to nothing

   'thereby removing reference the class clsActivexEx in component Activex_ex

   Set actvixTest = Nothing

End Sub

El error me lo da en "actvixTest.LoadForm"
El codigo del .cls del activeX es:
Código:
Option Explicit

Public Function LoadForm()

   'Load the form

   Load formActiveX

   formActiveX.Caption = formActiveX.Caption

   formActiveX.Show

End Function

Private Sub Class_Initialize()

   'selectedItem is a global variable declared in module

   'set it to nothing initially

   'whcih implies that no item has been selected

   selectedItem = "nothing"

End Sub

Private Sub Class_Terminate()

   'on terminating unload the form

   Unload formActiveX

End Sub

Public Function getselectedchar() As String

   'function that gets the item selected in the drop-down box

   getselectedchar = selectedItem
   

End Function

Public Sub Form_Unload()

Unload formActiveX

End Sub
Tb he añadido una referencia a este ultimo archivo.
Gracias y Saludos
25  Programación / Programación Visual Basic / problema con DCOM en VB en: 19 Febrero 2008, 15:07 pm
Hola, tengo el siguiente codigo:
Código:
ublic Function CreateScriptTemplate(TestKey As Long, _
        ByRef LocalPath As String) As Long
    ' Create a batch file to emulate a test script for

    ' this example

    Dim myf As String
   
    Dim path As String

    LocalPath = "c:\temp"

    myf = "C:\temp\batch.bat"
   
    'user must input the nunit path to can execute it
    path = InputBox("Enter the path where Nunit is intalled:", "Path needed")
    While (path = "")
     path = InputBox("Enter the path where Nunit is intalled:", "Path needed")
    Wend

    Open myf For Output As #1

    Print #1, "cd C:\Archivos de Programa\NUnit 2.4.5\bin" & vbCrLf & "nunit.exe" & vbCrLf & "pause"
   
    Close #1

    CreateScriptTemplate = 1

End Function
El caso es que al llegar al bucle se cuelga, no se por qué.
El proyecto es un exe activeX y es lanzado por otra aplicacion, no se si eso influirá, porque no creo ningun form ni na de eso
Gracias y Saludos
26  Programación / Programación Visual Basic / Re: ejecutar programa en VB en: 2 Febrero 2008, 13:41 pm
okok
Muchas gracias a los 2  :D
27  Programación / Programación Visual Basic / ejecutar programa en VB en: 1 Febrero 2008, 23:41 pm
Hola:
Me gustaria saber si es posible crear una ventana en Visual basic y ejecutar un programa externo, pero el programa debe ejecutarse "dentro" de esa ventana
Es que conozco la instruccion Shell, pero esa no me vale
Saludos
28  Programación / Programación Visual Basic / problema con inputbox en: 31 Enero 2008, 11:08 am
Hola tengo el siguiente codigo en VB:
Código:
Public Function CreateScriptTemplate(TestKey As Long, _
        ByRef LocalPath As String) As Long
    ' Create a batch file to emulate a test script for

    ' this example

    Dim myf As String
   
    Dim path As String

    LocalPath = "c:\temp"

    myf = "C:\temp\batch.bat"
   
    'user must input the nunit path to can execute it
    path = InputBox("Enter the path where Nunit is intalled:", "Path needed")
    While (path = "")
     path = InputBox("Enter the path where Nunit is intalled:", "Path needed")
    Wend

    Open myf For Output As #1

    Print #1, "cd C:\Archivos de Programa\NUnit 2.4.5\bin" & vbCrLf & "nunit.exe" & vbCrLf & "pause"
   
    Close #1

    CreateScriptTemplate = 1

End Function

El tema es que se me cuelga, supongo que sea por el inputbox porque antes funcionaba bien.
¿Como podria hacerlo funcionar o que puede estar mal aqui? El proyecto es un exe activeX
Gracias y Saludos
29  Programación / Programación Visual Basic / tratamiento de errores en VB en: 24 Enero 2008, 15:00 pm
Hola:
Tengo un programa en VB y quiero que cuando se produzca un error se guarde un aviso en un archivo de texto, pero no se xq aunque la ejecucion sea correcta me aparece en el archivo que se ha producido un error, el codigo es este:

Código:
Exit Function

 

runErr:

Dim msg$

    On Error Resume Next

    msg = "Error in run: " & Err.Description

    LogFile.WriteLine msg

    On Error GoTo runErr

    Resume Next

End Function

Se supone que si hay algun error el programa va a la etiqueta y guarda el error y continua con la ejecucion del programa no¿
Hay mas cido antes de la etiqueta pero creo q no es necesario ponerlo aqui
Gracias y Saludos
30  Media / Multimedia / Duda al grabar pelis en: 23 Agosto 2007, 02:20 am
Hola tengo la siguiente duda, aver si me la podeis resolver:
Resulta que muchas veces que me descargo alguna peli al ir a grabarla con el Nero, creando CD de video el tamaño se me sale de un CD normal, y solo puedo grabarla como datos.
Esto por qué pasa?Cómo solucionarlo o qué tengo q buscar en las pelis al descargarlas para que no me pase esto?¿
Gracias y Saludos!!
Páginas: 1 2 [3] 4 5
WAP2 - Aviso Legal - Powered by SMF 1.1.21 | SMF © 2006-2008, Simple Machines