Memory leaks in COleControl

While testing my MFC Activex control in Exel, I discovered that I get memory
leaks reported when closing the app. They seem to be related to:

Oledobj2.cpp line 150 : GetCacheEntry()
{
.....
AFX_DATACACHE_ENTRY* pCache = new AFX_DATACACHE_ENTRY[m_nMaxSize+m_nGrowBy];
......
}

and

CtlData.cpp line 348 : GetDataSource()
{
....
m_pDataSource = new CControlDataSource(this);
.....
}

The deal is I get the same problem with the Circ3 example provided in MSDN.
Does anyone have any information on this? Does Microsoft supply ANY examples
that work?




0
NOSPAMmao (35)
8/23/2003 10:42:54 PM
vc.mfc 33608 articles. 0 followers. Follow

1 Replies
268 Views

Similar Articles

[PageSpeed] 12

Could you supply the code with slightly less editing? For example, 
please include the className::methodname() rather than just the method 
name.

Pretty hard to say with such heavily edited code.
-- 
Stephen Kellett
Object Media Limited    http://www.objmedia.demon.co.uk
RSI Information:        http://www.objmedia.demon.co.uk/rsi.html
0
snail (185)
8/24/2003 10:32:26 AM
Reply:

Similar Artilces:

Memory usage in XP (memory leak detection)
Hi How can I found out the memory usage on XP ? My XP box uses over a week all memory and then has no resources available. It has 4GB memory (3.5 GB free) I used typeperf with the following: \Memory\Available Bytes \Memory\Committed Bytes \Memory\Pool Paged Bytes \Memory\Pool Nonpaged Bytes \Memory\Cache Bytes \Memory\Cache Bytes Peak \Process(_total)\Virtual Bytes Peak \Process(_total)\Virtual Bytes \Process(_total)\Working Set Peak \Process(_total)\Working Set \Process(_total)\Page File Bytes Peak \Process(_total)\Page File Bytes \Process(_total)\Private Bytes \Proc...

not enough memory on excel 2008
Version: 2008 Operating System: Mac OS X 10.6 (Snow Leopard) Processor: Intel <i>run excel 2008 on mac snow leopard 2 g memory i upgrade to 3 g and same</i>&#32; message not enough memory can some one help me only word working Run Remove Office then re-install Office On 30/03/10 7:08 AM, in article 59bb629f.-1@webcrossing.JaKIaxP2ac0, "Snow_leopard@officeformac.com" <Snow_leopard@officeformac.com> wrote: > Version: 2008 Operating System: Mac OS X 10.6 (Snow Leopard) Processor: Intel > run excel 2008 on mac snow leopard 2 g memory i upgrade t...

Is it a memory leak
AoA I have used standard template library in one of my applications. I belive that memory leaks are due to stl components, mainly string. i wrote a sample program in VC 6.0 that clearly shows memory leaks in stl wstring str = L""; for( int a = 0 ; a < 100000 ; a++ ) { str += L"int"; } str.str.erase( str.begin() , str.end() ); str = L"int"; i wrote this code against a button in dialog based application. Before clicking the button, the memory usage is 3MB and after this code it is 17MB although i believe it should have been bac...

Exchange memory utilization
Is there any documentation detailing the exchange 2003 memory utilization , especially in coordination with the max store size. thanks CR What do you want to know? Exchange will use all the memory it can in the box, up to 4GB, for caching, and this isn't a function of store size. It will release memory so that other processes can get what they need. -- Ed Crowley MVP - Exchange "Protecting the world from PSTs and brick backups!" "MSNews" <Craig@nowhere.org> wrote in message news:etwPVF%23RHHA.4832@TK2MSFTNGP03.phx.gbl... > Is there any documentati...

Out of Memory
I am using Excel 2000. Operating system is MS 2000. Ram = 512. I am running a large Excel file 65,536 rows by 24 columns. The columns may expand somewhat; say 5 extra rows as the Macro runs. The Excel file links to another Excel file to do some vlookups. Some formatting is going on as well as Paste Special Value. I get an out of error message and Excel stops. If I only have 50,000 rows it works fine. I have increased the virtual memory to the maximum, same thing. Any suggestions???? Hi, There are only 65536 rows in a worksheet. You cannot use all the rows. Split your sheet into sevra...

memory growing spreadsheet
Hi Again I have another query- For some reason when working on a spreadsheet it can start with say, 925kb in size,I do a couple of changes, then "Wolla" 10+mb It only happens every now and again, but I have tried copy then paste special, taken all macro's out, save as a different name,copy sheet into different book, but still can't bring it back down in size, "Hu" I even took my changes back out What is going on? John .. Hi John, What are you doing? Whatever it is, I think I'd want to do something else. But I haven't any hint what to avoid doing &...

