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

 

 


Tema destacado: Guía rápida para descarga de herramientas gratuitas de seguridad y desinfección


+  Foro de elhacker.net
|-+  Programación
| |-+  Programación General
| | |-+  .NET (C#, VB.NET, ASP)
| | | |-+  Programación Visual Basic (Moderadores: LeandroA, seba123neo)
| | | | |-+  create threads en vb6
0 Usuarios y 1 Visitante están viendo este tema.
Páginas: [1] Ir Abajo Respuesta Imprimir
Autor Tema: create threads en vb6  (Leído 2,947 veces)
z_ane_666

Desconectado Desconectado

Mensajes: 64


Ver Perfil
create threads en vb6
« en: 12 Diciembre 2011, 18:05 pm »

me he encontrado con un ejemplo en el que se usa la api createthread
Código:
'Using the CreateThread function in Visual Basic
'is very risky! VB5 is 'kinda' stable, but VB6
'applications will probably crash when you
'use the CreateThread function.

'In a form
'Add a command button to the form
Private Sub Command1_Click()
    'KPD-Team 1999
    'URL: [url]http://www.allapi.net/[/url]
    'E-Mail: [email]KPDTeam@Allapi.net[/email]
    'After you click this button, try to move the window
    'You will see that the AsyncThread-function was executed asynchronously
    hThread = CreateThread(ByVal 0&, ByVal 0&, AddressOf AsyncThread, ByVal 0&, ByVal 0&, hThreadID)
    CloseHandle hThread
End Sub
Private Sub Form_Unload(Cancel As Integer)
    'If the thread is still running, close it
    If hThread <> 0 Then TerminateThread hThread, 0
End Sub
'In a module
Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long)
Declare Function CreateThread Lib "kernel32" (lpThreadAttributes As Any, ByVal dwStackSize As Long, ByVal lpStartAddress As Long, lpParameter As Any, ByVal dwCreationFlags As Long, lpThreadID As Long) As Long
Declare Function TerminateThread Lib "kernel32" (ByVal hThread As Long, ByVal dwExitCode As Long) As Long
Declare Function CloseHandle Lib "kernel32" (ByVal hObject As Long) As Long
Public hThread As Long, hThreadID As Long
Public Sub AsyncThread()
    'Let this thread sleep for 10 seconds
    Sleep 10000
    hThread = 0
End Sub

y bien como dice ( y es cierto) la aplicacion crashea al usar create thread

habra alguna manera de crear threads o al menos hacer una aproximacion a ello?

saludos


En línea

MCKSys Argentina
Moderador Global
***
Desconectado Desconectado

Mensajes: 5.473


Diviértete crackeando, que para eso estamos!


Ver Perfil
Re: create threads en vb6
« Respuesta #1 en: 12 Diciembre 2011, 21:42 pm »

Google "Multithreading + vb6":
http://www.freevbcode.com/ShowCode.Asp?ID=1287
http://www.vbforums.com/showthread.php?s=&threadid=296315
http://www.elguille.info/colabora/vb/multi_thread_nc.htm
http://visualbasic.ittoolbox.com/documents/popular-q-and-a/mutithreading-support-in-visual-basic-1785

Discusión:
http://www.xtremevbtalk.com/showthread.php?t=252924

Saludos!


En línea

MCKSys Argentina

"Si piensas que algo está bien sólo porque todo el mundo lo cree, no estás pensando."

Páginas: [1] Ir Arriba Respuesta Imprimir 

Ir a:  

WAP2 - Aviso Legal - Powered by SMF 1.1.21 | SMF © 2006-2008, Simple Machines