C Run-Time Error R6025 pure virtual function call

C Run-Time Error R6025 pure virtual function call

I did a bad bad thing.

Not so bad.  Calling a virtual pure function using a pointer to the abstract base class, or calling  it before the derived class has been initialized (in the constructor of the abstract class for example), is a no no.  I did the latter.

Here is Microsoft’s explanation:

No object has been instantiated to handle the pure virtual function call. This error is caused by calling a virtual function in an abstract base class through a pointer which is created by a cast to the type of the derived class, but is actually a pointer to the base class. This can occur when casting from a void* to a pointer to a class when the void* was created during the construction of the base class.

And an explanation and example of the exact thing I did:

   /* Compile options needed: none
   */ 

   class A;

   void fcn( A* );

   class A
   {
   public:
       virtual void f() = 0;
       A() { fcn( this ); }
   };

   class B : A
   {
       void f() { }
   };

   void fcn( A* p )
   {
       p->f();
   }

   // The declaration below invokes class B's constructor, which
   // first calls class A's constructor, which calls fcn. Then
   // fcn calls A::f, which is a pure virtual function, and
   // this causes the run-time error. B has not been constructed
   // at this point, so the B::f cannot be called. You would not
   // want it to be called because it could depend on something
   // in B that has not been initialized yet.

   B b;

   void main()
   {
   }

I was actually able to make the following adjustment:

Before:

A:A()
{
VirtualPureFunction();
}

B:B() : A()
{
}

After:

A:A()
{
// VirtualPureFunction(); //  Don’t call  here.  Derived object not guaranteed to be intialized
}

B:B() : A()
{
VirtualPureFunction(); // Safe to call here since A() constructor already called
}

Call of Duty Modern Warfare 2 Accolades

Call of Duty Modern Warfare 2 Accolades

Unstoppable: Longest killstreak
Sharpshooter: Most headshots
Wingman: Most assists
Devastation: Highest multikill
Clutch Player: Match Winning Kill
The Feared: Most kills
MVP: Most kills/Fewest deaths
Overkill: Most kills/Most headshots
Steamroller: Most kills/Longest killstreak
The Show: 10 kills/No deaths
Supernatural: Kill/Death ratio over 10
Decimator: Killed entire enemy team without dying
Immortal: Highest kill/death ratio
Juggernaut: Fewest deaths
Pathfinder Most UAVs
Top Gun: Most airstrikes
Air Ops: Most helicopters
Flanker: Most kills from behind
Blindfire: Most bullet penetration kills
Vengeful: Most paybacks
Avenger: Most avenger kills
Rescuer: Most rescues
Marksman: Most longshots
Upriser: Most kills of higher rank
Revenge: Most last stand kills
Executioner: Most execution kills
Genocidal: Most multikills
Rally: Most comebacks
Lifer: Longest life
Statuesque: Most stationary kills
Lights Out: Most tactical insertions prevented
Shell Shocked: Most explosions survived
Unbreakable: Most bullets deflected
Blinder: Most flashbang hits
Stunner: Most stun grenade kills
Hot Potato: Most grenades thrown back
None Spared: Killed entire enemy team
6th Sense: No deaths from behind
Switchblade: Most knife kills
Hard Boiled: Most pistol kills
Grenadier: Most grenade kills
Fragger: Most frag grenade kills
C4 Killer: Most C4 kills
Semtex Pro: Most semtex kills
Ambusher: Most claymore kills
Butcher: Most throwing knife kills
CQB: Most SMG kills
AR Specialist: Most assault rifle kills
Explosivo: Most rocket kills
Buckshot: Most shotgun kills
7.62MM: Most LMG kills
Sniper: Most sniper kills
Smoking Gun: Most pistol headshots
SMG Expert: Most SMG headshots
AR Expert: Most assault rifle headshots
Boomstick: Most shotgun headshots
LMG Expert: Most LMG headshots
Dead Aim: Most sniper headshots
Survivalist: Most equipment kills
Magnifier: Most scoped kills
White Hot: Most thermal kills
Exterminator: Most thumper kills
Crowd Control: Most riot shield kills
Hairtrigger: Most ADS kills (Aiming Down Sights)
Sprayer: Most hipfire kills
Alpha Male: Most kills of lower rank
Loaner: Most kills with enemy weapons
Nomad: Longest distance traveled
Runner: Most time spent sprinting
Sneaker: Most time spent crouched
Grassy Knoll: Most time spent prone
Spy Game: Most time watching killcams
Lock & Load: Most reloads
Weapon Rack: Most weapon swaps
Trigger Happy: Most shots fired
Lockdown: Most time spent in one place
High Command: Highest average altitude
Low Profile: Lowest average altitude
Nearsighted: Most friendlies shot
Grudge Match: Most kills of same player
Arsenal: Most weapons used
Undercover: Most time near enemies
Evolver: Most classes changed
Starter: Most killcams skipped
Participant: No kills/At least 1 death
Accident prone: Most suicides
Blindsided: Most deaths from behind
Clay Pigeon: Most deaths by shotgun
Terminal: Shortest life
Deathrow: Longest deathstreak
Hijacker: Most stolen kills
AFK: No kills/No deaths
Protester: Most deaths by riot shield
Warming Up: Just getting started PLUS the warming up accolade is for getting no other accolades in a private match, so you have to play a full length match in a private match and get no other accolades while doing it.
Bomb Expert: Most bombs planted
Defuser: Most bombs defused
Destroyer: Most targets destroyed
Bomb Blocker: Most bomb carrier kills
Bomb Threat: Most kills as a bomb carrier
Bomb Runner: Most bombs carried
Dominator: Most points captured
HQ Capturer: Most HQs captured
HQ Destroyer: Most HQs destroyed
Flag Capturer: Most flags captured
Flag Returner: Most flags returned
Flag Runner: Most flags carried
Flag Blocker: Most flag carrier kills
Double Threat: Most kills as flag carrier

