• Google Voice

    Posted on March 19th, 2010 Alan No comments

    I use Google Voice when I’m  on the  computer (which is most of the time) and I start receiving text messages from Jane or one of the kids.  Google Voice gives you a free phone # that can also receive and send text messages.  I can go to the Google Voice website and type in my messages using my computer keyboard, or read text messages received.   Google voice maintains a thread just like GMAIL.  You can do other things such as forward the # to another phone so that your primary phone rings if someone calls it.  It also transcribes voice messages into text messages!

    Here is a portion of what Google Voice looks like:

  • Mercurial For Source Control

    Posted on March 19th, 2010 Alan No comments

    It appears that Subversion is no longer where it’s at.  We now have Mercurial.

    Joel has a nice tutorial f or Mercurial.

    There is TortoiseHG for Explorer Integration which is what I installed which included Mercurial.

    Two plugins for Visual Studio exists as well: VisualHG, hgscc

    Update:  I was unable to get hgscc to work on Windows 7 VS 2008.  Any attempts to add a file from  within VS resulted in a generic error  message.  I uninstalled hgscc by right clicking the .msi install file and selecting uninstall

  • C Run-Time Error R6025 pure virtual function call

    Posted on March 3rd, 2010 Alan No comments

    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
    }