Browsed by
Month: February 2012

Loading an icon from a file (Win32)

Loading an icon from a file (Win32)

I’m always perturbed by how difficult it is to load an icon in Win32 at times.  So many HICON/HANDLE and whatnot special data members and folks on forums doing strange stuff.  Here’s a snippet of code that just loads a simple icon file and displays it as your executable icon.  I’m sure there is a more correct/newer/snazzier way to do this – but this works fine for me…

LPCTSTR iconPathName= L"../MyIcon.ico";
UINT icon_flags = LR_LOADFROMFILE | LR_DEFAULTSIZE;
HANDLE hIcon = LoadImage(hInstance, iconPathName, IMAGE_ICON, 0, 0, icon_flags);

// set up RegisterClass struct
wcex.style            = CS_OWNDC | CS_HREDRAW | CS_VREDRAW;
wcex.lpfnWndProc    = WndProc;
wcex.cbClsExtra        = 0;
wcex.cbWndExtra        = 0;
wcex.hInstance        = hInstance;
wcex.hIcon            = (HICON) hIcon;
wcex.hCursor        = LoadCursor(NULL, IDC_ARROW);
wcex.hbrBackground    = (HBRUSH)(COLOR_WINDOW+1);
wcex.lpszMenuName    = NULL;
wcex.lpszClassName    = m_AppTitle.c_str();

// register the window class
return RegisterClassEx(&wcex);

The Spy Who Loved Me – Ian Flemming

The Spy Who Loved Me – Ian Flemming

Shesh!  Book reviews galore.  Looks like I’ve been having too many boring drives home.  Anyway, on to a new book: one of Ian Flemming’s  James Bond stories.

This one is “The Spy Who Loved Me”.  It was another short read at 6 discs, or about 5 days of commuting.  If you’ve never had the honor, you should really read one of Ian Flemming’s Bond books.  The first thing you’ll note is that the movies have just about nothing to do with the stories they are named after.  Sure, there is a character named James Bond who is a spy; a damsel in distress, some evil characters, but that’s where things depart.

In this case, we have the story of a young French Canadian who is working her way across country doing odd jobs as she goes to pay the way.  As our story starts, she is working at a vacation motel at the end of it’s season.  On the last night, some unsavory gentlemen appear as does James Bond (by pure chance).  Bond’s debonair manner and gunplay ensue as he and our night clerk try to figure out and foil our villains’ evil plot without getting killed.  Being a short book, all the adventure really takes place at this one motel  There’s no evil mastermind plotting to destroy the world or counterespionage intrigue.  Just a great little compact story of an adventuresome night spent at a motel.

And for that, it’s a great little story.  Sure, it’s a bit dated with the girls being called dolls and whatnot, but it’s still a pretty good story overall.  Unlike a number of other Bond books, this one doesn’t have as much blatant bigotry you’ll find in some of Fleming’s other novels.  Instead, you get a good little story with some tight action sequences and a good finish.  I enjoyed it.

While nothing earth-shattering will happen here, but it’s still an enjoyable little pulpy adventure. I give it a B.

John Carter of Mars – Book 1 – The Princess of Mars

John Carter of Mars – Book 1 – The Princess of Mars

It appears yet another book is being made into a movie.  This time it’s the John Carter of Mars series by Edgar Rice Burroughs.  I just finished book 1 of this 6 part series – A Princess of Mars.

First off, some interesting tidbits about Edgar Rice Burroughs.   Burroughs had a very difficult early go in life despite his promising start.  He was born to a prosperous family in 1875. He served in the 7th Calvary in WW I but never saw action due to a heart problem.  After his discharge, however, he worked at all sorts of odd and very low-paying jobs such as railroad policeman, office manager, and even pencil sharpener wholesaler.  None of these endeavors were  successful and he and his small family lived in near poverty for many years.  At 35, he wrote the Mars series for All-Stories magazine.  This started his writing career and lead to a great number of works including the most famous, the Tarzan series.