Is this a memory leak?
Hi, I am trying to figure out why a program keep consuming more memory the longer that it runs. I tried detecting a memory leak using the CMemoryState object. I find that the program is using more memory after executing this line: PullComma(sData); The source for PullComma is: //======================================================================= void PullComma(CString& string) // Remove comma from start of string //======================================================================= { Strip(string); if (string.IsEmpty()) return; if (string.GetAt(0) == ',') string =...

CPU usage, memory and virtual memory
Hello, On certain occasions, some applications can consume close to 100% cpu usage and freeze up the machine. But some apps can consume 100% cpu, but allow you to work on other applciations. What is the difference? Is it the memory and virtual memory consumption? Number ofpage faults? I am working on a multithreaded MFC application, which freezes up the machine (when it does some computations). A look at the task manager tells me it consumes 99% cpu and a lot of memory and virtual memory space. I would like to make sure that when my applciation computes, it does it as fast as possible and it...

CWinThread and Memory Leaks.
I want to have a simple progress bar displayed whilst my MFC application is doing a lengthy operation. To do this, I am creating a user interface thread which displays a dialog containing a progress bar control. This is implemented using two classes: class CProgressDlg : public CDialog class CProgressThread : public CWinThread The CProgressThread class has a member variable: CProgressDlg m_Dlg; At the start of the lengthy operation I create a new instance of CProgressThread, and set the m_bAutoDelete member TRUE before calling CProgressThread::CreateThread(); In CProgressThread::InitInst...

Accessing physical memory through PC/104 bus
Hello all. We need to access (read/write) memory on devices (cards) attached to PC/104 bus. Operating system: Microsoft Windows Embedded CE 6.0 Target processor: Advantech PCM-3375 (x86 architecture) http://www.advantech.com/products/PCM-3375/mod_1-2JKGWQ.aspx We were using operating system QNX 4.25 before, now we plan to migrate our code to WinCE6. Under QNX, we were accessing the memory using block of code similar to this one: { int addr =3D 0xd9080; // physical address on card unsigned long size =3D 0x1000; // size of block to access unsigned char...

Memory leak?
Hello Group, How can I be sure that I don't have memory leak in my dialog based app? Thanks in advance, Geo Hi > > How can I be sure that I don't have memory leak in my > dialog based app? > > Thanks in advance, > Geo you can use CMemoryState MFC class. Regards, Robert Thank you Robert. >-----Original Message----- >Hi >> >> How can I be sure that I don't have memory leak in my >> dialog based app? >> >> Thanks in advance, >> Geo > >you can use CMemoryState MFC class. > >Regards, Robert > > >....

Outlook 2000 memory error
Hi, When I deleted an item in Calendar, I got error message that "There is not enough memory available to perform the operation." I am using Outlook 2000. Thanks in advance. Grace ...

Edit story in MS Word
I am unable to use the "edit story in Word" feature with MS Pub '03. However, I *can* open MS Word while Pub is running and do copy/paste editing. I have tried disabling script blocking in NAV to no avail. Thanks in advance for any help! After managing to set up OE-QuoteFix on his new PC, Ed reads a message from Wayne Wilson <anonymous@discussions.microsoft.com>... > I have tried disabling script blocking in NAV to no avail. Have you disabled the Microsoft Office PlugIn in NAV? -- Ed Bennett - MVP Microsoft Publisher http://www.mvps.org/the_nerd/ Before reading t...

Database in memory
Hi, I have a large amount of information which I store in memory. I store this information as array of structures using CPtrArray. The structure is pretty complex, has subarrays. I normally iterate through all of the array and do some checks and process the needed information only. Speed is the keypoint. My question is: Is it possible to create a small database having several tables completely in memory and query it with SQL? If it is possible to manage that, will it be faster than my method of query? Thanks! Have a look at http://sqlite.org/ I use it in a couple of the things I work on ...

Virtual Memory Fragmentation #3
I get this message in the Event Viewer: The virtual memory necessary to run your Exchange server is fragmented in such a way that normal operation may begin to fail. It is highly recommended that you restart all Exchange services to correct this issue. Can't resolve the problem with restarting the Exchange 2K services or rebooting the server. Is this a critical issue or can it be left alone? And how to fix? Hi Hassan, Exchange server requires some amount of virtual memory and one thing is for sure that Exchange is memory greedy application... every application requires some amou...

memory.dmp
if windows crashes and memory gets dumped into memory.dmp, what can I as a user do with this file? do I need it? can there be anything in there that would help me to find out why windows is crashing? Using Wordpad, after 1 minute, it seems like it has only opened 1%. rr@nospam.edu wrote: > if windows crashes and memory gets dumped into memory.dmp, what can I as > a user do with this file? do I need it? can there be anything in there > that would help me to find out why windows is crashing? Using Wordpad, > after 1 minute, it seems like it has only opened 1%. You n...

