Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
R

Resmi Anna

@Resmi Anna
About
Posts
5
Topics
0
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • VC++ 6.0 MFC - Temp disable mouse and keyboard for 5 secs.
    R Resmi Anna

    #include // For Visual Studio 6.0
    :
    BlockInput( true );
    Sleep( 5000 );
    BlockInput( false );

    Is this of any use for you??Please include the proper header

    C / C++ / MFC c++ tutorial

  • Which function can I use instead of ShowControlBar
    R Resmi Anna

    It seems m_wndColorBar is a variable of type CMFCToolBar not CToolBar. Can you check what is the base class of CMFCToolbar??. It is supposed to be a child of CToolBar. But seems it is not:~

    C / C++ / MFC help tutorial

  • virtual inheritance and polymorphism! [modified]
    R Resmi Anna

    Peter has already given a partial answer to your question. just consider the below example

    class A
    {
    public:
    A()
    {
    cout << "A::A\n";
    }
    };
    class B : public A
    {
    public:
    B()
    {
    cout << "B::B\n";
    }
    };
    class C : public B
    {
    public:
    C()
    {
    cout << "C::C\n";
    }
    };
    int main()
    {
    A* a = new C();
    return 0;
    }

    What will be the output A::A B::B C::C right?? means the order of object creation is like A->B->C and C objects reference is being put into A's pointer In your code There are two object creation order like A->B->D and like A->C->D Here compler would be confused which D's reference comes to A's pointer??? That is why there is compilation error. c++ provides us something through which we can overcome this problem. Thats the virtual class. You might have heard of diamond problem in c++. This what happens here. you can change you code like below.

    class A{};
    class B : virtual public A{};
    class C : virtual public A{};
    class D : public B, public C{};
    int _tmain(int argc, _TCHAR* argv[])
    {
    A* a = new D(); // No error!
    }

    note the key word virtual. Now the order of object creation will be like A->B->C->D. you can print some thing in constructure of each class and can see this. In the second code snippet

    class A{};
    class B : public A{};
    class C : public A{};
    class D : public B, public C{};
    int _tmain(int argc, _TCHAR* argv[])
    {
    B* b = new D(); // works! ..what?
    }

    There is no confusion for the compiler even though there are 2 object creation order. One like A->B->D and another like A->C->D. But you have clearly mentioned that D objects refernce goes to B's pointer. So complier will take A->B->D order and put this into B's pointer. But C object also will be created. Now it is clear that why the third code snippet cause an error. B's pointer stores a reference of D object being created in the order A->B->D. There is no Func() function on the way. Is there??

    C / C++ / MFC oop question c++ help tutorial

  • Multimap?
    R Resmi Anna

    multimap<string, string> mymap;
    string strKey;

    :
    :

    multimap<string, string>::iterator it;
    :
    it = mymap.find( strKey );
    if(it != mymap.end())
    {
    do
    {
    cout << strKey << " = " << it->second << "\n";
    it++;
    }
    while( it != mymap.upper_bound( strKey ));
    }

    C / C++ / MFC tutorial question

  • MAP????
    R Resmi Anna

    http://msdn.microsoft.com/en-us/library/y1z022s1(v=VS.80).aspx[^] will be helpful to choose the collection class for your need

    C / C++ / MFC algorithms question
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups