Click here to Skip to main content
15,908,175 members

The Weird and The Wonderful

   

The Weird and The Wonderful forum is a place to post Coding Horrors, Worst Practices, and the occasional flash of brilliance.

We all come across code that simply boggles the mind. Lazy kludges, embarrassing mistakes, horrid workarounds and developers just not quite getting it. And then somedays we come across - or write - the truly sublime.

Post your Best, your worst, and your most interesting. But please - no programming questions . This forum is purely for amusement and discussions on code snippets. All actual programming questions will be removed.

 
GeneralRe: If, for some weird reason, you _have_ to use Hungarian in .NET, at least use it properly Pin
Rob Grainger17-May-07 5:57
Rob Grainger17-May-07 5:57 
GeneralRe: If, for some weird reason, you _have_ to use Hungarian in .NET, at least use it properly Pin
ricecake22-May-07 4:01
ricecake22-May-07 4:01 
GeneralRe: If, for some weird reason, you _have_ to use Hungarian in .NET, at least use it properly Pin
John R. Shaw25-May-07 13:53
John R. Shaw25-May-07 13:53 
GeneralRe: If, for some weird reason, you _have_ to use Hungarian in .NET, at least use it properly Pin
John R. Shaw25-May-07 13:48
John R. Shaw25-May-07 13:48 
GeneralRe: If, for some weird reason, you _have_ to use Hungarian in .NET, at least use it properly Pin
Arun.Immanuel17-May-07 3:00
Arun.Immanuel17-May-07 3:00 
GeneralRe: If, for some weird reason, you _have_ to use Hungarian in .NET, at least use it properly Pin
John R. Shaw17-May-07 4:09
John R. Shaw17-May-07 4:09 
GeneralRe: If, for some weird reason, you _have_ to use Hungarian in .NET, at least use it properly Pin
Arun.Immanuel17-May-07 4:19
Arun.Immanuel17-May-07 4:19 
GeneralRe: If, for some weird reason, you _have_ to use Hungarian in .NET, at least use it properly Pin
John R. Shaw17-May-07 5:11
John R. Shaw17-May-07 5:11 
Now days: unsigned char* p = (unsigned char*)0xB8000000L;
Old days: unsigned char _far* p = (unsigned char _far*)0xB8000000L;

Used to do stuff like that all the time to directly access video memory and other hardware, but modern operating systems do not allow that any more. Accept for older code, which it places in a sandbox (its own processing space) so it can keep an eye on it, and even then it may not allow it. Direct access now requires a driver down at ring 0 to access hardware directly, but there is usually something like DirectX that does it for you.

Note that both the addresses you mentioned are 32 bit and are therefore just ordinary pointers on a 32 bit machine.


INTP
"Program testing can be used to show the presence of bugs, but never to show their absence."Edsger Dijkstra

GeneralRe: If, for some weird reason, you _have_ to use Hungarian in .NET, at least use it properly Pin
Arun.Immanuel17-May-07 5:52
Arun.Immanuel17-May-07 5:52 
GeneralOr in C++ (MFC) for that matter... Pin
Rob Grainger17-May-07 2:38
Rob Grainger17-May-07 2:38 
GeneralRe: If, for some weird reason, you _have_ to use Hungarian in .NET, at least use it properly Pin
Vasudevan Deepak Kumar24-May-07 23:23
Vasudevan Deepak Kumar24-May-07 23:23 
Generalwhat is the difference in one _gc * and two _gc *? Pin
syedhasan14-May-07 23:18
syedhasan14-May-07 23:18 
GeneralRe: what is the difference in one _gc * and two _gc *? Pin
DavidNohejl15-May-07 0:24
DavidNohejl15-May-07 0:24 
GeneralRe: what is the difference in one _gc * and two _gc *? Pin
Pete O'Hanlon15-May-07 0:28
mvePete O'Hanlon15-May-07 0:28 
JokeRe: what is the difference in one _gc * and two _gc *? Pin
Vikram A Punathambekar15-May-07 2:32
Vikram A Punathambekar15-May-07 2:32 
GeneralRe: what is the difference in one _gc * and two _gc *? Pin
Pete O'Hanlon15-May-07 2:54
mvePete O'Hanlon15-May-07 2:54 
GeneralRe: what is the difference in one _gc * and two _gc *? Pin
Chris Losinger15-May-07 6:03
professionalChris Losinger15-May-07 6:03 
GeneralRe: what is the difference in one _gc * and two _gc *? Pin
Shog915-May-07 8:06
sitebuilderShog915-May-07 8:06 
GeneralRe: what is the difference in one _gc * and two _gc *? Pin
Chris Losinger15-May-07 8:23
professionalChris Losinger15-May-07 8:23 
GeneralRe: what is the difference in one _gc * and two _gc *? Pin
Shog915-May-07 8:46
sitebuilderShog915-May-07 8:46 
GeneralRe: what is the difference in one _gc * and two _gc *? Pin
Pete O'Hanlon15-May-07 9:17
mvePete O'Hanlon15-May-07 9:17 
GeneralFor loops and array Pin
Mladen Janković14-May-07 5:41
Mladen Janković14-May-07 5:41 
GeneralRe: For loops and array Pin
PIEBALDconsult14-May-07 6:12
mvePIEBALDconsult14-May-07 6:12 
GeneralRe: For loops and array Pin
Mladen Janković14-May-07 11:07
Mladen Janković14-May-07 11:07 
GeneralRe: For loops and array Pin
jhwurmbach21-May-07 22:57
jhwurmbach21-May-07 22:57 

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.