Sunday, January 25, 2009

Windows Mobile madness

Windows Mobile madness

While some programming (yeah I do that) I came across this crazy weird thing happening causing a prefetch abort in execution.

For those who know the time_t datatype in C, it's defined in Windows Mobile in the most ambiguous way: In crtdefs.h as a 64 bit value and in stdlib.h in the Windows Mobile SDK (5 and 6) as an unsigned long (32 bits).

Visual Studio picks up the SDK definition at compile-time and link-time, BUT execution picks the crtdefs value if you have included crtdefs.h in your program before stdlib.h: EFFECT: Crash at runtime - try assigning a 64-bit type that's interpreted as a 32-bit one ... ARGH!

Took me a day and a tech-guru friend to walk through this to realize what was happening!

Gist: Include stdlib.h before crtdefs.h in case you are using time_t data-type in Windows Mobile Programming.
Since I am new to this world and HTML has never hit it with me, I am gonna start with simple editing, although I am sure HTML tags will make their way into my blog once I start putting examples.

Please bear with me if the blog formatting doesn't live up to your expectations - this is not one of those eye-catching blogs that is attempted to win awards for design.

Read the "content" and if you have any comments, post them. I love reading what people think and analyzing how people think.

Given all this, I am not justifying any shabbiness on my blog and have an internal desire to make it the best in all ways; so if you do have formatting comments, they are most welcome to make their way in comment postings here.
This is my nth (read 3rd) attempt at a blog.

Although the heading says "random musings", it's probably the most predictable title for any new blog. I am sure a statistical study will show that at least 20% of new bloggers use "random musings" in their title or description somewhere.

What makes this blog different (or should) is that these aren't random musings of any "thoughtless"/"spotless"/"demented"/"twisted' mind.

These are random musings of my mind - which is thoughtful more often than not.

We all come across various situations in life where we'd like to ramble and vent some energy. Most such situations come in technology for me and I can crib endlessly when in the process of getting something done; but during this process, I also learn things. Things that are sometimes so wonderful that it gives you a sense of accomplishment; things that are sometimes small gotchas; things that are sometimes such stupid mistakes that you feel like kicking yourself.

What better way to convert this learning into something useful for others than a WWW blog?

So here goes ...