|
To answer you question, and give move clarification. I am not removing any nodes. I am just accessing them to pull the information out of the nodes.
I have notice that in some case the nodelist size if different sizes, cause sometimes there is a TEXT_Element in the list. I just do not understand this nomial yet. But this is for different files.
Robert
-- modified at 14:10 Thursday 10th August, 2006
|
|
|
|
|
I would suggest that you change your code to check the length of the node list on every iteration of the loop.
if(m_XMLDOMroot.hasChildNodes())
{
for(int i = 0; i < RootNodeList.get_length(); ++i)
{
CXMLDOMElement childnode = RootNodeList.get_item(i); <- This code sometimes user breaks
SetChildNode(childnode);
}
}
|
|
|
|
|
I did what you sugguested, and the size of the rootNodeList is not changing.
So any other sugguestions?
BTW- Thanks for all the help given so far.
Robert
|
|
|
|
|
What's the exception your getting?
|
|
|
|
|
How can I get what file handle is associated with an open file if I only know the name of the file? In VC++6 please.
|
|
|
|
|
I think that would require a device driver of some sort. Can you get by with parsing the output from Handle?
"Money talks. When my money starts to talk, I get a bill to shut it up." - Frank
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
Hi,
CDocument which handles all serialization.
Ex: if your CSampleDoc is derived from CDocument means
CSampleDoc::Serialize(CArchieve &ar)
{
ar.GetFile() //to get the file handle
}
|
|
|
|
|
Do you want to open a file and get a handle for it?
|
|
|
|
|
The problem is:
- I open a file
- do somth. with it.
- close it [fclose(f)]
- try to delete it
- it doesn't delete
I replaced fclose(f) with fcloseall() and thing went to normal.
|
|
|
|
|
Can you show your code,please
|
|
|
|
|
|
Hi there,
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.)
Thanks very much in advance for any pointers!!!!
|
|
|
|
|
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?
|
|
|
|
|
Would it suffice to keep track of the column widths everytime they change, but write them to the registry only when the user exits the app?
/ravi
|
|
|
|
|
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.
Thanks for that.
|
|
|
|
|
Don't kick yourself! Instead, pat yourself on the back. You've just seen the value of "first get it to work, then improve its performance".
/ravi
|
|
|
|
|
I usually go one step further than the above suggestion and store the settings only if the user manually changed them.
Another thing I often do is store all the column settings as a single string with delimeters.
Anyone who thinks he has a better idea of what's good for people than people do is a swine.
- P.J. O'Rourke
|
|
|
|
|
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.
Sincerely,
Danielle Brina
|
|
|
|
|
This will prevent the new document (Put in your application ::InitInstance after ParseCommandLine).
// Added to prevent New Empty Document at startup
if (cmdInfo.m_nShellCommand==CCommandLineInfo::FileNew) {
cmdInfo.m_nShellCommand=CCommandLineInfo::FileNothing;
}
|
|
|
|
|
I am inheriting from a template class in order to store strings within a list type of structure, CGenericList.
I would like to call an instance of this class so that I can use its methods within the implementation of the base class.
CSentenceList.h
class CSentenceList : CGenericList<char*>
{
public:
....
CGenericList<char*> Sentences(); //linked list of sentences
};
CSentenceList.cpp
CSentenceList::CSentenceList(char strFileToRead[MAX_SENTENCE_LENGTH + 1], bool bSorted)
: CGenericList<char*> ()
{//initialize}
...
void CSentenceList::readFile(char strFileToRead[MAX_FILENAME_LENGTH])
{
char strLine[MAX_SENTENCE_LENGTH + 1];
fstream fileToRead(strFileToRead,ios::in);
while (!fileToRead.eof() && Size < MAX_LINES)
// Read line of text from file and update Sentences.strSentence.
{ fileToRead.getline(strLine, MAX_SENTENCE_LENGTH);
Sentences.Insert(&strLine);
// Error 2228: SentenceList.cpp(34): error C2228: left of '.Insert' must have class/struct/union type
Size++;
}
fileToRead.close();
}
How can I use methods of Sentences? Is it possible to implement it in another way?
Jon
|
|
|
|
|
typically derived class is whatever is base class. in this case derived class is defined as a base class and can access base class functions
template <typename t="">
base
{
public:
b(){}
};
template <typename t="">
derived : base<t>
{
public:
d{}
{
base<t>::b()
};
Kuphryn
|
|
|
|
|
I think that's what I'm doing, but I get compiler error C2228.
Jon
|
|
|
|
|
Just out of curiousity, is there some reason you are not using the string and list (or vector ) classes?
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
Zac
|
|
|
|
|
This is an academic assignment and the tutor discouraged me from using strings, because I can understand arrays of chars more easily I guess. I don't know what vectors are to be honest.
Jon
|
|
|
|
|
jon_80 wrote: 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?
jon_80 wrote: 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
Zac
|
|
|
|