Click here to Skip to main content
15,889,216 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: how to show a search bar in my class derived from CHtmlView Pin
leon de boer27-Apr-14 6:13
leon de boer27-Apr-14 6:13 
GeneralRe: how to show a search bar in my class derived from CHtmlView Pin
joshua013727-Apr-14 17:08
joshua013727-Apr-14 17:08 
AnswerRe: how to show a search bar in my class derived from CHtmlView Pin
Randor 27-Apr-14 17:34
professional Randor 27-Apr-14 17:34 
GeneralRe: how to show a search bar in my class derived from CHtmlView Pin
joshua013728-Apr-14 17:32
joshua013728-Apr-14 17:32 
GeneralRe: how to show a search bar in my class derived from CHtmlView Pin
Randor 29-Apr-14 13:50
professional Randor 29-Apr-14 13:50 
GeneralRe: how to show a search bar in my class derived from CHtmlView Pin
joshua013729-Apr-14 22:37
joshua013729-Apr-14 22:37 
Questionwhy my class derived from CHtmlView cannot show the 'Search' bar Pin
joshua013727-Apr-14 2:29
joshua013727-Apr-14 2:29 
Questionwhat's the point of auto_ptr & unique_ptr? Pin
Falconapollo23-Apr-14 22:41
Falconapollo23-Apr-14 22:41 
I just can't understand the meaning of unique_ptr or auto_ptr, as we all know, once the parameter gets out of its scope, we won't get memory leaks. However, is it a better idea if I create the parameter on the stack rather on the heap. I don't see its advantage over normal parameters. If we really need to create parameters on the heap, then we must use '
C++
new
' operator, right?

Here is a little code snippet:

C++
class Base
{
public:
	Base()
	{
		cout << "Base::()" << endl;
	}
	virtual ~Base()
	{
		cout << "~Base()" << endl;
	}
 
	virtual void iPhone()
	{
		cout << "I'm iPhone5s" << endl;
	}
};
 
class Derive : public Base
{
public:
 
	Derive()
	{
		cout << "Derive()" << endl;
	}
 
	virtual void iPhone()
	{
		cout << "I'm iPhone 6" << endl;
	}
 
	virtual ~Derive()
	{
		cout << "~Derive()" << endl;
	}
};
 
void main()
{
  {
 
      auto_ptr<Base> ptr(new Derive());//a foolish idea to do so?
      ptr->iPhone();
 
      Derive d;//isn't it better?
      Base* base = &d;
      base->iPhone();
 }
}

AnswerRe: what's the point of auto_ptr & unique_ptr? Pin
Maximilien24-Apr-14 3:32
Maximilien24-Apr-14 3:32 
AnswerRe: what's the point of auto_ptr & unique_ptr? Pin
Albert Holguin24-Apr-14 5:24
professionalAlbert Holguin24-Apr-14 5:24 
GeneralRe: what's the point of auto_ptr & unique_ptr? Pin
jschell25-Apr-14 13:09
jschell25-Apr-14 13:09 
AnswerRe: what's the point of auto_ptr & unique_ptr? Pin
CPallini28-Apr-14 3:05
mveCPallini28-Apr-14 3:05 
AnswerRe: what's the point of auto_ptr & unique_ptr? Pin
Stephen Hewitt28-Apr-14 3:51
Stephen Hewitt28-Apr-14 3:51 
QuestionWin c Programming Pin
Nawabpasha23-Apr-14 22:41
Nawabpasha23-Apr-14 22:41 
AnswerRe: Win c Programming Pin
econy28-Apr-14 8:50
econy28-Apr-14 8:50 
GeneralRe: Win c Programming Pin
Nawabpasha28-Apr-14 21:48
Nawabpasha28-Apr-14 21:48 
GeneralRe: Win c Programming Pin
econy29-Apr-14 4:57
econy29-Apr-14 4:57 
AnswerRe: Win c Programming Pin
leon de boer30-Apr-14 4:02
leon de boer30-Apr-14 4:02 
QuestionSetWindowsHookEx Pin
Mohsin Munawar22-Apr-14 23:36
Mohsin Munawar22-Apr-14 23:36 
AnswerRe: SetWindowsHookEx Pin
CPallini22-Apr-14 23:53
mveCPallini22-Apr-14 23:53 
QuestionRe: SetWindowsHookEx Pin
Malli_S23-Apr-14 2:01
Malli_S23-Apr-14 2:01 
AnswerRe: SetWindowsHookEx Pin
Randor 23-Apr-14 10:26
professional Randor 23-Apr-14 10:26 
GeneralRe: SetWindowsHookEx Pin
Mohsin Munawar23-Apr-14 18:36
Mohsin Munawar23-Apr-14 18:36 
GeneralRe: SetWindowsHookEx Pin
Stephen Hewitt28-Apr-14 3:45
Stephen Hewitt28-Apr-14 3:45 
QuestionHow to insert the item in CTreectrl at runtime in Ribbon project Pin
sachanratnesh22-Apr-14 2:36
sachanratnesh22-Apr-14 2:36 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.