I would suggest that you change your code to check the length of the node list on every iteration of the loop.
for(int i = 0; i < RootNodeList.get_length(); ++i)
CXMLDOMElement childnode = RootNodeList.get_item(i); <- This code sometimes user breaks
I'm trying to write a BHO that will intercept the load of any image
on a web page and prevent the images from being loaded.
I've searched through this site and others, and I've only found examples
which rely on waiting for the documentcomplete event to be fired.
The problem in my case is that I'm trying to accelerate the loading of
particular web pages and if I have to wait until the whole document is loaded to remove any images, it's already too late for me -- the user's
already preformed the long and costly download of the images.
How would I go about modifying the HTML content the browser is about to render on the fly as it downloads it? Is that even possible?
(If that's not possible, I might be okay with saving the HTML source to disk, modifying the code to remove any tags and then having my browser
render that temporary file. I'd like it to appear from coming from the same site though.. so for example, if they hit google.com, I'd like the address
bar to still say google.com but render the content from C:\temp\google.htm or whatever.)
Laugh if you will, but I am looking for a speedy way of storing arrays of integers into the registry. Let me explain, my app has a listview control with 19 columns. There are 4 sets of data which can be displayed in this listview. Depending on which data set the user chooses, the column widths will change. Therefore for each column (4 * 19) I need to store the width.
I have created a basic function to loop through the column each time the data set changes and to store the values into the registry. Writing 19 values. The problem is, it takes too long maybe half a second each time which is noticable to the user. Can anybody suggest a faster way to do the same job?
I feel like kicking myself, infact I think I will. It is kinda stupid writing to the registry when most of the time the values do not change. I changed the function slightly to write only when the value changes in the mean time keeping track of the values in memory.
If I start up an MDI application, a new document appears in the
Window. How can I make that new document not appear and instead
an introductionary dialog box appear? I tried redoing the
CDoc::OnNewDocument(), but thats not making the new document not
appear (alot of nots!!).
Please, any response any one can give me will be greatly appreciated.
This is an academic assignment and the tutor discouraged me from using strings, because I can understand arrays of chars more easily I guess.
Most likely, he (or she) wanted you to understand what actually goes on under the hood of the string class (and those like it). This isn't a bad thing, but you should remember that once you understand what it does, there is no need to reinvent the wheel, and doing so is actually bad practice.
edit: Is this code for an assignment? If so, what are the restrictions on the assignment?
I don't know what vectors are to be honest.
A vector is nothing more than an array. The vector template class wraps an array so that you can dynamically add/remove elements in it without worrying about the details of memory allocation/deallocation for the array yourself.
-- modified at 13:41 Thursday 10th August, 2006
If you decide to become a software engineer, you are signing up to have a 1/2" piece of silicon tell you exactly how stupid you really are for 8 hours a day, 5 days a week