Click here to Skip to main content
15,915,702 members
Home / Discussions / C#
   

C#

 
QuestionHow do you cast an IntPtr to a struct in .NET? Pin
Mattingly16-Feb-03 13:13
Mattingly16-Feb-03 13:13 
AnswerRe: How do you cast an IntPtr to a struct in .NET? Pin
Mattingly16-Feb-03 13:24
Mattingly16-Feb-03 13:24 
GeneralRe: How do you cast an IntPtr to a struct in .NET? Pin
Richard Deeming17-Feb-03 3:17
mveRichard Deeming17-Feb-03 3:17 
GeneralSpace Formatting Pin
Sovman16-Feb-03 13:03
Sovman16-Feb-03 13:03 
GeneralRe: Space Formatting Pin
Chris Meech17-Feb-03 4:58
Chris Meech17-Feb-03 4:58 
GeneralActiveDesktop Pin
centsi16-Feb-03 11:18
centsi16-Feb-03 11:18 
GeneralAdding a browser window Pin
draco_iii16-Feb-03 11:16
draco_iii16-Feb-03 11:16 
GeneralRe: Adding a browser window Pin
Furty16-Feb-03 12:11
Furty16-Feb-03 12:11 
GeneralRe: Adding a browser window Pin
gadgetfbi17-Feb-03 12:25
gadgetfbi17-Feb-03 12:25 
QuestionWhy is my call to SetWindowLong failing? Pin
Mattingly16-Feb-03 11:15
Mattingly16-Feb-03 11:15 
AnswerRe: Why is my call to SetWindowLong failing? Pin
centsi16-Feb-03 11:28
centsi16-Feb-03 11:28 
GeneralRe: Why is my call to SetWindowLong failing? Pin
Mattingly16-Feb-03 11:58
Mattingly16-Feb-03 11:58 
AnswerRe: Why is my call to SetWindowLong failing? Pin
leppie17-Feb-03 6:04
leppie17-Feb-03 6:04 
GeneralRe: Why is my call to SetWindowLong failing? Pin
Mattingly17-Feb-03 20:37
Mattingly17-Feb-03 20:37 
GeneralRe: Why is my call to SetWindowLong failing? Pin
leppie18-Feb-03 3:19
leppie18-Feb-03 3:19 
GeneralXP App Crash SendReport Sample Pin
Amber Star16-Feb-03 7:37
Amber Star16-Feb-03 7:37 
GeneralRe: XP App Crash SendReport Sample Pin
leppie16-Feb-03 9:28
leppie16-Feb-03 9:28 
GeneralRe: XP App Crash SendReport Sample Pin
Nick Parker17-Feb-03 1:45
protectorNick Parker17-Feb-03 1:45 
GeneralRe: XP App Crash SendReport Sample Pin
Richard Deeming17-Feb-03 3:21
mveRichard Deeming17-Feb-03 3:21 
GeneralRe: XP App Crash SendReport Sample Pin
leppie17-Feb-03 4:21
leppie17-Feb-03 4:21 
GeneralRe: XP App Crash SendReport Sample Pin
David Stone17-Feb-03 10:40
sitebuilderDavid Stone17-Feb-03 10:40 
GeneralRe: XP App Crash SendReport Sample Pin
leppie18-Feb-03 6:30
leppie18-Feb-03 6:30 
GeneralA small explanation needed Pin
sacoskun16-Feb-03 4:06
sacoskun16-Feb-03 4:06 
GeneralRe: A small explanation needed Pin
Stephane Rodriguez.16-Feb-03 4:50
Stephane Rodriguez.16-Feb-03 4:50 
kromozom wrote:
What is the function of "(Book)" here?

Every Book is an Object, since by design in .NET all classes derive explicitly or implicitly from the Object class.

But not every Object is a Book, hence the need to cast.

That said, casting is mostly unsafe, and may produce an exception at run-time.

The best way to avoid casting is to either derive a specialization of HashTable (like the specialized string arrays derive from ArrayList), or use generics when it's supported (.NET 2.0 release).
GeneralRe: A small explanation needed Pin
sacoskun16-Feb-03 11:43
sacoskun16-Feb-03 11:43 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.