But back to the book.  This was a quick audiobook ‘read’ coming in at only 6 discs, or 6 hours, of listening.  The first thing that will strike you is the tone.  You can tell this was written in turn of the 1900’s language and style.  The men speak more like English gentlemen and the ‘science’ part of the sci-fi is problematic and dated to say the least. Still, he does get a number of things partly right – which is pretty good considering what was known of other planets at the time.

Our hero, John Carter, is transported to Mars via an encounter in a mystical cave.  Once there, he has the strength of 20 men and can leap great distances with little effort due to the low gravity of Mars.  He encounters the warlike green men of Mars and earns a place with them through combat.  During his adventures with the green men, he meets the captured humanoid princess Dejah Thoris.  His attempts to win her hand and save both her and her city Helium from various armies leads to epic battles and adventures.

The battles and fights certainly portray the signs of Burroughs’ times.  There are clear echos of white man vs Indian/’savage tribe’ attitudes, battles that themselves would be considered brutal and morally questionable by today’s standards.  But that does not terribly detract from the story.  In fact, if anything, it add something Burroughs never expected: historical insight.  In many ways, Burroughs’ writing echos the prevailing attitudes towards indigenous peoples and what was considered the height of culture and understanding of his days.  It’s a good reminder to always have a healthy dose of skepticism as to our own perceived ‘we know much better and are so much more sophisticated’ attitudes and political/social agendas.  In some ways, his world is much more civilized such as in the case of the duel-like rules of personal combat.  In others, such as reasons for battle and killing every last man of your enemy, appear barbaric.

Still, with so much story to tell in such a short time – the writing is anything but eloquent.  One person has (mostly correctly) said it reads a lot like an adventure written towards teenage boys.  Sure, you can get some dialog exchanges that are simplistic to a point of being almost comical.  The sci-fi part is clearly dated and wrong in many ways.  This isn’t intellectual reading.  But is it a good story and worth the read?  Yep!

It’s a ride at a carnival.  The set pieces and characters are mostly painted walls, and the dangers only as real as you imagine them to be; but that doesn’t make it any less fun.  It’s an escape from the mundane into the somewhat ridiculous and far-flung.   It’s just good fun when you can see beyond the shortcomings and enjoy it for what it is.  A crazy romp to another planet where a southern gentleman meets and falls in love with the most beautiful woman he’s ever met with a pet monster as a bosom friend while swash-buckling his way through epic battles.

Overall, I give it a solid B and I’m looking forward to the movie version as there should be some great opportunities for crazy creatures and epic battles.

Mockingjay – Suzanne Collins

Mockingjay – Suzanne Collins

Just finished the third and final book of the Hunger Games trilogy.  In this final installment, Katniss is with the rebels and they are in a war to defeat the Capitol.  The stakes are high as she fights along with the other rebels in a winner-take-all war.  There’s not much I can say beyond that without giving out some serious spoilers.  So here they come.  Skip if you don’t want to know anything.

<Spoilers>
I have a lot of criticism for this book.

First off, people drop like flies.  Previous victors are killed off in rapid-fire succession like red-shirts on a Star Trek episode and very little is given to these losses other than passing sentiment.  Peeta is brutally brainwashed by Snow into wanting to kill Katniss.  This powerful story element was mostly flubbed by Collins and it quickly reverts to the tired love triangle theme that just continues to go nowhere for 90% of even this book.  Finally, the killing of her sister Prim has to be one of the most pointless, even sadistic, story elements from a writer I’ve run across in years.   The very fact Prim was where she was *ahead* of the front lines, and that the whole point of the death was to take Gale out of the love-triangle equation by means of some of the most feeble logic I’ve ever heard made me throw my hands up in frustration at Collins.