Reading blogs with an aggregator

Reading blogs with an aggregator

The blogging experience has two parts. The first part is creating and maintaining a weblog. The second part is reading and keeping track of multiple weblogs using a dedicated program that works similar to a mail program.  Often referred to as RSS readers, feed readers, feed aggregators, news readers, or search aggregators,  these programs allows you to “subscribe” to various weblogs and not have to worry about what new information has been posted to each blog. The information will be pulled down and ready to read in the Newsreader at regular intervals, just like a mail program.  A special program is not required to read a weblog.  A weblog is always available through a browser.  But a specialized program is highly recommended.

I  recommend:

FeedDemon for Windows
NetNewsWire for Mac
GoogleReader for a  web-based reader.

The latest versions of mail clients like Outlook or Mac Mail have built in support for RSS as do many browsers.    There are also RSS  readers for tablets and smartphones.

(Updated Aug 10, 2011)

Home Videos on your TV

Home Videos on your TV

I posted before my goal of having all my home videos available for viewing on my HDTV in the living room.  The XBOX hasn’t quite delivered.  Lo and behold I recently gave my PS3 another try and it does circles around the XBOX! I can view all my MPEG2 video using the free TVersity Media Server application running on my PC.  I can now get rid of all the lower quality .MP4 files I created for the XBOX.  Maybe the XBOX will one day be updated to allow it to stream the same MPEG2 files; or perhaps it would work today if I knew how to set it up better.  I wonder if the iPad with iTunes running on my PC will be able to stream my video; if it can it will probably be limited to what formats it will stream (QuickTime).

I ran into the following error message on the PS3 while trying to connect to TVersity:

Media Server Error: DLNA Protocol Error (501) has occurred.

This thread lead me to this solution on the TVersity site.

The iPad is here

The iPad is here

Yeah, I’m pretty sure I want one.   I did not run out and buy an iPhone.  I never thought it was worth the price of the monthly cell + data plan.  For sometime now, I have been watching TV shows and movies on my MacBook Pro; Cassidy has too.  She is always borrowing it on weekends to catch up on the network shows she doesn’t have time during the week to watch.  We settle in, in our favorite place on the coach, or in our bedroom, put on some headphones and have a close-up immersible experience on the laptop.  So the iPad is in effect, our second “laptop” but in a form factor that is better tailored to that personal intimate experience on the coach.  It’s not a small laptop, it’s a big iPod Touch (oh, we have 3 of those in the house).  It does not run Mac desktop software, but instead runs iPod apps plus the software that comes on it.

