Jump to content

Recommended Posts

Posted

This is really a FFS! but makes more sense here.

 

A MSDN dotNet 2 reference talks about a 5 second interval and says "[X] will be lost", whereas the dotNet 3 version talks about a 6 second interval and says "[X] will be delayed". The difference between them will make or break any typical program using this bit of the APIs.

 

The calls they are talking about live in the same DLL and that's exactly the same dotNet 2 DLL regardless of whether you have dotNet 2 or dotNet 3 installed (dotNet 3 essentially being dotNet 2 plus some new libraries).

 

Maybe if 65535 people all hold hands and chant "It is a dotNet 3 DLL!" for long enough they'll move a few electrons and it it will work as documented in the dotNet3 description. Dunno..

 

Then I found someone who actually tested their code and accidentally proved the dotNet 2 take on the matter, which means a lot of smug example code on blogs and the like is broken.[1]

 

--

 

And then you meet a incomprehensible MSDN description of some number you need to play with.. and all the code I found out there took it at face value.. that to derive Y from 32-bit number X you mask the top two bits.. when in fact X is definitely a 64-bit number and to get Y you mask the top 32 bits.

 

[1] Reminds me of the 27 "expert" blogs and columns I found on getting started with 2K8 beta 3 Server Core with exactly the same, but absolutely broken netsh command line. I suppose they either stole or were handed the recipe by MS, despite clearly suggesting to us gullible readers that they had personally gone through and sweated over the process.

Posted

You can do this all day... on some collection MSDN says it's not immutable (=mutable=might change while you're trying to do things with it) so you should NOT iterate it with a for loop.

 

The code examples below that advice iterate it with a for loop.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now



×
×
  • Create New...