As a core theme, the love triangle, just gets completely flubbed with cheap moves.  I’d hoped something good would come of it and see our characters bloom into something rich and heartwarming despite the surrounding destruction.  Mostly I just wanted to smack the three of them and Collins’ poor handling.  Despite each of their flaws, I wanted to hear Peeta or Gale have an epiphany and confess their love for her in some heartfelt and real expression of their inner self.  Katniss could have done likewise or actually *chose* one of them.  But instead of this, Collins merely makes Gale out to be a monster (on trumped up charges none-the-less) and Katniss ends up with Peeta kind of by default even though Peeta sees clearly that Katniss never really loved him.   Even this ‘resolution’ you don’t find out until the tacked-on epilogue.  And the reason she’s with Peeta?  The best answer you get is because she ‘owes’ him more as he did more for her earlier.  Really?  That’s why you marry someone? And that’s what you do with a story element going on for 3 books?

For those that at least enjoyed Haymitch’s presence: this staple, interesting and ever-working in the background character in the first books is barely even present in this one.  Felt he was completely under-utilized.

Turning the Capitol into deathtraps, and having custom-bred dogs that whisper Katniss name felt like overdone and feeble attempts to recapture the interesting Hunger Games theme – but mostly didn’t work and it was too little, too late.

The storytelling itself was disjointed and spotty.  Big gaps of time with hard landings left some of the story hard to follow and further exaserbated the feelings of disconnectedness with the characters.

Finally, Katniss.  She suffers badly from PTSD effects through most of the book, several times getting drugged into oblivion so she can just hang on.  She does take on the role of the Mockingjay – but that role never really goes anywhere and Collins absolutely blows a great opportunity to make that a much more powerful symbol.  Instead, all it turns into is a propaganda piece that Katniss herself isn’t very interested in.   But the big failing in my opinion is that Katniss doesn’t seem to grow as a person.  There are a few attempts to protest morally questionable activities like the bombing of the nut in district 2, but that doesn’t go anywhere. In fact, she shows quite the opposite of character and growth when she votes to throw the children of the Capitol’s leaders into one last Hunger Games (run by the rebels of all things) with no real discussion of the morality given.  It gets like 3 pages – bang – she votes to throw these innocent kids into the arena and nothing more is said.  Then, about 10 pages later, she coolly assassinates Coin without much of a second thought.  Overall, we’re left with a burned-out, war-scarred character that hasn’t shown any particular growth or hope.  I was left caring very little for her when I could have been there with her all along if she’d shown even one tenth the character, struggle, or growth you’d see with Frodo or other person in a titanic struggle like this.  It could maybe have been made a bit better with her at least started to find some sort of healing or hope at the end – but even that we don’t get.  I don’t need a fairytale ending – but there should be some sign of hope, change, or healing.

I don’t know if I would qualify this book as a teen book.  It’s got some pretty rough story lines and themes: PTSD, mental and physical abuse, drugged states to get through personal crises, many morally questionable activities (that don’t get questioned) and plenty of death and destruction. While these topics can be appropriate for teens if consequences and characters struggle to make right choices, but you get little of that. I didn’t find the way they were handled to be very productive or geared towards helping teen readers understand these topics.

There are some good points.  There is an interesting and clever bit about the power struggle between President Coin, President Snow and Katniss, but it just doesn’t make up for the other problems.

</Spoilers>

So, I had a lot more criticism of this book than good things to say and would even hesitate to call it teen-appropriate.  While it was a decent attempt to bring the elements to a close – the writing and story just fell apart in too many ways.  I was hoping for a lot out of this book – but it left me disappointed.  If you saw the story cracks in book 2, then those cracks are absolute canyons in this book.  You should probably read it to finish the trilogy since it’s only 10 audio discs (600 minutes); but don’t go into it expecting a very good story.  You just aren’t left feeling very connected or concerned about Katniss or most of the other characters (that manage to still be alive) by the end.  I was just glad this train-ride was over.  Sadly, the journey started so well in book 1 has turned into a destination to which I never want to go back.  Even as I sit here writing this I am thinking of ways in which this book could have been better.  Sigh.

I give this book a D+ rating.  It finished everything up; but left numerous problems with the morality of their choices, the plot, and the largely unsatisfying ending to the characters.

Catching Fire – Suzanne Collins

Catching Fire – Suzanne Collins

