Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Visual Basic > VB.NET 1.0 > Pro VB.NET 2002/2003
|
Pro VB.NET 2002/2003 For advanced Visual Basic coders working .NET version 2002/2003. Beginning-level questions will be redirected to other forums, including Beginning VB.NET.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Pro VB.NET 2002/2003 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old December 15th, 2004, 02:53 AM
Registered User
 
Join Date: Dec 2004
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default "Input string was not in a correct format."

I'm having a problem with some of my VB.net code, particularily in one of my thread synchronization methods.
Code:
        Private Sub FireRecv(ByRef socket As TcpClient, ByVal data As String)
            If mSync.InvokeRequired Then
                mSync.Invoke(New dData(AddressOf FireRecv), New Object() {socket, data})
            Else
                RaiseEvent onDataRecv(socket, data)
                doCommand(data) 'This is to get around not being able to listen to my own events
            End If
        End Sub


The line "mSync.Invoke(New dData..." is throwing an error that reads "Input string was not in a correct format.". I can't find what is causing this, the string in question is not null, I have added .ToString to everything I could find and nothing! It's really bugging me.
James

 
Old December 18th, 2004, 08:45 PM
Friend of Wrox
 
Join Date: Jul 2003
Posts: 142
Thanks: 0
Thanked 2 Times in 2 Posts
Default

You've probably tried this, but...

I'm presuming mSync is a MethodInfo object...

How have you created it - i.e. has it been created from a dData object, and if so is this still in scope? It may be worth trying to use this rather than creating a new dData object.

The other thing to check is whether, if you create a new dData object and then do dData.Sync (or whatever is the name of the method mSync relates to) and pass in the relevant parameters. Does it work then? If so, there's a problem with how reflection is being used, otherwise there is something wrong with your parameters.

Quote:
quote:Originally posted by keane
 I'm having a problem with some of my VB.net code, particularily in one of my thread synchronization methods.
Code:
        Private Sub FireRecv(ByRef socket As TcpClient, ByVal data As String)
            If mSync.InvokeRequired Then
                mSync.Invoke(New dData(AddressOf FireRecv), New Object() {socket, data})
            Else
                RaiseEvent onDataRecv(socket, data)
                doCommand(data) 'This is to get around not being able to listen to my own events
            End If
        End Sub


The line "mSync.Invoke(New dData..." is throwing an error that reads "Input string was not in a correct format.". I can't find what is causing this, the string in question is not null, I have added .ToString to everything I could find and nothing! It's really bugging me.
James






Similar Threads
Thread Thread Starter Forum Replies Last Post
Input string was not in a correct format Dwizz VB.NET 2002/2003 Basics 8 April 29th, 2010 05:56 AM
Input string was not in a correct format. Silfverduk VB.NET 2002/2003 Basics 1 May 20th, 2006 04:58 AM
input string was not in a correct format kunal.net VS.NET 2002/2003 1 October 11th, 2005 12:18 AM
Input string was not in a correct format Dwizz VB.NET 2002/2003 Basics 2 April 4th, 2005 11:03 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.