|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Argument not specifiedAnybody have an idea on what i am doing wrong here,
CheckSetService - Argument not specified for parameter 'Tipo' of 'Private Sub CheckSetService(Tipo As Long)'. Private Sub btnStartService_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnStartService.Click CheckSetService(1) End Sub Private Sub btnStopService_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnStopService.Click CheckSetService(2) Try with 1L, 2L, or use an integer arg.
-tom CrashGirl ha scritto: Show quoteHide quote > Anybody have an idea on what i am doing wrong here, > > CheckSetService - Argument not specified for parameter 'Tipo' of > 'Private Sub CheckSetService(Tipo As Long)'. > > Private Sub btnStartService_Click(ByVal sender As System.Object, > ByVal e As System.EventArgs) Handles btnStartService.Click > CheckSetService(1) > End Sub > > Private Sub btnStopService_Click(ByVal sender As System.Object, > ByVal e As System.EventArgs) Handles btnStopService.Click > CheckSetService(2) Hi,
I tried but not worked... :( and I have other problem... with this "object reference not set to an instance of an object" anyone knows what´s the problem? tommaso.gasta***@uniroma1.it escreveu: Show quoteHide quote > Try with 1L, 2L, or use an integer arg. > > -tom > > CrashGirl ha scritto: > > > Anybody have an idea on what i am doing wrong here, > > > > CheckSetService - Argument not specified for parameter 'Tipo' of > > 'Private Sub CheckSetService(Tipo As Long)'. > > > > Private Sub btnStartService_Click(ByVal sender As System.Object, > > ByVal e As System.EventArgs) Handles btnStartService.Click > > CheckSetService(1) > > End Sub > > > > Private Sub btnStopService_Click(ByVal sender As System.Object, > > ByVal e As System.EventArgs) Handles btnStopService.Click > > CheckSetService(2) yes, CG that is the generic message you get when trying to use an
object which you have not instantiated yet. You will see it some million times in your life if you keep programming... :) although the new IDE try to warn when possible Post the code, otherwise nobody is able to help you ... -t CrashGirl ha scritto: Show quoteHide quote > Hi, > > I tried but not worked... :( and I have other problem... with this > "object reference not set to an instance of an object" anyone knows > what´s the problem? > > tommaso.gasta***@uniroma1.it escreveu: > > > Try with 1L, 2L, or use an integer arg. > > > > -tom > > > > CrashGirl ha scritto: > > > > > Anybody have an idea on what i am doing wrong here, > > > > > > CheckSetService - Argument not specified for parameter 'Tipo' of > > > 'Private Sub CheckSetService(Tipo As Long)'. > > > > > > Private Sub btnStartService_Click(ByVal sender As System.Object, > > > ByVal e As System.EventArgs) Handles btnStartService.Click > > > CheckSetService(1) > > > End Sub > > > > > > Private Sub btnStopService_Click(ByVal sender As System.Object, > > > ByVal e As System.EventArgs) Handles btnStopService.Click > > > CheckSetService(2) CrashGirl
As you show us code, than please show it at least well. > 'Private Sub CheckSetService(Tipo As Long)'. Are you sure that this is exactly as this in your code?Cor hi Guys, here is my code...
Private Sub btnStartService_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnStartService.Click CheckSetService(1) End Sub Private Sub btnStopService_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnStopService.Click CheckSetService(2) End Sub Private Sub CheckSetService(ByVal Tipo As Long) Dim Svc As ServiceProcess.ServiceController Me.Cursor = System.Windows.Forms.Cursors.WaitCursor Svc = New ServiceProcess.ServiceController Svc.ServiceName = "SWFTPClient" Svc.Refresh() Select Case Tipo Case 1 Try If Svc.Status.Equals(ServiceProcess.ServiceControllerStatus.Stopped) Then Me.sBar.Text = "Iniciando o serviço ! Aguarde..." Svc.Start() Svc.Refresh() End If Catch ex As Exception End Try Case 2 Try If Svc.Status.Equals(ServiceProcess.ServiceControllerStatus.Running) Then Me.sBar.Text = "Parando o serviço ! Aguarde..." Svc.Stop() Svc.Refresh() End If Catch ex As Exception End Try End Select Try Select Case Tipo Case 1 Svc.WaitForStatus(ServiceProcess.ServiceControllerStatus.Running, System.TimeSpan.FromSeconds(30)) Case 2 Svc.WaitForStatus(ServiceProcess.ServiceControllerStatus.Stopped, System.TimeSpan.FromSeconds(30)) End Select Catch ex As Exception Svc.Refresh() End Try Try Me.lblStatusSvc.Text = "SWFTPClient Service: " & Svc.Status.ToString If Svc.Status.Equals(ServiceProcess.ServiceControllerStatus.Stopped) Then Me.btnStartService.Enabled = True Me.btnStopService.Enabled = False ElseIf Svc.Status.Equals(ServiceProcess.ServiceControllerStatus.Running) Then Me.btnStartService.Enabled = False Me.btnStopService.Enabled = True End If Catch ex As Exception Me.lblStatusSvc.Text = "SWFTPClient Service: Indisponível" Me.btnStartService.Enabled = False Me.btnStopService.Enabled = False End Try Me.sBar.Text = "" Me.Cursor = System.Windows.Forms.Cursors.Default When I click button start to service my file log register ("Object reference not set to an instance of an object") Only when i start my service... CrashGirl,
I see 4 times Tipo, where is it giving the error? (Although I do not see the sense why it is long while integer is the most sufficient numeric value or here even Boolean can be used). Cor "CrashGirl" <puk***@gmail.com> schreef in bericht hi Guys, here is my code...news:1153404330.404023.79510@s13g2000cwa.googlegroups.com... Private Sub btnStartService_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnStartService.Click CheckSetService(1) End Sub Private Sub btnStopService_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnStopService.Click CheckSetService(2) End Sub Private Sub CheckSetService(ByVal Tipo As Long) Dim Svc As ServiceProcess.ServiceController Me.Cursor = System.Windows.Forms.Cursors.WaitCursor Svc = New ServiceProcess.ServiceController Svc.ServiceName = "SWFTPClient" Svc.Refresh() Select Case Tipo Case 1 Try If Svc.Status.Equals(ServiceProcess.ServiceControllerStatus.Stopped) Then Me.sBar.Text = "Iniciando o serviço ! Aguarde..." Svc.Start() Svc.Refresh() End If Catch ex As Exception End Try Case 2 Try If Svc.Status.Equals(ServiceProcess.ServiceControllerStatus.Running) Then Me.sBar.Text = "Parando o serviço ! Aguarde..." Svc.Stop() Svc.Refresh() End If Catch ex As Exception End Try End Select Try Select Case Tipo Case 1 Svc.WaitForStatus(ServiceProcess.ServiceControllerStatus.Running, System.TimeSpan.FromSeconds(30)) Case 2 Svc.WaitForStatus(ServiceProcess.ServiceControllerStatus.Stopped, System.TimeSpan.FromSeconds(30)) End Select Catch ex As Exception Svc.Refresh() End Try Try Me.lblStatusSvc.Text = "SWFTPClient Service: " & Svc.Status.ToString If Svc.Status.Equals(ServiceProcess.ServiceControllerStatus.Stopped) Then Me.btnStartService.Enabled = True Me.btnStopService.Enabled = False ElseIf Svc.Status.Equals(ServiceProcess.ServiceControllerStatus.Running) Then Me.btnStartService.Enabled = False Me.btnStopService.Enabled = True End If Catch ex As Exception Me.lblStatusSvc.Text = "SWFTPClient Service: Indisponível" Me.btnStartService.Enabled = False Me.btnStopService.Enabled = False End Try Me.sBar.Text = "" Me.Cursor = System.Windows.Forms.Cursors.Default When I click button start to service my file log register ("Object reference not set to an instance of an object") Only when i start my service...
check database connection/open
Default date Combining datatables HELP! Why is SqlException being caught in this code if it can't connect to SQL Server? Display Unicode characters on Winforms concurrency question Access Databse "Select * from Bilag Where Mdates Between #1/1/2006# And #31/1/2006#" Refreshing datagridview after a rowtemplate height change ADO.NET in VB6 How to download a file from Server to client local pc without user intervention? |
|||||||||||||||||||||||