Releasing memory after creating OCX control

Hi,

I try to create an instance of an activex control in my MFC dialog based
app. Though my application works with out any error, if i check the memory
after calling "delete pMyControl" it keeps on
occupying the same memory it occupied when the control was alive. Could
anyone help me where I am missing to clear the memory?
Thank you.

My Code here
---------------m_pxWmp= new CWMPPlayer4();if( m_pxWmp->Create("replay",
WS_CHILD | WS_BORDER | WS_VISIBLE , CRect(100, 100,320,240), this, 2)){
m_replay = true;    m_pxWmp->SetUrl("C:\\video.avi");
m_pxWmp->SetUiMode("none");    m_pxWmp->GetControls().play();}........
m_pxWmp->GetControls().stop();m_pxWmp->close();m_pxWmp->DestroyWindow();dele
te(m_pxWmp);m_pxWmp = NULL; -------------------------------


Regards,
Luca


0
1/14/2004 12:43:39 AM
vc.mfc 33608 articles. 0 followers. Follow

2 Replies
797 Views

Similar Articles

[PageSpeed] 21


Sorry, the code was unreadable:
---------------
m_pxWmp= new CWMPPlayer4();
if( m_pxWmp->Create("replay",WS_CHILD | WS_BORDER | WS_VISIBLE , CRect(100,
100,320,240), this, 2)){
        m_replay = true;    m_pxWmp->SetUrl("C:\\video.avi");
        m_pxWmp->SetUiMode("none");
        m_pxWmp->GetControls().play();
}
.........
m_pxWmp->GetControls().stop();
m_pxWmp->close();
m_pxWmp->DestroyWindow();
delete(m_pxWmp);
m_pxWmp = NULL;

-------------------------------


Regards,
Luca


0
1/14/2004 12:54:08 AM
luca wrote:

> Hi,
> 
> I try to create an instance of an activex control in my MFC dialog based
> app. Though my application works with out any error, if i check the memory
> after calling "delete pMyControl" it keeps on
> occupying the same memory it occupied when the control was alive. Could
> anyone help me where I am missing to clear the memory?
> Thank you.

The runtime library memory allocator keeps the addresses (not the 
memory) for possible reuse.  This is efficient: After all your app has 2 
Gillion addresses it can use.  Don't worry about it.  It's not real 
memory, it's virtual memory.

-- 
Scott McPhillips [VC++ MVP]

0
scottmcp8856 (490)
1/14/2004 1:41:28 AM
Reply:

Similar Artilces:

