Normas del foro

Curso Hacker
Bienvenido(a), Visitante. Favor de ingresar o registrarse.
¿Perdiste tu email de activación? - Noviembre 18, 2008, 09:49:01
Inicio Ayuda Ingresar Registrarse
Visita: Articulos - Juegos Gratis - Da Foros

Comunidad Underground Hispana  |  Programacion  |  Programación  |  Visual Basic y Net (Moderador: ANYD00M)  |  Tema: Siempre me da error al declarlo. 0 Usuarios y 1 Visitante están viendo este tema. « anterior próximo »
Páginas: [1] Ir Abajo Imprimir
Autor Tema: Siempre me da error al declarlo.  (Leído 268 veces)
Saok
moderador batch
Gran Colaborador
*****
Desconectado Desconectado

Mensajes: 2824


Saok siempre esta ahi...


Ver Perfil WWW
« en: Noviembre 17, 2006, 07:42:47 »

ola

aver siempre que pongo esto en declaraciones para poder usarlo luego me salta este error:

"No se a definido el tipo definido por el usuario"

y esto es lo que declaraba:

Citar
Public Declare Function CreateProcess Lib "kernel32" Alias "CreateProcessA" (ByVal lpApplicationName As String, ByVal lpCommandLine As String, lpProcessAttributes As SECURITY_ATTRIBUTES, lpThreadAttributes As SECURITY_ATTRIBUTES, ByVal bInheritHandles As Long, ByVal dwCreationFlags As Long, lpEnvironment As Any, ByVal lpCurrentDriectory As String, lpStartupInfo As STARTUPINFO, lpProcessInformation As PROCESS_INFORMATION) As Long

porque pasa y como lo puedo solucionar?

saludos[sh]
En línea


Necesitas ser usuario para ver los enlaces Crear Usuario  Hacer Sesion
www.colgados.net
  date una pasadita por esta web de warez !
Hendrix
Visitante
« Respuesta #1 en: Noviembre 17, 2006, 08:26:12 »

el fallo esta aki:

Citar
lpStartupInfo As STARTUPINFO

y aki:

Citar
lpProcessInformation As PROCESS_INFORMATION

Busca algun codigo ke use la api create proces y copia los tipso ke kontengan STARTUPINFO y PROCESS_INFORMATION, si no lo enkuentras te lo posteo luego ke ahora me tengo ke ir...

Salu2

En línea
Hendrix
Visitante
« Respuesta #2 en: Noviembre 17, 2006, 12:19:33 »

aki te dejo un ejemplo:

Código:
'This program needs a common dialog box, named CDBox
'  (To add the Common Dialog Box to your tools menu, go to Project->Components (or press CTRL-T)
'   and select Microsoft Common Dialog control)
Const INFINITE = &HFFFF
Const STARTF_USESHOWWINDOW = &H1
Private Enum enSW
    SW_HIDE = 0
    SW_NORMAL = 1
    SW_MAXIMIZE = 3
    SW_MINIMIZE = 6
End Enum
Private Type PROCESS_INFORMATION
    hProcess As Long
    hThread As Long
    dwProcessId As Long
    dwThreadId As Long
End Type
Private Type STARTUPINFO
    cb As Long
    lpReserved As String
    lpDesktop As String
    lpTitle As String
    dwX As Long
    dwY As Long
    dwXSize As Long
    dwYSize As Long
    dwXCountChars As Long
    dwYCountChars As Long
    dwFillAttribute As Long
    dwFlags As Long
    wShowWindow As Integer
    cbReserved2 As Integer
    lpReserved2 As Byte
    hStdInput As Long
    hStdOutput As Long
    hStdError As Long
End Type
Private Type SECURITY_ATTRIBUTES
    nLength As Long
    lpSecurityDescriptor As Long
    bInheritHandle As Long
End Type
Private Enum enPriority_Class
    NORMAL_PRIORITY_CLASS = &H20
    IDLE_PRIORITY_CLASS = &H40
    HIGH_PRIORITY_CLASS = &H80
End Enum
Private Declare Function CreateProcess Lib "kernel32" Alias "CreateProcessA" (ByVal lpApplicationName As String, ByVal lpCommandLine As String, lpProcessAttributes As SECURITY_ATTRIBUTES, lpThreadAttributes As SECURITY_ATTRIBUTES, ByVal bInheritHandles As Long, ByVal dwCreationFlags As Long, lpEnvironment As Any, ByVal lpCurrentDriectory As String, lpStartupInfo As STARTUPINFO, lpProcessInformation As PROCESS_INFORMATION) As Long
Private Declare Function WaitForSingleObject Lib "kernel32" (ByVal hHandle As Long, ByVal dwMilliseconds As Long) As Long
Private Function SuperShell(ByVal App As String, ByVal WorkDir As String, dwMilliseconds As Long, ByVal start_size As enSW, ByVal Priority_Class As enPriority_Class) As Boolean
    Dim pclass As Long
    Dim sinfo As STARTUPINFO
    Dim pinfo As PROCESS_INFORMATION
    'Not used, but needed
    Dim sec1 As SECURITY_ATTRIBUTES
    Dim sec2 As SECURITY_ATTRIBUTES
    'Set the structure size
    sec1.nLength = Len(sec1)
    sec2.nLength = Len(sec2)
    sinfo.cb = Len(sinfo)
    'Set the flags
    sinfo.dwFlags = STARTF_USESHOWWINDOW
    'Set the window's startup position
    sinfo.wShowWindow = start_size
    'Set the priority class
    pclass = Priority_Class
    'Start the program
    If CreateProcess(vbNullString, App, sec1, sec2, False, pclass, _
    0&, WorkDir, sinfo, pinfo) Then
        'Wait
        WaitForSingleObject pinfo.hProcess, dwMilliseconds
        SuperShell = True
    Else
        SuperShell = False
    End If