Finished book 2 of the Hunger Games trilogy over the holidays.  I’ll try to keep the spoilers to a minimum; but some details will come out.

<short plot summary with spoilers – so don’t read if you don’t want any idea of what happens>
So, this book takes off right after the end of the first book.  Katniss and Peeta are taking their victory tours around the different districts and then return home.  All throughout the districts, unrest is beginning to grow and they see Katniss as something of a touchstone or symbol for this rebellion despite the fact that she’s not trying to appear or play into these ideas.  She returns home to her district and begins life in the victors village.  Meanwhile, every 25 years, the Capitol unveils another Hunger games called the ‘quarter quell’.  This being the 75th year since the rebellion, so it’s a quell year and quell years have special rules.  This year, the combatants in the arena don’t come from tributes – but from the roster of previous victors.  This means that Katniss has to come back to the arena.  She does so, and the ending sees a dramatic end to the games that results in disruption of them and the survivors being yanked from them either by the capitol or the rebel forces.
<summary end>

I found this book an organic continuation of the previous book.  Style and voice were nearly identical.  So, if you liked the first one, you’ll like this one too – maybe more so.  I did find that the Hunger games that occurs in this episode to be unique in its challenges and style.  Very creative and imaginative – and maybe even better than the first one really. But don’t expect any differences in how it’s told or develops from a story reading or style of character point of view.  It will feel just like reading the first one.

If I had any gripes at this point – it would be about Katniss character development.  I had hope we’d get more answers after the first book and become more emotionally attached to her as she struggles with this adult-making decisions.  Instead, I found myself becoming increasingly bored/frustrated/irritated with her at times.  She waffles continually between her feelings for Peeta and Gale, between obeying the Capitol to joining the rebellion, about what she was even doing with the berries in the arena, about ….every major plot point.  In the end, she doesn’t even choose/make decisive or clear decisions on most of these really important points in this book.  In the ones she does choose, it feels more like a decision between what externally looks better to downright ‘flip of the coin’ type of deciding than anything else.  I just wasn’t convinced by the logic behind the choices she made or believed the inner dialog as she worked it out.  She questions her own motivations so much at times that it doesn’t sound like any choice is made at all.  There were times that it seemed kind of obvious why she had made certain decisions – but she just wouldn’t admit them to herself.  And the author didn’t either.  Maybe this is what being a teenage girl is about; but it makes for some tedious reading and makes her appear to be a much less ‘likeable’ character who is making a real stand for something or growing markedly to adulthood by having to mature through them.  Maybe someone could enlighten me, but maybe this is just because the book is suffering from ‘middle-trilogy book’ syndrome in which you want to keep things going, but make sure you have enough for the last book.

Overall, I’d give the book a solid C+/B- for being a good, quick read and having good arena scenes.  At 9 discs, it made for about a week and a half of commute-time listening.

I’ve already started on the final book, Mockingjay – and we’ll see where that goes.

Sony MDR-V6 headphone replacement ear pads

Sony MDR-V6 headphone replacement ear pads

After 5+ years of using these continually award-winning $120 headphones, the covering on the ear pads we’re starting to flake off and leave little black flakes around.  A common problem.  At under $7/each – and designed for easy replacement – getting replacement earpads was considerably cheaper than getting a new set of headphones.  Finding replacement pads, however, was somewhat difficult.  People had 3rd party pads, but the last replacement set I bought previously didn’t last much more than a year.  I went to Sony’s store, but didn’t have much luck finding them on their parts site.  Anyway, jumped on chat and got the skinny:

https://servicesales.sel.sony.com/ecom/accessories/web/productSearch.do
Once you’re there, please choose any of the items below (remote, adapter, etc). Then it will lead you to a new page and on the upper right hand there is a search box in which you can enter a search by part number.  Enter the part number and on the drop down menu, please choose “part number”.

Sony part number: 211566803
MDR-V6 headphone replacement ear pads – 211566803

They’ll show up as super-generic: PAD, EAR, but should be what you need.  Or at least I hope, since I just ordered them. 🙂