Ver Mensaje Individual
  #2 (permalink)  
Antiguo 04/05/2006, 20:44
NightDark
 
Fecha de Ingreso: enero-2006
Ubicación: mi casa
Mensajes: 255
Antigüedad: 19 años, 3 meses
Puntos: 0
Cita:
Iniciado por Ciberdanny
HOLA, PUES ESTOY TRATANDO DE METER UNA CLAVE DE REGISTRO CON EL VALOR QUE APAREZCA EN UN TEXTBOX Y ME DICE QUE NO COINCIDEN LOS TIPOS ¿ME PODRIAN AYUDAR A SABER DONDE ME ESTOY EQUIVOCANDO PORFA?.

MI CODIGO ES ESTE:

Private Sub Command1_Click()
Set reg = CreateObject("WScript.Shell")
reg.RegWrite "HKEY_CURRENT_USER\Prueba\Prueba", "URL.Text", "REG_DWORD"
MsgBox "HEcho"
End Sub

Private Sub URL_Change()

End Sub

COMO LES COMENTO EL PROBLEMA ES QUE CUANDO LE DOY PLAY ME DICE QUE NO COINCIDEN LOS TIPOS PERO LA CLAVE DE REGISTRO "PRUEBA" SI SE CREA, PERO EL CONTENIDO NO.

POR FAVOR AYUDA!!!!

GRACIAS

Código:
reg.RegWrite "HKEY_CURRENT_USER\Prueba\Prueba", "URL.Text", "REG_DWORD"
El error está en esa linea :) no pongas "REG_DWORD", remueve eso, otra cosa es si quieres pasar del textbox quita """ :)
que quede solo textbox.text :)
por otra parte recomendaría que no uses el objeto Wscript.Shell, mejor usa las API's del windows, busca tu visualizador de API's que trae el compiler de VB y busca las declaraciones (RegCreateEx etc.. creo que asi era el nombre de la api jeje hace tiempo que no las uso.) o ve que funciones exporta advapi32.dll

un saludo.