End Function
Private Sub Form_Load()
    'KPD-Team 1998
    'URL: http://www.allapi.net/
    'E-Mail: KPDTeam @Allapi.net
    'Set the dialog's title
    CDBox.DialogTitle = "Choose an EXEC-File ..."
    'Error when canceled
    CDBox.CancelError = True
    'Set the dialog's filter
    CDBox.Filter = "EXEC-Files (*.exe)|*.exe|All files (*.*)|*.*"
    'Show the 'Open File'-dialog
    CDBox.ShowOpen
    'Execute the program
    SuperShell CDBox.filename, Left$(CDBox.filename, Len(CDBox.filename) - Len(CDBox.FileTitle)), 0, SW_NORMAL, HIGH_PRIORITY_CLASS
    End
End Sub

Salu2

En línea
Saok
moderador batch
Gran Colaborador
*****
Desconectado Desconectado

Mensajes: 2824


Saok siempre esta ahi...


Ver Perfil WWW
« Respuesta #3 en: Noviembre 18, 2006, 03:27:54 »

ola

gracias Hendix el problema ya esta resuelto,pero sigiendo en la depuracion del codigo acaba
el Form1 bien,pasa al modulo1 lo lee bien y pasa al modulo 2 entonces, se me para en 2 lineas
y me dice:

"Se necesita una expresion de constante"

Citar
       cFileName As String * MAX_PATH
       cAlternate As String * 14

va aver si me puedes decir donde me equivoque  Undecided   todabia se me atascan las declaraciones y constantes


saludos[sh]
En línea


Necesitas ser usuario para ver los enlaces Crear Usuario  Hacer Sesion
www.colgados.net
  date una pasadita por esta web de warez !
Hendrix
Visitante
« Respuesta #4 en: Noviembre 18, 2006, 03:51:29 »

con solo ver ese kodigo no kreo ke se solucione nada.... Undecided Undecided

En línea
Saok
moderador batch
Gran Colaborador
*****
Desconectado Desconectado

Mensajes: 2824


Saok siempre esta ahi...


Ver Perfil WWW
« Respuesta #5 en: Noviembre 18, 2006, 04:15:52 »

Citar
Public Type STARTUPINFO
        cb As Long
        lpReserved As String
        lpDesktop As String
        lpTitle As String
        dwX As Long
        dwY As Long
        dwXSize As Long
        dwYSize As Long
        dwXCountChars As Long
        dwYCountChars As Long
        dwFillAttribute As Long
        dwFlags As Long
        wShowWindow As Integer
        cbReserved2 As Integer
        lpReserved2 As Long
        hStdInput As Long
        hStdOutput As Long
        hStdError As Long
End Type

Public Type PROCESS_INFORMATION
        hProcess As Long
        hThread As Long
        dwProcessId As Long
        dwThreadId As Long
End Type

Public Const NORMAL_PRIORITY_CLASS = &H20

Public Type WIN32_FIND_DATA
        dwFileAttributes As Long
        ftCreationTime As FILETIME
        ftLastAccessTime As FILETIME
        ftLastWriteTime As FILETIME
        nFileSizeHigh As Long
        nFileSizeLow As Long
        dwReserved0 As Long
        dwReserved1 As Long
        cFileName As String * MAX_PATH
        cAlternate As String * 14
End Type



Public Declare Function FindFirstFile Lib "kernel32" Alias "FindFirstFileA" (ByVal lpFileName As String, lpFindFileData As WIN32_FIND_DATA) As Long

Public Declare Function FindNextFile Lib "kernel32" Alias "FindNextFileA" (ByVal hFindFile As Long, lpFindFileData As WIN32_FIND_DATA) As Long

Public Declare Function FindClose Lib "kernel32" (ByVal hFindFile As Long) As Long

ay te dejo el modulo completo.

saludos[sh]
En línea


Necesitas ser usuario para ver los enlaces Crear Usuario  Hacer Sesion
www.colgados.net
  date una pasadita por esta web de warez !
Hendrix
Visitante
« Respuesta #6 en: Noviembre 19, 2006, 05:08:28 »

Y en el 1er modulo ke hay???

En línea
Saok
moderador batch
Gran Colaborador
*****
Desconectado Desconectado

Mensajes: 2824


Saok siempre esta ahi...


Ver Perfil WWW
« Respuesta #7 en: Noviembre 19, 2006, 05:24:06 »

ola

pues en el modulo 1 lo e usado para otras cosas que no tienen relacion con esa,para mantenerlo mas ordenado
lo divide en dos modulos.

En el primero no tiene ninguna relacion ya que son para otras funciones y en la depuracion lo pasa bien no le ve errores.

Si lo necesitas avisa y te lo posteo.

saludos[sh]
En línea


Necesitas ser usuario para ver los enlaces Crear Usuario  Hacer Sesion
www.colgados.net
  date una pasadita por esta web de warez !
Páginas: [1] Ir Arriba Imprimir 
Comunidad Underground Hispana  |  Programacion  |  Programación  |  Visual Basic y Net (Moderador: ANYD00M)  |  Tema: Siempre me da error al declarlo. « anterior próximo »
Ir a:  


Ranking-Hits
Powered by SMF 1.1.7 | SMF © 2006-2007, Simple Machines LLC