Recent content by froodley

  1. froodley

    Catch block question

    Apologies for not formatting. My point was that the second version works, obviously, because the second try-catch structure is catching the error thrown by the inner one. The first version doesn't work the same way; the error thrown by the se catch block is uncaught. It was my understanding...
  2. froodley

    Build/publish two copies at once

    Hi, all, I'm looking for a way to have my code build two copies of itself at once. The program has an "A" and a "B" configuration that need to be compiled as Prog-A.exe and Prog-B.exe every time the code is compiled. I can do this manually, but I assume there's some way to do it in code...
  3. froodley

    Enumerator failing...

    Ah. But I assume that still involves enumerating the list somewhere on the framework side? I'm more curious to know what's going on; the index method and your solution both work around the issue...
  4. froodley

    Catch block question

    I think I know the answer here... but... let's say you have a try catch block like this: try ... catch se as SpecialException ... if blah then throw new Exception("blah found") catch e as Exception if e.message = "blah found" then foo end try Why doesn't this work? if you nest it... try TRY...
  5. froodley

    = nothing

    Yeah, I see that now, sorry... I thought I had canceled that last post? Darn internet... But you can do x = Nothing comparisons for reference types as well, and it works as you'd expect as long as the type implements the = operator and just return object.equals(a,b)... eg, object.equals(x...
  6. froodley

    = nothing

    [post canceled ineffectively due to fingers]
  7. froodley

    = nothing

    Try this: You'll get 0, 0, fail. If you assign a value other than 0, you get ,eg, 7,7,7. Without the assignment (just x as new integer, then if x= nothing) you get fail.
  8. froodley

    Enumerator failing...

    Hi, all, I have a databound listbox. I was refreshing the binding, then using this code: For Each i As Object In this_lb.Items If CType(i, ClassA) = currentSelection Then this_lb.SelectedItem = i End If Next ...to...
  9. froodley

    = nothing

    Thanks, I do know to use IsNothing. I am just wonder what = Nothing does by comparison. :confused:
  10. froodley

    = nothing

    Hi, all, I'm just wondering what is actually happening when you do a comparison like "if myobject = nothing then..." in vb.net. I know it doesn't work, and use IsNothing, etc... i'm just curious what it's doing. why does it evaluate to true? if it's using the object.Equals method, that...
  11. froodley

    Why default to ByVal?

    Thanks :D Thanks for the feedback; it was helpful. I think I had gotten in the habit of using byref because I didn't want to incur overhead during iteration by having to make copies of everything. I realize it's just making copies of the reference for reference types, but doesn't this still...
  12. froodley

    Why default to ByVal?

    Hey, folks, Just kind of curious about something: why does VS (vb and C#) default params to pass-by-value? I almost never need or want to pass anything by value. Maybe this is some reflection on the way I code. I would never manipulate a value type param directly; i would just return the new...
  13. froodley

    Shortening DNS timeout for SOAP

    Thanks, I gave that a try... Unfortunately the Ping request takes the same amount of time to fail its DNS lookup. When it fails, it throws a PingException with an inner exception of type System.Net.Sockets.SocketException with this stack trace: at System.Net.Dns.GetAddrInfo(String name)...
  14. froodley

    Shortening DNS timeout for SOAP

    I tried the Timeout property; it only effects how long the application will wait for a response to an XML request. A DNS request is not effected. If I set the m_service.timeout property to 2000ms while I am online and can reach the service, the timeout for the XML request takes two seconds...
  15. froodley

    Shortening DNS timeout for SOAP

    Hi, all, I use a web service to access our internal databases. The problem I'm having is that a call to the service is part of my application startup, and when the computer is offline or the server is otherwise unreachable, the DNS call is taking much too long to timeout. I would like to set...
Top Bottom