A pleasant surprise was the price!  I feared it would start at $1000 but the WiFi-only model starts at $500 for the 8gig model, $600 for 16gig and $700 for 32gig.  It will be available in March. In April the Wi-Fi + 3G version comes out and will be priced $629, $729, and $829.  Again there’s that data plan for 3G which I feel I can live without.

Recovering GamerTag on a new XBOX

Recovering GamerTag on a new XBOX

We just got back our XBOX that was freezing up. Turns out Microsoft was willing to fix it free of charge because it was a Core system.  This system has already been sent in for the red ring of death.

This first Core XBOX I bought used, was a huge bundle. It came with a hard drive, wireless adapter, driving wheel, a custom Gears of War metal carrying case, lots of games, controllers, wireless headset, charging units, Memory Unit.

Microsoft sent a replacement unit which has a new Serial #.  On boot up I had to answer some first-time questions as a brand new system.  I didn’t have any problem with my XBOX live profiles (FrostySlam and  SuperSlam2)  because I keep those on MUs so David and I can play on either one of our two systems.    If  I had kept our XBOX live profiles on the hard drive, it would have been another story.

Tonight a friend called because he had just gotten back HIS XBox  from the Microsoft repair center, but after connecting his Hard Drive his XBOX Live gamertag was missing.  I suggested he needed to recover the gamertag.  I researched a bit and found out why he had to do this.

When you download content, the content is registered to the gamertag that downloaded as well as to the XBOX that it was downloaded on.  That means ANYONE can use the content on that XBOX, like extra map-packs to Call of Duty or Arcade games (without having to connect to XBOX Live).  In addition, you can re-download and use that content on any other XBOX as long as you are logged in using the gamertag that downloaded the content.  That works out great for us because an extra purchase can be used by both David and I as long as we download on one XBOX, then take the gamertag to the other and download and  use it there.

In addition, it seems that the gamertag is also somehow tied to the xbox on which it was purchased.  So simply replacing the hard drive isn’t going to allow the gamertag to be active on that xbox, hence the need to recover a gamertag on a new xbox even though you connect the hard drive that had the gamertag stored on it.

My friend, having the worst luck, ran into one more problem as he was recovering his gamertag on the new XBOX. He got the message “cannot find a storage device or not enough space to recover game tag”.  He needed to go Settings…Memory…Gamer Profiles and delete his XBox live gamertag (it showed up THERE) because it was apprently corrupt.  That allowed him to recover his gamertag again.

A few posts on the subject: 1 2 3

Ascii Emoticons

Ascii Emoticons

I needed a mischievous emoticon so I looked for one on Google.

Thought I would post some here for future reference.  Emoticons you can type are referred to ascii emoticons as opposed to icons that are inserted in email or IM.

From  WindWeaver:

HAPPY, SMILING, LAUGHING
:-)     smiling; agreeing
:-D    laughing
|-)      hee hee
|-D    ho ho
:->     hey hey
;-)      so happy, I’m crying
:’-)     crying with joy
\~/     full glass; my glass is full

TEASING, MISCHIEVOUS
;-)      winking; just kidding
‘-)       winking; just kidding
;->     devilish wink
:*)      clowning
:-T      keeping a straight face

AFFIRMING, SUPPORTING
:^D    “Great! I like it!”
8-]     “Wow, maaan”
:-o     “Wow!”
^5      high five
^        thumbs up
:]       Gleep, a friendly midget who wants
to befriend you
(::()::)   bandaid; offering help or support

