Click here to Skip to main content
15,923,689 members
Home / Discussions / Visual Basic
   

Visual Basic

 
QuestionHow to disconnect my account from mysql server? Pin
josinvill@yahoo.com14-Oct-09 19:14
josinvill@yahoo.com14-Oct-09 19:14 
AnswerRe: How to disconnect my account from mysql server? Pin
Dave Kreskowiak15-Oct-09 3:53
mveDave Kreskowiak15-Oct-09 3:53 
QuestionForce the user change the password on first login? Pin
waner michaud14-Oct-09 11:40
waner michaud14-Oct-09 11:40 
AnswerRe: Force the user change the password on first login? Pin
_Damian S_14-Oct-09 15:46
professional_Damian S_14-Oct-09 15:46 
AnswerRe: Force the user change the password on first login? Pin
Dave Kreskowiak14-Oct-09 16:26
mveDave Kreskowiak14-Oct-09 16:26 
GeneralRe: Force the user change the password on first login? Pin
Ashfield15-Oct-09 1:38
Ashfield15-Oct-09 1:38 
GeneralRe: Force the user change the password on first login? Pin
Dave Kreskowiak15-Oct-09 4:19
mveDave Kreskowiak15-Oct-09 4:19 
QuestionWhat's wrong with my event handler? Pin
Sonhospa14-Oct-09 11:01
Sonhospa14-Oct-09 11:01 
Good evening everyone,

in my project I use a 'frames' class which controls the different images of a film. The frames are stored in a generic list, and every time the index changes I raise an own event called 'FrameChanged'. I might have to tell that it's my first attempt to use selfmade EventArgs... and over and over again I run into a 'TargetParameterCountException' without finding an idea why?

Maybe someone of you experienced guys is able to support me with some advice? Here's what I do:

The event is defined in the frames class with
Public Shared Event FrameChanged(ByVal sender As Object, ByVal e As FrameChangedEventArgs).

The event args are:
Public Class FrameChangedEventArgs
    Inherits EventArgs

    Public Total As Integer
    Public Done As Integer
    Public Index As Integer
    Public File As String
    Public Message As String

    Public Sub New(ByVal TotalFrames As Integer, ByVal FramesSoFar As Integer, ByVal Ind As Integer, ByVal filename As String, ByVal msg As String)
        MyBase.New()
        Total = TotalFrames
        Done = FramesSoFar
        Index = Ind
        File = filename
        Message = msg
    End Sub
End Class
Then the event is raised in the 'Set' part of the index property:
RaiseEvent FrameChanged(Nothing, New FrameChangedEventArgs(Max, value, value, File, String.Empty))

In a form I first define a listener like this:
AddHandler clsFrames.FrameChanged, AddressOf OnFrameChange 'Listener!

And, finally, this is the event handler:
   Public Sub OnFrameChange(ByVal sender As Object, ByVal e As FrameChangedEventArgs)
       Try
           If Me.InvokeRequired Then
               Dim dlg As New UpdateCounterDelegate(AddressOf OnFrameChange)
---->          Me.Invoke(dlg, New FrameChangedEventArgs(e.Total, e.Done, e.Index, e.File, e.Message))
           Else
               UpdateGUI(e.Total, e.Done, e.Index, e.File, e.Message)
           End If
       Catch ex As Exception
           MsgBox("Error in the FrameChanged-Event!")
       End Try
   End Sub
When debugging I find that the error occurs in the marked line above. I'm starting to doubt that I'm able to count to five... Or what else is wrong with my code where this ParameterCount problem might result from?

Thank you in advance,
Michael

p.s. Trying to use 'BeginInvoke' instead results in the same error thrown at the end of the sub, before updating the GUI.
AnswerRe: What's wrong with my event handler? Pin
Ian Shlasko14-Oct-09 11:22
Ian Shlasko14-Oct-09 11:22 
GeneralRe: What's wrong with my event handler? Pin
Sonhospa15-Oct-09 0:26
Sonhospa15-Oct-09 0:26 
AnswerRe: What's wrong with my event handler? Pin
Luc Pattyn14-Oct-09 11:28
sitebuilderLuc Pattyn14-Oct-09 11:28 
GeneralRe: What's wrong with my event handler? Pin
Sonhospa15-Oct-09 0:38
Sonhospa15-Oct-09 0:38 
QuestionID3 desicion tree coding for my project Pin
sdeepan414-Oct-09 8:10
sdeepan414-Oct-09 8:10 
AnswerRe: ID3 desicion tree coding for my project Pin
Dave Kreskowiak14-Oct-09 8:23
mveDave Kreskowiak14-Oct-09 8:23 
GeneralRe: ID3 desicion tree coding for my project Pin
sdeepan414-Oct-09 8:32
sdeepan414-Oct-09 8:32 
GeneralRe: ID3 desicion tree coding for my project Pin
Dave Kreskowiak14-Oct-09 8:51
mveDave Kreskowiak14-Oct-09 8:51 
AnswerRe: ID3 desicion tree coding for my project Pin
Ashfield15-Oct-09 1:35
Ashfield15-Oct-09 1:35 
QuestionSNMP in VB ! Simple GET request please Pin
Budykiller14-Oct-09 6:42
Budykiller14-Oct-09 6:42 
AnswerRe: SNMP in VB ! Simple GET request please Pin
Dave Kreskowiak15-Oct-09 5:16
mveDave Kreskowiak15-Oct-09 5:16 
QuestionVBScript <--> Command Line Window Pin
brb18314-Oct-09 6:01
brb18314-Oct-09 6:01 
AnswerRe: VBScript <--> Command Line Window Pin
Dave Kreskowiak14-Oct-09 6:34
mveDave Kreskowiak14-Oct-09 6:34 
GeneralRe: VBScript <--> Command Line Window Pin
brb18314-Oct-09 7:08
brb18314-Oct-09 7:08 
GeneralRe: VBScript <--> Command Line Window Pin
Dave Kreskowiak14-Oct-09 8:20
mveDave Kreskowiak14-Oct-09 8:20 
Generalwatchdog Pin
David Mujica14-Oct-09 9:35
David Mujica14-Oct-09 9:35 
QuestionGetting an Error. Pin
JollyMansArt14-Oct-09 5:05
JollyMansArt14-Oct-09 5:05 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.