#include // For Visual Studio 6.0
:
BlockInput( true );
Sleep( 5000 );
BlockInput( false );
Is this of any use for you??Please include the proper header
#include // For Visual Studio 6.0
:
BlockInput( true );
Sleep( 5000 );
BlockInput( false );
Is this of any use for you??Please include the proper header
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:~
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??
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 ));
}
http://msdn.microsoft.com/en-us/library/y1z022s1(v=VS.80).aspx[^] will be helpful to choose the collection class for your need