1 Replies - 2512 Views - Last Post: 05 December 2010 - 09:23 PM Rate Topic: -----

#1 _HAWK_  Icon User is offline

  • Master(Of Foo)
  • member icon

Reputation: 1055
  • View blog
  • Posts: 4,086
  • Joined: 02-July 08

EndOfStream Not Working!

Posted 05 December 2010 - 08:06 PM

I am reading a file like I always do, created the same way I always do, and EndOfStream never returns True:
Using sr As New StreamReader(filePath)
   While Not sr.EndOfStream
      'do stuff with Readline
   End While
End Using


The only diff is I am using Windows 7. Any Ideas?

The error:

Quote

The CLR has been unable to transition from COM context 0x8683f0 to COM context 0x868560 for 60 seconds. The thread that owns the destination context/apartment is most likely either doing a non pumping wait or processing a very long running operation without pumping Windows messages. This situation generally has a negative performance impact and may even lead to the application becoming non responsive or memory usage accumulating continually over time. To avoid this problem, all single threaded apartment (STA) threads should use pumping wait primitives (such as CoWaitForMultipleHandles) and routinely pump messages during long running operations.


Is This A Good Question/Topic? 0
  • +

Replies To: EndOfStream Not Working!

#2 _HAWK_  Icon User is offline

  • Master(Of Foo)
  • member icon

Reputation: 1055
  • View blog
  • Posts: 4,086
  • Joined: 02-July 08

Re: EndOfStream Not Working!

Posted 05 December 2010 - 09:23 PM

Ok here's the fix. If you accidentally miss label the defaultExt on your OpenFileDialog - it like super messes up the whole thing. It was in a function elsewhere and didn't see it initially. Silly me :stupid:
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1