msnkd's profilePoor programmer's BlogPhotosBlogListsMore Tools Help

Blog


    March 13

    Microsoft Visual Studio's intellisense BUG

    I have found an interesting bug in VS 6 - VS 2003. (VC++ workspace )
    Try typing the following lines ( You may not need to type all in some case ) , wait some time if nothing happens try compiling.
    void operator :(int kd)
    {
    }
    U will see that it is gone , i mean the VS. it is crashed by its own intelisense.... Suppose if you saved these lines to anyone of your friends projects he will never be able to open his project .. hahaha.. I am sure he will try restarting the OS , (may reinstalling the VS etcc ). Do that with your own riskk.....

    CSliderCtrl An Important information to Share.

     
    Did you guys ever used slider control in Vc++ MFC ?? I am sure it will give you a small headache. The headache is this "you won't get the notification when user slides the slider ". The MSDN documentation says that it will send some notifaction like TB_XXX(TB_THUMBTRACK) . But that will never happend in my life. So to get the slider movement event we need to add handler in iits parent class (Mostly a dialog). The slider will send message WM_HSCROLL or WM_VSCROLL to its parent dialog on slider movment.  If the slider is a horizontal one it will send the messsage WM_HSCROLL and if it is vertical it will send WM_VSCROLL. By capturing this events we can handle that situation..
     
    Code may be look like this
     
    void OnHScroll(  UINT nSBCode,  UINT nPos,  CScrollBar* pScrollBar )
    {
       if(pScrollBar &&  pScrollBar ->GetDlgCtrlID() == ID_INC_IMAGE)
       {
            // Do the task
        }
     
     
    }
     
     
    March 11

    Coordinates system and Transformations.

    Seriously this is an important topic , if you are a graphics programmer .you might want to deal with different coordinates system. So here i would like to write some general guidlines to follow ( what i know).
     
    1. If the scene contains more than one objects , you must maintain a global coordinates system.
        ( Think about sun).
     
    2. Objects local coordinate system. here we are applying rotation for only one object. ( it is like earth revolving in its own axis,
         here the axis is its local coordinate system , the sun's axis is the global coordinate system.
     
    3 . { in opengl }Always Use Matrxi stack. This very much appreciated by the experts. because it allow to save the transformation matrices.
     
    I will posst a demo on this sooonnn...