CDC::BitBlt, memory 2 memory.
This is a multi-part message in MIME format. ------=_NextPart_000_0017_01C4044E.48372430 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable I need to bitblt a bitmap onto a "ball" DC, then from the "ball" DC to a = memory DC, then from the memory DC to the window DC. But I am very = difficulties! What am I missing? It seemed so simple on paper. = Arrrhhhh... CBitmap bmp; bmp.LoadBitmap(IDB_BALL); BITMAP bmpInfo; bmp.GetBitmap(&bmpInfo); CDC DCMemory, DCBall; CBrush CBWhite(RGB(255, 255, 255)); DCMemory.CreateCompat...

Out of memory
Hello, I am working on a macro with excel, which crunches a lot of data and plots graphs. I am running into issues with Out of memory problems. I am currently using 512 MB Ram computer with Excel 2000. Any suggestions or pointers to solve this problem would be appreciated. Thanks. The amount of physical memory you have is of little consequence as Excel only uses it's own pool. You may wish to check this out? http://www.decisionmodels.com/memlimitsc.htm -- HTH Nick Hodge Microsoft MVP - Excel Southampton, England nick_hodgeTAKETHISOUT@zen.co.uk.ANDTHIS "fobinus" <h...

not enough memory to get more office assisants why?
When I try to change my office assistant I get a message on screen saying "there is not enough memory available to complete this operation. How do I change this situation so that I can get different office assistants??? Someone please help! I am using Microsoft Works Suite 2003 See http://uksbsguy.com/blogs/doverton/archive/2007/07/23/how-to-get-the-office-assistant-office-2003-to-work-in-windows-vista-i-e-remove-the-quot-not-enough-memory-quot-error-messages.aspx -- <>>< ><<> ><<> <>>< ><<> <>>< <&g...

referenced memory error
Receiving the following error when shutting down Outlook Express, can anyone help? the instruction at "0x77f83187" referenced memory at "0x00924830", the memory could not be "written" Click on OK to terminate the program ...

Memory error message shuts down Publisher
I am using Publisher 2000. I had to re-install XP and re-install Publisher. Prior to re-installing, Publisher worked good. Now after opening a Publisher file I get the following error message and Publisher shuts down. The instruction at "0x77f51ed3" referenced memory at "0xfffffff8".. The memory could not be "read". I read on this forum this problem may be caused by old drivers. I have downloaded and installed the latest Intel video and HP printer drivers but the problem still happens. Does anyone know how to fix this error. Prior to the re-install ...

memory instruction reference can't be read
Hi, Compiler:Visual C++ 6.0 In debug configuration, I can build the project and run it without error. But in release configuration, I can build the project and run it. When I click one button, the compiler shows: "The instruction at "0x004022ff" referenced memory at "0x00000030". The memory could not be read." What shall I do to solve this problem? Thank you. > Hi, > Compiler:Visual C++ 6.0 > In debug configuration, I can build the project and run it without error. > But in release configuration, I can build the project and run it. > When I cl...

Validating in-memory XML against in-memory DTD?
Hi I need to validate an in-memory XML document against an in-memory DTD. I've tried using XmlValidatingReader and it works but the compiler complains that the class is obsolete. Here's the code: string dtd = "<!ELEMENT bookstore (book)*> " + "<!ELEMENT book (title,author*,price)>" + "<!ATTLIST book genre CDATA #REQUIRED>" + "<!ELEMENT title (#PCDATA)>" + "<!ELEMENT author (name | (first-name,last-name...

out of memory
hi i was running pub 2000 in a 133mhz with 96 m ram. it ran just fine. now on a 500mhz plus computer with 130 meg ram, it says : "out of memory, cannot load embbeded objects? why is this? thanks Jay Hi jay pierce (brava@classicnet.net), in the Microsoft� newsgroups you posted: || i was running pub 2000 in a 133mhz with 96 m ram. it ran || just fine. now on a 500mhz plus computer with 130 meg ram, || it says : || "out of memory, cannot load embbeded objects? Check to be sure you are not running Norton Antivirus and check out the following kb article as well: http://support.micro...

Shared memory between DCOm session
Hello Env; Win XP/2K Visual C++ 6.0 I created an ATL service (using App Wizard) and add DCOm functionnality to it. I wrote a client for the DCOM server. So far so good, it's working fine. When I connect a client to the DCOM server (actually a NT service as stated above), the service stores the name of the client in an array and update the count of client connected. I found out that, whatever the number of client applications connected to the server, the user count is always 1. As far as I understand, it means that each connection is actually a new sesion of the DCOM server. Thta Ok but...