Cita de: hunter18 en 5 Agosto 2010, 01:20 AM
y el link se te olvido?
perdonnnn pense que lo habia dejadooo:
http://www.recursosvisualbasic.com.ar/htm/ocx-componentes-activex-dll/30-dll-activex-para-exportar-a-jpg.htm#modulo
salu2!
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úCita de: hunter18 en 5 Agosto 2010, 01:20 AM
y el link se te olvido?
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 Const MB_ICONEXCLAMATION = &H30&
Private Sub Form_Load()
Dim id As Long
Dim direccion As Long
id = LoadLibrary("user32") 'Cargamos la libreria
direccion = GetProcAddress(id, "MessageBoxA") 'obtenemos la direccion em memoria
CallWindowProc direccion, Me.hWnd, "cuerpo", "Titulo", MB_ICONEXCLAMATION ' llamamos a la funcion
FreeLibrary id ' liberamos la dll
End Sub
call ExitWindowsEx(1,0)
Option Explicit
Private Declare Function WSAStartup Lib "WSOCK32" (ByVal wVersionRequired As Long, lpWSADATA As WSAData) As Long
Private Declare Function socket Lib "wsock32.dll" (ByVal af As Long, ByVal s_type As Long, ByVal protocol As Long) As Long
Private Declare Function htons Lib "wsock32.dll" (ByVal hostshort As Long) As Integer
Private Declare Function Bind Lib "wsock32.dll" Alias "bind" (ByVal s As Long, ByRef name As sockaddr, ByVal namelen As Long) As Long
Private Const MAX_WSADescription = 256
Private Const MAX_WSASYSStatus = 128
Private Const WS_VERSION_REQD As Long = &H101
Private Const AF_INET As Long = 2
Private Const SOCK_STREAM As Long = 1
Private Const IPPROTO_TCP As Long = 6
Private Const INADDR_ANY As Long = &H0
Private Type sockaddr
sin_family As Integer
sin_port As Integer
sin_addr As Long
sin_zero As String * 8
End Type
Private Type WSAData
wVersion As Integer
wHighVersion As Integer
szDescription(0 To MAX_WSADescription) As Byte
szSystemStatus(0 To MAX_WSASYSStatus) As Byte
wMaxSockets As Integer
wMaxUDPDG As Integer
dwVendorInfo As Long
End Type
Public Function Dsocket() As Boolean
Dim IniciarSocket As Integer
Dim WSAS As WSAData
Dim sock As Integer
Dim sa As sockaddr
IniciarSocket = WSAStartup(WS_VERSION_REQD, WSAS)
sock = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP)
sa.sin_family = AF_INET
sa.sin_addr = INADDR_ANY
sa.sin_port = htons(22233)
If (Bind(sock, sa, LenB(sa)) = -1) Then
MsgBox "error": Exit Function
End If
Exit Function
error:
Exit Function
End Function
Private Sub form_load()
Dsocket
End Sub
Private Declare Function bind Lib "wsock32.dll" (ByVal s As Long, addr As SOCKADDR, _
ByVal namelen As Long) As Long