To Refresh a Control to Display
Hi, I have added a Button control from the toolbars and have set the "caption" of it to nothing. Now i want to display a text "HELLO-ME" on the Button control from my application. I have tried a lot of options, but it is not diplying the text at all. What i have done is this, BOOL CMy_ApplicationDlg::OnInitDialog() { CDialog::OnInitDialog(); m_button.SetFocus(); int id = m_button.GetDlgCtrlID(); SetDlgItemTextW(id,L"It's-Me"); (OR) m_button.SetWindowTextW(L"HELLO-ME"); (OR) (GetDlgItem(...

Why does my autofill stay on after I release the mouse button?
When I open excel and left click on a box, it act like I am holding the button down and will not release, shading everything it comes in contact with. I have to ctrl-alt-del just to get out of excel. It freezes everything. I have checked my option and configuration to another system that I have and it is the same(default). I have re-installed office 2003 without luck. I have run the repair option also. Has anyone else had this problem? I have a IR logitech mouse.Thanks try touching your f8 key -- Don Guillett SalesAid Software donaldb@281.com "bmxracer4" <bmxracer4@discus...

Creating a CUserAuth
I'm working on a Windows service that will update CRM objects from an other application. I'm trying to use a specific CRM account. From my search it appears that just creating a new CUserAuth, passing in the Business Unit guid as the MerchantId and the User guid as the UserId would be sufficient and then I could pass that to my SDK calls. However in doing this I get the following error. "Invalid user auth. The user ID does not match the thread token." Am I correct? Did I miss a step? You can override the credentials used when you authenticate with the following co...

Backup to memory stick
I'm using Money 2006 Deluxe. I've set the program to automatically backup to a folder on a memory stick. It backs up ok, but the program is not deleting the old files as it should. I now have the setting to keep only the 1 most recent backup file. Any suggestions? Learn to deal with it. This is a common complaint. "John9210" <John9210@discussions.microsoft.com> wrote in message news:BE360536-630E-400B-BDDB-4CA0961D1B90@microsoft.com... > I'm using Money 2006 Deluxe. I've set the program to automatically backup > to > a folder on a memory stick. I...

Copy/Paste
I friend of mine keeps having windows 2000 tell him/her that the copy/paste operation cannot complete due to low memory. I'm informed that they do the same thing all the time, but some times Windows complains. Steps to reproduce. 1) Open a Excel workbook with data in it. (Any actually) 2) Select a range. (make it a decent size) 3) Open a new worksheet 4) Left click the cell above the 1 and left of the A. 5) Left click edit->Paste. So if anyone can offer any advice on how to help a user paste into the cell A1 and not every cell, that would be great. Thanks. PS. Also any advice on ...

Creating a list in a cell
Hello. This is my first message to this group. I just want to create a cell whose content is restricted to the items or values in a list. The list would be static, and it wouldn't be a problem to fill the list by hand, as it is not expected to contain much many items. The user then could go to the cell and simply select one of the values in the list, by means of a drop down control or similar. Is there any standard option in Excel to do that? I tried something called "lists", but it doesn't work as I would like. Thank you very much in advance!! -- Vicent Hi Vincent Se...

creating a pivot table w/ ranges from 2 worksheets
would someone please tell me how to create a pivot table from 2 worksheets instead of combining all data in one. The problem is the source fields. I'd like to see my column headings but instead the source fields show up as Row, Column, Value. I'd like to know how to get my column headings to be my source fields so I can arrange them in a pivot table. Thanks. You can create a Pivot Table from multiple consolidation ranges, but, as you discovered, you don't get the same pivot table layout that you'd get from a single range. There's an example here: http://www.c...

Scrolling from a created gridline in Excel
Hello group I am not quite familair with some of excels manipulative prowess... I noticed that its possible to scroll up or down from a gridline ...say by first putting a gridline on any part of the row.. May i know how to do that.... I don't want to scroll the whole spread sheet but just from a row that I selected. TIA Roy I don't understand your question. Scrolling from a gridline doesn't make a lot of sense. Perhaps you are thinking of Freeze Pane or Split Windows, both available on the Window menu. Cordially, Chip Pearson Microsoft Most Valuable Professiona...

create a new user
I just created a new user in GP 8.0, assigned the user to a class, and company. I checked SQL Server and found the user is also created in database. But I got "There isn't a valid login record on the server for the user ID and password you entered." when I tried to login the new user. Do I need to do more to create a new user? Please help. Thanks. You need to have the SQL options Create Server Logons as well as Create Database Users turned on. This can be done through GPUtilities -- Richard L. Whaley Author / Consultant / MVP Documentation for Software Users For help lea...

Code to create a new worksheet (based on an original pre-format sheet)
Hi all I'm trying to create a command button which will copy an existing pre- format worksheet (which I will probably hide) and insert the copied sheet into the existing workbook but I have no idea how to do this! I want to do this so users can create their own records without messing- up the overall format (and make it simpler for them). Can anybody help me? Thanks Mike Sub newsheet() n = Worksheets.Count Sheets("Special").Copy After:=Sheets(n) End Sub Sub button_maker() Application.CommandBars("Forms").Visible = True ActiveSheet.Buttons.Add(290.2...

How to control your Office 2011 update installation.
Dear friends: Today, I have in my Mac the following components of Office 2008 installed: Word, Excel, Powerpoint and Entourage. I want to upgrade this installation to Office 2011 but, in order to save disk space, avoiding the duplicate products. I want to have only Word (2011), Excel (2011), Powerpoint (2011), Outlook (2011) and Entourage (2008), of course without loosing my email or office data. Is this possible, or I will end with *all* the component products duplicated? When I updated my original Office 2004 installation to Office 2008 some years ago, I didn't get any product duplic...

how do I create continuous ruler / dimension line
I would like to create a line that has a dimension displayed every 12". I would also the dimension fields to appear or disappear as I change the length of the line, example a 12" line would have a 12" marker, a 36" line would have 12, 24 and 36" displayed. How can I do this? Thank you, Vito Create a line pattern. (Not for the faint of heart) John... Visio MVP Need stencils or ideas? http://www.mvps.org/visio/3rdparty.htm Need VBA examples? http://www.mvps.org/visio/VBA.htm Common Visio Questions http://www.mvps.org/visio/common_questions.htm Visio Wishli...

Release
I heard that the next Office releases have been named but I didn't see anything about a release date. Anyone know anything? Office 2007 is slated for release during the second half of this year.=20 --=20 Sue Mosher, Outlook MVP Author of Configuring Microsoft Outlook 2003 http://www.turtleflock.com/olconfig/index.htm and Microsoft Outlook Programming - Jumpstart for=20 Administrators, Power Users, and Developers http://www.outlookcode.com/jumpstart.aspx "TS Mathews" <nospam@nospam.ca> wrote in message = news:472sb1Fd4n92U1@individual.net... >I ...

Calculated controls in reports in Projects
Why can I not use calculated controls in Access 2007 reports - the expression builder is not available ...

Excel Memory Saving Issues
Whenever updating one of our budget files (which is attached to consolidation files), it will ask me if I want to "save changes"? (yes or no) I will click on yes and a box says "not enought memory (with a box to click okay)" It will then say unable to save external link values and it appears to be going ahead and saving the file. Is there anyway to have enough memory? Should I be concerned with data integrity? Any information would be greatly appreciated. Hi Robert, If you are trying to save to a removable medium and Excel won't let you then consider your...

Dialog frame as an ActiveX control
On www.codeguru.com/cpp/com-tech/activex/controls/article.php/c2615/ there is article, I did everything according to it, but everything is OK only when I test my control in ActiveX Control Test Container. When I test my control on FormView in my own app, whole applications stops, when I just click on my ActiveX controls buttons. Any sugestions? Anybody? Klina ha scritto: > On www.codeguru.com/cpp/com-tech/activex/controls/article.php/c2615/ there is > article, I did everything according to it, but everything is OK only when I > test my control in ActiveX Control Test Container....

Release problem
Hello, I have released an application to my customer. It works fine but the problem is while launching it launches installer of some other tool. A cancel on that will launch my application. Do you have any idea as to what could be wrong? Regards, Subhash "Subhash Badri" <subhash.badri@in.bosch.com> wrote in message news:d1e42b$bgq$1@ns2.fe.internet.bosch.com... > Hello, > > I have released an application to my customer. It works fine but the > problem is while launching it launches installer of some other tool. A > cancel on that will launch my applicatio...

How to Create Exceptions to Recurring Appointment
I would like to send a calendar invite for a series of recurring meetings in 2006. I'd like to do this just once if possible. The problem is even though the meeting is normally the last Thursday of each month, there are 4 exceptions. Is there a way to schedule these with just one message to all concerned? Sabrina <spedeupe@gmail.com> wrote: > I would like to send a calendar invite for a series of recurring > meetings in 2006. I'd like to do this just once if possible. The > problem is even though the meeting is normally the last Thursday of > each month, there...

How Do I Create A Shortcut For A On-Demand screen saver
Some time back in an early version of Windows, I was able to create a shortcut to the .exe that started the screen saver. What is the name of that .exe file and where is now located? Will this still work? Is there another way to do this? Thanks, -- Steve T Windows 7 Home Premium 64 bit Office 2007 ESET Security Suite I found the .scr file and created a shortcut and it executes just fine. The only thing that doesn't work is to be prompted for id & password on resume. Yes it is set up that way in Personalize and if you check the properties of the shortcu...

Creating a CUserAuth
I'm working on a Windows service that will update CRM objects from an other application. I'm trying to use a specific CRM account. From my search it appears that just creating a new CUserAuth, passing in the Business Unit guid as the MerchantId and the User guid as the UserId would be sufficient and then I could pass that to my SDK calls. However in doing this I get the following error. "Invalid user auth. The user ID does not match the thread token." Am I correct? Did I miss a step? ...

error in creating case
I have this error. I knew that it was not a problem in creating case. I thouth the number was just for statistic analyses. Thanks <description>The contract does not have enough allotments. The case can not be created against this contract.</description> <details>The contract does not have enough allotments. The case can not be created against this contract.</details> <file>d:\crm\core\src\platform\include\om\CRM\Incident.inl</file> If you set up a contract and tie a case to it, once the allotments in the contract have been used up, you won't be...

Product release.
Hi I have an error when i trying to download a Latin American 8.0 released to December 2005 from partnersource. It said i have no credentials or permission to do this. I think there is a problem whit this page? Someone knows? Thanks, -- Evelin. ...

how do I create custom line patterns in Visio?
I have just begun using Visio as diagrammatic tool, but I cannot seem to get customised line patterns to work for dynamic connector. ...

Releasing Memory
I had an 800MB PST file consisting of many personnal folders. I exported 300MB of personnel folder information and then saved this file on a separate drive. I then deleted the exported information from outlook. When I check outlook file size (of all files) it shows 500MB - HOWEVER when I search for the pst. file it still shows 800MB. and the C drive does not show the 300MB that I just opened up. How do I get outlook to release the memory back to the system. Any ideas would be greatly appreciated. Thanks Create a new .pst file and copy the contents of your old .pst file to the new o...

Does LPDISPATCH need release as a function parameter?
void DoFunc(LPDISPATCH lpDisp) { lpDisp->...// call some functions lpDisp->release(); // is this needed? } caller: IHTMLDocument2* pDoc; DoFunc(pDoc); Because if I use IHTMLDocument2* as the parameter directly the compiler is ok and no Access Violation in debug. But I don't know if vc compile queryinterface internally. I know CCmdTarget has a GetInterface function without addref so what convertion used here in vc? ...