UNHAPPY, SAD
:-(    frowning; boo hoo
:(      sad
:-<    really sad
:-c    really unhappy
:-C   really bummed
&-|   tearful
:’      crying
:’-(   crying and really sad
:-|     grim
:[      really down
:-[     pouting
\_/    “my glass is empty”

ANGRY, SARCASTIC
>:-<   angry
:-||      angry
:-@    screaming
:-V     shouting
:-r      sticking tongue out
>:-<   absolutely livid!!
:-,      smirk
:-P     nyahhhh!
:->     bitingly sarcastic
TRYING TO COMMUNICATE
:-&    tonguetied
:-S     incoherent
:-\      undecided
:- I     “hmmm…”
:-,      “hmmm ”
:-#     “My lips are sealed”
:-X    “My lips are sealed”
:-Y     a quiet aside
:-”      pursing lips
:-W    speaking with forked tongue
:( )     can’t stop talking

FEELING STUPID OR TIRED
:~/     mixed up
%-)    braindead
(:I      egghead
<:-I    dunce
=:-)    hosehead
:-]      smiling blockhead
:-[      un-smiling blockhead
|-O    yawning
|-I      asleep
:-6     exhausted; wipeout

SURPRISED, INCREDULOUS, SKEPTICAL
:>    What?
:@   What?
:Q    What?
:-o   “uhh oh!” OR surprise
;-)     sardonic incredulity
:O     shocked
8-|    eyes wide with surprise
:-/     skeptical
8-O  “Omigod!!”
:-C    just totally unbelieving
|-{    “Good Grief!” (Charlie Brown)

HUGS AND KISSES
: *      kisses
:-X     a big wet kiss!
:-x      kiss kiss
:-{}    blowing a kiss
[]        hugs
(( )):**    hugs and kisses
((((name))))   hug

MISCELLANEOUS
:-*      Oops!
:-I       indifferent
\-o      bored
:-P      tongue hanging out in anticipation
O :-)   angelic; being an angel (at heart, at least)

NEW  EMOTICONS (by Tracy Marks):
][       feeling separate
] [      separating
)  (     really separating
{ }     face-to-face
[ ]      wanting to hug
}xx    kisses
()       feeling in harmony; connecting
] ?     moving away and wondering about you?
[ ?     moving toward you and wondering about you?

From Yahoo Messenger 9:

Sherlock Holmes (2009)

Sherlock Holmes (2009)

Sherlock  Holmes ****  Not your normal Sherlock  Holmes. Robert  Downey plays a funnier, grittier, more action packed version.  Jude Law plays Dr. Watson.  One of my favorite actresses Rachel McAdams,  plays his old girl friend.  I bit hard to understand (english accents) and follow for the younger set (I saw it with David) but enough action to keep them interested.

Gmail Tips

Gmail Tips

I have a Gmail account that I use to login to Google properties such as Google Docs.  Gmail  is not  my primary email  account.  I’ve started using it more;  for LBJ class reunion stuff for example.   I’ve used it quite a bit as a “throwaway” email when sites ask for an email address but I don’t want to give them my personal email.  I highly recommend it to anyone as either a primary or secondary address.  There are  two main things I like about  Gmail that I think everyone should take advantage of.

1.  Have Google forward all mail to your primary address.  That way you don’t ever have to login to Gmail and for all  practical purposes, you can use your primary mail to receive and reply to people using your Gmail account.  Of course if you  don’t want people knowing your primary account, they you would login to Gmail  and respond from there.  Setup forwarding by clicking Settings in the upper right corner…select the Forwarding and POP/IMAP  tab…Select forward a copy of incoming mail  to…enter your primary email address…choose what to do with the mail that arrives in your Gmail  account.

2. Take advantage of a little known feature that allows you to create NEW email addresses on the fly!  My email address is alankley@gmail.com.  I can give out alankley+facebook@gmail.com, alankley+anything@gmail.com and those email addresses will be delivered to my Gmail mailbox.  I’ve created quite a few like that when I’m asked for an email address. That way I can turn them off if I start receiving spam or I can setup filters to file them away or forward them.  Not all websites accept an email  with a ‘+’ in it but many do.  Here is the Google Help page on the subject:  Using an Address Alias

If you are concerned about the safety of your information using Google Gmail and Docs, I wrote this post on what I think of that.

Update: 10/11/2019

To help cleanup your GMail account here are some search options you can use to list older emails you can delete, or locate emails with attachments:

before: 2019/01/01
larger: 1m
has:attachment larger:5MB

Find the full list here.

Locate unread emails from primary inbox: “category:primary is:unread”