Featured post

c# - Usage of Server Side Controls in MVC Frame work -

i using asp.net 4.0 , mvc 2.0 web application. project requiremrnt have use server side control in application not possibl in noraml case. ideally want use adrotator control , datalist control. i saw few samples , references in codepleax mvc controllib howwver found less useful. can tell how utilize theese controls in asp.net application along mvc. note: please provide functionalities related adrotator , datalist controls not equivalent functionalities thanks in advace. mvc pages not use normal .net solution makes use of normal .net components impossible. a normal .net page use event driven solution call different methods service side mvc use actions , view completly different way handle things. also, mvc not use viewstate normal .net controlls require. found article discussing mixing of normal .net , mvc.

windows - Any reason I shoudn't add GUID validation to my Visual C++ program? -


in order make visual c++ program more robust i'm tempted insert checks guid variables contain valid version 4 guids (and not left uninitialized):

guid guid; uuidcreate( &guid ); // many lines of code later... // following assert should not fire valid version 4 guids int data3 = guid.data3; assert( ( data3 >> 12 ) == 4 ); 

i'm sure guids either come within uuidcreate() function or uninitialized variables (and latter i'd diagnose checks). concern microsoft change guid implementation in future versions of windows.

what other factors should consider decide whether such checks won't hurt? how guid implementation changes on future versions of windows?

my concern microsoft change guid implementation in future versions of windows.

deal it, if happens. no, seriously, worry implementation of integer, microsoft decide switch .net datatypes , make integer system-wide 4-byte value.

worry other things, if implementations changing, you'll have rewrite/change/fix program anyway.

edit: if understand right, you're worrying return value of function, not guid-structure itself. , mean @ moment can return either guid or uninitialized value, in future implementations might return 0-filled-guid?

in case stick first paragraph, worry if happens. @ moment function has defined behavior, work that. check uninitialized values , that's it. can't guess microsoft in future (hell, microsoft can't).


Comments

Popular posts from this blog

c# - Usage of Server Side Controls in MVC Frame work -

cocoa - Nesting arrays into NSDictionary object (Objective-C) -

ios - Very simple iPhone App crashes on UILabel settext -