Ver Mensaje Individual
  #5 (permalink)  
Antiguo 02/10/2004, 16:08
2Fast To You
 
Fecha de Ingreso: septiembre-2003
Ubicación: Santo Domingo - R. Dominicana
Mensajes: 606
Antigüedad: 21 años, 6 meses
Puntos: 0
Hola Amigo

Mira yo hice en el FrmReiniciar lo siguiente

Private Sub Form_Load()
ProgressBar1.Value = 0 'Setting the prgbar's value to 0
Timer1.Enabled = True 'Starting timer & its codes
End Sub

Private Sub Timer1_Timer()
ProgressBar1.Value = ProgressBar1.Value + 2 'Every 100ms, prgbar.value adds 2 to it
Label3.Caption = Val(Label3.Caption) + 1

If ProgressBar1.Value >= 100 Then 'If the prgbar value excedes or equals 100
'then stop the timer and enable the start button, so user can click again
Label3.Caption = "100"
Timer1.Enabled = False
Unload Me
frmRegistroSistema.Show

End If

End Sub


Es decir una barra de procceso y todo funciona bien, ejemplo si pongo el serial mal me vuelve a enviar al FormRegistroSistema pero si me registro FrmReiniciar me lleva nuevamente a frmregistroSistema y frmregistroSistema me lleva a frmmain todo asta ahí bien, pero creeo que tengo mal el codigo de Redireccional frmregistroSistama a frmain pues me tira el Error.

Esta compuesto fmRegistrarSistema así:

Private Declare Function GetVolumeInformation& Lib "kernel32" Alias "GetVolumeInformationA" (ByVal lpRootPathName As String, ByVal pVolumeNameBuffer As String, ByVal nVolumeNameSize As Long, lpVolumeSerialNumber As Long, lpMaximumComponentLength As Long, lpFileSystemFlags As Long, ByVal lpFileSystemNameBuffer As String, ByVal nFileSystemNameSize As Long)
Private Declare Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" ( _
ByVal hwnd As Long, _
ByVal lpOperation As String, _
ByVal lpFile As String, _
ByVal lpParameters As String, _
ByVal lpDirectory As String, _
ByVal nShowCmd As Long) As Long

Private Sub cmdRegistrarme_Click()
Unload Me
frmReinicio.Show
Unload Me
End Sub

Private Sub Form_Load()
Dim cad1 As String * 256
Dim cad2 As String * 256
Dim numSerie As Long
Dim longitud As Long
Dim flag As Long
unidad = "C:\"
Call GetVolumeInformation(unidad, cad1, 256, numSerie, longitud, flag, cad2, 256)
Primera.Caption = numSerie
Reg1.Text = GetSetting(App.Title, Me.Name, Reg1.Name, vbChecked)
Reg2.Text = GetSetting(App.Title, Me.Name, Reg2.Name, vbChecked)
Reg3.Text = GetSetting(App.Title, Me.Name, Reg3.Name, vbChecked)
If (Val(Reg1.Text) = (numSerie + 896576537)) And (Val(Reg2.Text) = (numSerie + 167235485)) And (Val(Reg3.Text) = (numSerie + 349824653)) Then
Unload Me
frmMain.Show
Else
MsgBox "Aplicación no Registrada en su Computador"
End If
End Sub
Private Sub Form_Unload(Cancel As Integer)
SaveSetting App.Title, Me.Name, Me.Reg1.Name, Me.Reg1.Text
SaveSetting App.Title, Me.Name, Me.Reg2.Name, Me.Reg2.Text
SaveSetting App.Title, Me.Name, Me.Reg3.Name, Me.Reg3.Text
End Sub

Private Sub cmdSalir_Click()
Unload Me
End Sub

Private Sub cmdEnviar_Click()
SendMail "[email protected]", "Código de Activación (FacturaZax)", _
"Estimado Departamento de Sopote: A Continuación le envío el Código de Activación para el Programa FacturaZax. "

End Sub

Private Sub SendMail( _
ByVal sDest As String, _
ByVal sSubject As String, _
ByVal sBody As String)

Dim sMsg As String

'***************************
'Esto solía funcionar
'**********************
'sMsg = "mailto:" & sDest & _
"?subject=" & sSubject & _
"&attach=" & """c:\archivo.ext""" & _
"&body=" & sBody

sMsg = "mailto:" & sDest & _
"?subject=" & sSubject & _
"&body=" & sBody

ShellExecute Me.hwnd, vbNullString, sMsg, vbNullString, vbNullString, SW_SHOWNORMAL
End Sub


Adios