Click here to Skip to main content
15,867,835 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: Can we capture HD video using DirectShow C++/MFC .? Pin
Kimcopeland2-Apr-21 5:01
Kimcopeland2-Apr-21 5:01 
QuestionCWinApp::OnFileNew failed ? Pin
Codzer17-Dec-12 19:23
Codzer17-Dec-12 19:23 
GeneralRe: CWinApp::OnFileNew failed ? Pin
Jochen Arndt17-Dec-12 21:33
professionalJochen Arndt17-Dec-12 21:33 
GeneralRe: CWinApp::OnFileNew failed ? Pin
Codzer18-Dec-12 2:48
Codzer18-Dec-12 2:48 
AnswerRe: CWinApp::OnFileNew failed ? Pin
Jochen Arndt18-Dec-12 3:03
professionalJochen Arndt18-Dec-12 3:03 
QuestionLinked List Via Disk File Pin
imboared117-Dec-12 19:01
imboared117-Dec-12 19:01 
SuggestionRe: Linked List Via Disk File Pin
Richard MacCutchan17-Dec-12 22:15
mveRichard MacCutchan17-Dec-12 22:15 
QuestionConfused with destructor Pin
Super Lloyd17-Dec-12 2:33
Super Lloyd17-Dec-12 2:33 
I know if I have a class like that
C++
class A
{
  shared_ptr<SomeType> data;
}


I don't need to declare a destructor, as the compiler will automatically write one for me that take care of everything.

But what if I have a resource without a destructor, such as a handle.
I need to implement a destructor
C++
class A
{
  shared_ptr<SomeType> data;
  HANDLE wndobj;

  ~A() {
    CloseHandle(wndobj);
    // what of data? should I call data.reset()
  }
}


Do I need to handle all variable? or only those without destructor (i.e. wndobj)?
I.e. what of data?
A train station is where the train stops. A bus station is where the bus stops. On my desk, I have a work station....
_________________________________________________________
My programs never have bugs, they just develop random features.

AnswerRe: Confused with destructor Pin
Erudite_Eric17-Dec-12 4:54
Erudite_Eric17-Dec-12 4:54 
GeneralRe: Confused with destructor Pin
Super Lloyd17-Dec-12 5:01
Super Lloyd17-Dec-12 5:01 
GeneralRe: Confused with destructor Pin
jschell17-Dec-12 8:31
jschell17-Dec-12 8:31 
GeneralRe: Confused with destructor Pin
Super Lloyd17-Dec-12 16:59
Super Lloyd17-Dec-12 16:59 
GeneralRe: Confused with destructor Pin
megaadam18-Dec-12 3:51
professionalmegaadam18-Dec-12 3:51 
GeneralRe: Confused with destructor Pin
Stefan_Lang19-Dec-12 5:33
Stefan_Lang19-Dec-12 5:33 
GeneralRe: Confused with destructor Pin
Super Lloyd19-Dec-12 11:35
Super Lloyd19-Dec-12 11:35 
GeneralRe: Confused with destructor Pin
Erudite_Eric20-Dec-12 23:20
Erudite_Eric20-Dec-12 23:20 
AnswerRe: Confused with destructor Pin
Stephen Hewitt17-Dec-12 17:10
Stephen Hewitt17-Dec-12 17:10 
GeneralRe: Confused with destructor Pin
Super Lloyd17-Dec-12 21:41
Super Lloyd17-Dec-12 21:41 
Questionfuzzy logic code Pin
robot2916-Dec-12 3:10
robot2916-Dec-12 3:10 
AnswerRe: fuzzy logic code Pin
Richard MacCutchan16-Dec-12 4:25
mveRichard MacCutchan16-Dec-12 4:25 
GeneralRe: fuzzy logic code Pin
robot2920-Dec-12 4:01
robot2920-Dec-12 4:01 
GeneralRe: fuzzy logic code Pin
Richard MacCutchan20-Dec-12 4:16
mveRichard MacCutchan20-Dec-12 4:16 
GeneralRe: fuzzy logic code Pin
robot2920-Dec-12 5:26
robot2920-Dec-12 5:26 
GeneralRe: fuzzy logic code Pin
Richard MacCutchan20-Dec-12 5:37
mveRichard MacCutchan20-Dec-12 5:37 
GeneralRe: fuzzy logic code Pin
robot2920-Dec-12 5:40
robot2920-Dec-12 5:40 

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.