Click here to Skip to main content
15,887,135 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: How to get object of a view which is created using AddView(). Pin
Richard MacCutchan9-Mar-18 5:18
mveRichard MacCutchan9-Mar-18 5:18 
GeneralRe: How to get object of a view which is created using AddView(). Pin
Sampath57911-Mar-18 6:04
Sampath57911-Mar-18 6:04 
GeneralRe: How to get object of a view which is created using AddView(). Pin
Victor Nijegorodov11-Mar-18 7:12
Victor Nijegorodov11-Mar-18 7:12 
GeneralRe: How to get object of a view which is created using AddView(). Pin
Richard MacCutchan11-Mar-18 22:32
mveRichard MacCutchan11-Mar-18 22:32 
QuestionHow to release IDispatch memory. Pin
Sampath5797-Mar-18 2:45
Sampath5797-Mar-18 2:45 
AnswerRe: How to release IDispatch memory. Pin
Jochen Arndt7-Mar-18 3:10
professionalJochen Arndt7-Mar-18 3:10 
GeneralRe: How to release IDispatch memory. Pin
Sampath5798-Mar-18 18:40
Sampath5798-Mar-18 18:40 
GeneralRe: How to release IDispatch memory. Pin
Jochen Arndt8-Mar-18 21:21
professionalJochen Arndt8-Mar-18 21:21 
How did you know that the memory is not released and how do you determine the memory used by your application?

You have to know how the memory is managed which requires knowing the used allocation method. Most memory is allocated in the default per-process heap. If this heap is used up, it is resized by requesting more memory from the operating system. But it will not shrink (at least not immediately) when freeing memory (which occurs when the reference count reaches zero upon releasing). It is finally returned to the operating system when the process terminates. As a result, you might see increasing process memory usage while the process is running.

There is a rather old article that explains the heap managment for Windows: Heap: Pleasures and Pains[^].

In your case of a VARIANT set by a OCX function you have no control over the memory management and even did not know which allocation method is used. If an object must be released depends on the data stored in the VARIANT and should be part of the documentation. In your case of a pdispVal, the OCX control might for example increase the reference count for the dispatch when calling GetAttributes(). Then it will be released finally when releasing the OCX control or you have to call Release() which should be again mentioned in the documentation. It depends also on what you are doing with the interface. If you are calling dispatch functions that increase the reference count, you have to call Release() the same times.
GeneralRe: How to release IDispatch memory. Pin
Sampath5798-Mar-18 22:27
Sampath5798-Mar-18 22:27 
GeneralRe: How to release IDispatch memory. Pin
Jochen Arndt8-Mar-18 22:55
professionalJochen Arndt8-Mar-18 22:55 
AnswerRe: How to release IDispatch memory. Pin
Randor 7-Mar-18 5:38
professional Randor 7-Mar-18 5:38 
Questionserializing an std::chrono::duration object with Boost Pin
Alexander Kindel7-Mar-18 2:12
Alexander Kindel7-Mar-18 2:12 
AnswerRe: serializing an std::chrono::duration object with Boost Pin
Alexander Kindel7-Mar-18 3:53
Alexander Kindel7-Mar-18 3:53 
GeneralRe: serializing an std::chrono::duration object with Boost Pin
Victor Nijegorodov7-Mar-18 4:31
Victor Nijegorodov7-Mar-18 4:31 
GeneralRe: serializing an std::chrono::duration object with Boost Pin
Alexander Kindel7-Mar-18 4:53
Alexander Kindel7-Mar-18 4:53 
GeneralRe: serializing an std::chrono::duration object with Boost Pin
Alexander Kindel7-Mar-18 4:36
Alexander Kindel7-Mar-18 4:36 
QuestionApplication launched by another program, how to debug? Pin
charlieg6-Mar-18 10:56
charlieg6-Mar-18 10:56 
AnswerRe: Application launched by another program, how to debug? Pin
Randor 6-Mar-18 15:29
professional Randor 6-Mar-18 15:29 
GeneralRe: Application launched by another program, how to debug? Pin
charlieg6-Mar-18 15:49
charlieg6-Mar-18 15:49 
GeneralRe: Application launched by another program, how to debug? Pin
Randor 6-Mar-18 17:20
professional Randor 6-Mar-18 17:20 
GeneralRe: Application launched by another program, how to debug? Pin
charlieg7-Mar-18 4:13
charlieg7-Mar-18 4:13 
AnswerRe: Application launched by another program, how to debug? Pin
Randor 7-Mar-18 5:36
professional Randor 7-Mar-18 5:36 
AnswerRe: Application launched by another program, how to debug? Pin
Richard MacCutchan6-Mar-18 22:39
mveRichard MacCutchan6-Mar-18 22:39 
GeneralRe: Application launched by another program, how to debug? Pin
charlieg7-Mar-18 4:15
charlieg7-Mar-18 4:15 
GeneralRe: Application launched by another program, how to debug? Pin
Richard MacCutchan7-Mar-18 4:35
mveRichard MacCutchan7-Mar-18 4:35 

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.