Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Visual Basic > VB.NET 1.0 > Pro VB.NET 2002/2003
Password Reminder
Register
| FAQ | Members List | Search | Today's Posts | Mark Forums Read
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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old December 15th, 2004, 02:53 AM
Registered User
 
Join Date: Dec 2004
Location: , , .
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

Reply With Quote
  #2 (permalink)  
Old December 18th, 2004, 08:45 PM
Friend of Wrox
 
Join Date: Jul 2003
Location: York, , United Kingdom.
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

Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


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



All times are GMT -4. The time now is 06:37 AM.


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