Problem with LoadFromResource...please help

Dear All,

I have a piece of code that loads an html page (using LoadFromResource) on 
to the dialog as a GUI. Every time after the user does something then a 
different html page will be loaded.

After I ran my code for a few thousand transactions then I see a big 
increase in the memory size of my application.

I used Rational Purify and it said that mshtml.dll is leaking memory.

MLK: Memory leak of 10240 bytes from 5 blocks allocated in mshtml.dll

        Distribution of leaked blocks

             10240 bytes from 5 blocks of 2048 bytes (first block: 

        Allocation location

             [KERNEL32.dll ip=0x6C8033C8]

             [mshtml.dll ip=0x7CCD284A]

             [mshtml.dll ip=0x7CD3FABC]

             [mshtml.dll ip=0x7CD3FA85]

             [mshtml.dll ip=0x7CD3FBE8]

             [mshtml.dll ip=0x7CD3FBAA]

             [mshtml.dll ip=0x7CD3FAE2]

             [mshtml.dll ip=0x7CCF110F]

             [mshtml.dll ip=0x7CCF0FF2]

             [mshtml.dll ip=0x7CCF0F72]

Also I loop test the code that responsible for loading the html and I found 
from the Window Task Manager that each time the memory increases more first 
and later it decreases but not to the initial level.

Ex : Memory before the code �V 100 K

 After the Call �V 300K

And Later it comes down to 200K.

Here is a sample of the loop test I did. Is there any function I can call to 
make sure that resource loaded are released properly? Or could the memory 
increase due to another factor? I am using VC++ .NET and Window XP 
Professional ver.2002 SP1 and mshtml.dll (ver. 6.0.2800.1106).

CENTRANCEDlg ent_dialog;




class CENTRANCEDlg : public CDHtmlDialog




//helper function inside the CENTRANCEDlg class

BOOL CENTRANCEDlg::LoadFromResource2( int id )




                        BOOL result = LoadFromResource(id);



            catch (...)



            return S_OK;


// loop testing the function

for(int i=0; i<10000; i++)




Thank you very much.


joezhu (3)
1/18/2005 3:21:09 AM
vc.mfc 33608 articles. 0 followers. Follow

0 Replies

Similar Articles

[PageSpeed] 17


Similar Artilces:

Problem shortcuts in Word
Hello, I work with Word 2008. In the beginning there is no problem, but suddenly i have problem with shortcuts. When i want to do "cmd c" it make an other shortcuts same thing for "cmd s", "cmd v" and surly some other. But when i write there is no problem "c" is "c"... If somebody have an idea please help me. Thank you. Unless you indicate your specific update level of Office as well as OS X & describe what the keystrokes *are* doing contrary to what you expect there isn't much we can offer. -- Regards |:>)...

encoding problem in Outlook 2007 importing Outlook 2000 personal folders
I use Outlook 2007 to import the pst file of Outlook 2000. The Chinese characters in the subject became unreadable but it's ok to display in message body. In Outlook 2000, there's no problem to display the Chinese characters in the subject. What's wrong with Outlook 2007? What setttings should I change to fix the problem? Thanks. cyl <> wrote: > I use Outlook 2007 to import the pst file of Outlook 2000. The Chinese > characters in the subject became unreadable but it's ok to display in > message body. In Outlook 2000, there's no problem t...

Outlook 2003 PST problems
I just installed Office 2003 professional on a new computer & am having problems with outlook. I copied my Outlook.pst file into the appropriate directory & although it is recognized the calendar is not working properly. I cannot attach any of the colored labels to my appointments - so everything is pretty much in black & white. I totally uninstalled & reinstalled office... first removing my pst file... but there appears to be an ini file... or something that is retaining some information... does anyone know of a fix for the labels... or how to TOTALLY uninstall office (so I...

formula help #26
Is this possible? Find all cells in a column which match an item from a pull down list. Perform a sum of those rows in a different column and divide by a count of the matches to obtain an average. for one cell it might be like this. If X1 = C3 then R1=(Running SUM of C column matches)/ Count of C Column matches Where X1 is the pulldown value selected. R1 is the result -- Rikk Flohr gallery: consulting: blog: =AVERAGE(IF(C1:C100=X1,C1:C1000)) which is an array formula, it should be com...

Problem with Authentication
The CRM application was running smooth. But now I can't logging. It ask my credentials and than return a 401.1 error. I had already reinstalled the CRM server but it won't work. I'm accessing it in the same local network. I'm running CRM 3.0 in SBS. Best regards, Erico Hi When you open a Internet explorer and type the name of the CRM server, it prompts for user and password ? Are you logged in with domain credentials ( AD user ) ? If you are, so add url of the crm server in Local intranet. Enable "Automatic logon only in intranet", this is under security,c...

Still need help
Here's my last dialogue. I'm still unable to clear a cell upon Close Thanks FSt1 ! I'm a novice and need further clarification. The subroutine did not run as I received the Macro Disabled message. I clicked OK, and next time I opened the workbook, I didn't get the Macro Warning, but the subroutine apparently didn't run as the chosen cells were not blank. I don't want people who use my workbook to have to deal with macro warnings. Is this something that must be set on each user's computer, or can I set it in my workbook so the subroutine automati...

Vista blue screen problem...please help!
I've seen some other threads, here are the dump files: 'RapidShare: 1-CLICK Web hosting - Easy Filehosting' ( Please, help me out here. -- ceVil It might be better to know at what point the bsod occurs and what the actual err.msg given is "ceVil" <> wrote in message > > I've seen some other threads, here are the dump files: > 'RapidShare: 1-CLICK Web hosting - Easy Filehosting' > (...

We had a disaster on our Great Plains SQL Server I need help
We are in the process of restoring our MS SQL Server and the 24 Company databases. We could not reinstall to the orginal sql Server instance name, but we could create a new instance and restore to it. But now security does not appear to be working I believe because we didn't restore the master. Is this a problem that we restored to another instance name. Will this casue us a problem with anything in the dynamics database? How can I get my security back without restoring the master database. There is nothing in the GP application or in te Dynamics database that would cause the...

calendar problem
Dear all, I am using both mail and calendar function in outlook 2002. Everything is ok until recently, when I try to make a new appointment or checking any old appointments, an error message "out of memory or resource, try to close some windows..." pop up. The mail function is still ok. Can anyone tell me how can I solve this? I have already installed sp2. The version of office is the professional one with frontpage. Thanks. tp ...

problem #4
Hi, I am facing this new problem... i.e a user has installed Office 2003 on win2k prof platform.. whenever she is working on a outlook.. she gets a Microsoft error message... saying to send the report or don't send the report... Usually I have seen this problem in IE... But for outlook it is new to me... after clicking on send or don't send report.. the outlook closes. And there are no IE open..... and if atall it is open.. the IE does not close... Need your help regards, KAH What is logged to the Event Viewer regarding this? Try one of the following already; http://www.howt...

95 and 97 problem
For some unknown reason there is Excel 95 and 97 on this pc.When i double click on an Excel file, the pc defaults to the 95 program (Which incidently doesn't work properly). So my question is how do i get the pc to default to 97. Cheers Craig Craig, Have a look at Windows Help. From Windows 2000 Help (Index under Programs Associating with File Types) To change which program starts when you open a file In My Computer or Windows Explorer, on the View menu, click Folder Options. Click the File Types tab. In the list of file types, click the one you want to change. Click Edit. In Act...

Date problem
I can't believe there's no post on this, but I can't find it. I've tried the solutions I could find (see below) and still get the error: "The expression is typed incorrectly or it is too complex to be evaluated. For example....Try simplifying...." I have a date field, formatted as Date/Time, General Date, default Value = Now(). I like having the date and the time - in case we need it. I want to run a report on calls taken just for one day. I have CallDate: CallDateAndTime in my query, with "criteria" as Between ([Forms]![frmReports]![txtStartDate]) A...

sync problems
I have all of my info on an HP Ipac. I had to reformat the hard drive and I did not make a back-up file. I am trying to move everything back to the computer but it says there is an error with syncing it. How can I move everything from the PDA back to Outlook again? Please help- thanks ...

Office 2007 - HELP
I have used Word for many years and love it - not too thrilled with the changes in Office 2007, but my bigger issue is with Publisher 2007. I have an image that I have used in Word just fine - meaning, the on screen colors are correct and when printed the colors are correct. Someone sent me a Publisher file and asked me to add the image - I did this - now the image is messed up - the colors are correct on screen, but when printed FROM MY computer the image colors are all wrong - but if I transport the file to a different computer it prints fine I have reinstalled Office - no good Any id...

Installation Problem!!
I am having a problem installing MSCRM 1.2. My configuration consists of a Domain Controller running Win 2000 Server SP4 . I am trying to install MSCRM on a member of the domain running Windows 2000 Server SP4. There is a DNS Server on the DC which is integrated with AD, and a SQL Server 2000 running on the Win 2K machine. The install errors out when CRM creates the root business with the message: Setup was unable to install Microsoft CRM Server. Setup was unable to provision your organization. Setup was unable to create the root business. The configuration of ASP.NET seems to be ok, the pr...

Scolling in email, help!
I can't scroll down to see emails. The bar on the right keeps going to the top. I can't scroll it down and stop where I want it to. Thanks Cindy "Cindy Didrick" <> wrote in message news:O91ez0x1KHA.260@TK2MSFTNGP05.phx.gbl... >I can't scroll down to see emails. The bar on the right keeps going to the >top. I can't scroll it down and stop where I want it to. > > Thanks > Cindy Nothing in WM can cause this. Does this behaviour only occur in WM, or in all scrolling applications? Have you checked y...

Problems Creating a disclaimer in Exchange 2003
I am trying to create a server based disclaimer that will stamp all of my smtp emails going to the internet. I have been following KB article 317680 with no luck. I get an error like the one below. Binding Display Name Specified: smtpscriptinghost ** Registration Failed ** Err.Number (HRESULT) = 0x1AD Err.Description = ActiveX component can't create object ProgID = cdo.ss_smtponarrival COM Category = {FF3CAA23-00B9-11d2-9DFB-00C04FA322BA} Corresponding Event = onarrival ** Have you registered your sink COM class on this machine? I am puttin...

Resource editor problems
Hello all, Under VC++ 7.1... Please consider these two lines: IDC_ARROW_ADD_CANCEL DISCARDABLE "res\\cur00004.cur" IDC_ARROW_ADD_CANCEL CURSOR DISCARDABLE "res\\cur00004.cur" The second is a hand-edited change to the first. Both will compile just fine in the resource compiler. However, after I use a text editor to make this change, I cannot open the .rc file in the resource editor. The resource editor issues the following error open attempting to open the .rc file: error RC2135 : file not found: CURSOR Can anyone shed light on what's going on here? Thanks, Dave ...

Directory Replication Problem #2
Hi, recently my Exchange Server directory database receives changes from other servers but does not send out its own changes. Check from the knowledge base, to correct the USN discrepancy need to use Authrest.exe (need to amke changes for about 100+ users). Does anybody know where to get this file 'Authrest.exe' for exchange server 5.5? Exchange server 5.5 CD only provide this file for ver.4.0. Have anyone use it before? Regards, "Sharon Tan" <> wrote: >Hi, recently my Exchange Server directory database >receives changes from ot...

Cell Format
I have a spreadsheet with cells that I'm trying to type the date into. I type in the date exactly like this: 09/26/03. When I hit "enter" MS Excel displays "37890" in the cell. No matter what I do I can't the cell to show: 09/26/03. I think that somehow I need to "strip" the cell of what it's original format is, but I can't figure out how. I try to use the Date option in the format cell screen but it doesn't work. Curtis I tried this and it didn't work. I also tried the "Text to columns" feature. No success. >...

User Defined Variables in MS query cause a problem to import data
If I use user defined variables in MS query to import data into excel sheet, the query executes but no data gets imported into the excel sheet. If I get rid of the variable the results can be imported into the Excel sheet. ...

How do I keep the active file open after saving copy, please?
I am using Excel 97 with OS WINNT. I have recorded a macro which copies the first sheet called "Daily from my source workbook to a new workbook, names this new workbook "PO Commencements (Today's date)".xls, and closes the new workbook. It i also closing the source workbook. I would like to keep the source workbook open after the copyin process. Alternatively, automatically reopen the source workbook a there is another step to be undertaken before I finish with the boo for the day. If I perform these steps manually, only the destinatio workbook closes and I can continue w...

outlook web access redirect problem
hi, I have been trying to redirect outlook web access (OWA) from the IIS root folder to the /exchange folder. I have followed the instructions on going into the web site and redirecting to a folder but I just get the following URL when I browse to the root of my webserver : http://webmail/exchange/exchange - it's like it's doubling up somehow. I have it set to : A redirection to a URL redirect to: /exchange client will be sent to: A directory below URL entered I just can't work it out... any ideas... cheers Baronne Which instructions did you follow? I wrote the below articl...

help, please, using titles in email.
Hi.. Using Outlook 2000. I have a few contact that have titles (example- Mr., Mrs., Fr., etc) Is there a way to have the title show in their name, when one is specified??? Thank you! -- B'Regards, Vinnie Vinnie, You did not indicate for what purpose e.g. viewing the contact or doing a mail merge. If you would like to see the titles when viewing contacts then check to see if it is specified in the actual contact by doing the following. Open contact and click on Full Name - there is an option there to add the title. Once this is done you will be able to see it in the contact ...

Need to Hire Outlook 2003 Help
Hi I'd like to hire someone that can walk me through some specific stuff with outlook 2003 I'm using the Lotus Notes to Outlook plugin My compnay is a Notes shop - which means I get NO support for outlook --- this plugin is a god send and i want to make sure I get it set up correctly It's coming out of my pocket but I'm willing to pay if I can find the right person to help me Please post ideas here or email me Thanks Brendan ...