|
You need to write a recursive function. At least I hope you do, because that's what I ended up doing....
Christian
The tragedy of cyberspace - that so much can travel so far, and yet mean so little.
And you don't spend much time with the opposite sex working day and night, unless the pizza delivery person happens to be young, cute, single and female. I can assure you, I've consumed more than a programmer's allotment of pizza, and these conditions have never aligned. - Christopher Duncan - 18/04/2002
|
|
|
|
|
3. Do you want to check if the two files have the same set of nodes but may be in different order, and each node may have the same number of children but may be in different order? What about attributes, you want to compare that too?
A simple recursive function will probably not solve this problem. Consider the following extreme case:
< node ...>
< node ...>
< node ...>
< node ...>
...
< /node>
< /node>
...
< /node>
< node ...>
...
< /node>
< node ...>
< node ...>
< node ...>
...
< /node>
...
< /node>
< /node>
...
< /node>
That is, all nodes have the same name but its content may be different. If factor into the effort of comparing attributes (they can also be the same but in different order), camparing two nodes will be a nightmare (at least). It takes someone with your determination to do it.
What do we call the kind of problems we are too stupid to solve? NP-Complete?
|
|
|
|
|
It's pretty clear to me he does not want operator=. You can do that in C++ as easily as your VB example.
He wants to do a difference of the two XML documents, to see what is the same and what is different. That's how I read it, anyhow.
Christian
The tragedy of cyberspace - that so much can travel so far, and yet mean so little.
And you don't spend much time with the opposite sex working day and night, unless the pizza delivery person happens to be young, cute, single and female. I can assure you, I've consumed more than a programmer's allotment of pizza, and these conditions have never aligned. - Christopher Duncan - 18/04/2002
|
|
|
|
|
I have CPropertySheet inside CDialog instead the control with ID - IDC_PROPSHEET_WINDOW.
I have 7 identical CPropertyPage, but with different labels.
The code of realization is given below.
But if tabs are placed more than in one line, there is the mistake of drawing connected by that the top line of tabs is visible only.
Code of realization in OnInitDialog() the following.
m_sheet.AddPage(&m_pageMyPage1);
m_sheet.AddPage(&m_pageMyPage2);
m_sheet.AddPage(&m_pageMyPage3);
m_sheet.AddPage(&m_pageMyPage4);
m_sheet.AddPage(&m_pageMyPage5);
m_sheet.AddPage(&m_pageMyPage6);
m_sheet.AddPage(&m_pageMyPage7);
m_sheet.Create(this, WS_CHILD | WS_VISIBLE);
m_sheet.ModifyStyleEx (0, WS_EX_CONTROLPARENT);
TC_ITEM item;
item.mask = TCIF_TEXT;
TCHAR szText [100];
CString sTitle;
for (int i = 0; i < 7; i++)
{
sTitle.Format(_T("Long label %d"), i);
lstrcpy(szText, sTitle);
item.pszText = szText;
m_sheet.GetTabControl ()->SetItem (i, &item);
}
RECT rect;
HWND hwnd;
GetDlgItem(IDC_PROPSHEET_WINDOW, &hwnd);
ASSERT(hwnd);
if (hwnd)
{
::GetWindowRect(hwnd, &rect);
ScreenToClient(&rect);
m_sheet.SetWindowPos(NULL, rect.left, rect.top, 0, 0, SWP_NOZORDER | SWP_NOSIZE | SWP_NOACTIVATE);
}
Most likely a problem that at addition CPropertyPage they have small length of labels and hold in one line.
And when I change label of the tab on the text with greater long tabs occupy more than one line.
Thus control ceases correctly them to display.
One of decisions, by default in label of the template CPropertyPage to place the text of long not less maximal length of the future label, then all is drawn normally.
Whether there are some more decisions of this problem?
Best regards,
Eugene Pustovoyt
|
|
|
|
|
Hi,
I have a MFC based resource dll,it works fine in Debug mode,But it doesn't in release.The OS i work on is Windows ME.Could anyone help me to make the release build to work fine?
Regards
Neha
|
|
|
|
|
Could you be more specific abt the problem you are facing ?
|
|
|
|
|
Ok,I have a MFC based dll.This dll is been launched from an application.If i build a dll in debug mode ,it works fine.But if i build it in release mode,it crashes.for both debug & release settings options are same.
|
|
|
|
|
i think he meant "can you be more specific about what kind of errors you are getting?"
the easiest way to see where its goofing up is to log certain checkpoints to a text file ... or include debug info in the release build but that might still change the behaviour of certain very subtle bugs
"... and so i said to him ... if it don't dance and you can't eat it either f**k it or throw it away" sonork: 100.18128 8028finder.com
|
|
|
|
|
yea.,u got to give the exact details of the errors, so that i will be easy to fix the problem.
Try debugging in release mode.
or go thru'
http://www.codeproject.com/debug/releasemode.asp
for more details..
rgds,
ravi
|
|
|
|
|
I want to download a site, but how to change the asp file to htm file?
thank you very much.
|
|
|
|
|
Any particular site you had in mind?
cheers,
Chris Maunder
|
|
|
|
|
|
now, codeproject.
if i want to download the page:http://www.codeproject.com/system/hooksys.asp, how can i change it to htm in my soft?
thank you.
zl
|
|
|
|
|
Only open the page, with the IE and make a Save As of it, in html format....
Regards
Carlos Antollini.
www.wanakostudios.com
Sonork ID 100.10529 cantollini
|
|
|
|
|
I don't want to use ie, but how to realize it in a software?
|
|
|
|
|
Connect to port 80, send the HTTP request, get back the entire HTTP content and save to a file with an html extension and ShellExecute the file to open it in IE
Nish
Regards,
Nish
Native CPian.
Born and brought up on CP.
With the CP blood in him.
|
|
|
|
|
thank you very much.
|
|
|
|
|
Chris
How big is the problem where people use web grabbing software to try and download the entire CP site?
Nish
Regards,
Nish
Native CPian.
Born and brought up on CP.
With the CP blood in him.
|
|
|
|
|
Dear friends,
The default window menu in MDI has the following items:
1. New Window
2. Cascade
3. Title
4. Arrage Icons
5. (document names)
Document name can select the corresponding child window and brings it to the top.
I would like to put the "document names" in other menu (not the default window menu).
Would you please give me a suggestion ?
Thanks a lot !
Eric Lee
|
|
|
|
|
Does anyone know how to implement the STL sort function or the knows a website that tells you how to implement it.
Thank you,
Juanito
|
|
|
|
|
sort takes two iterates and an instance of the type.
sort(I i1, I i2, T t1)
{
while (i1 != i2)
{
if ( *i1 == t1)
return i1;
++i1;
}
return i1;
}
Actually, the STL code is provided with your compiler, so you can see exactly how they did it, it's in algorithm. I doubt it's much different to the above though.
Christian
The tragedy of cyberspace - that so much can travel so far, and yet mean so little.
And you don't spend much time with the opposite sex working day and night, unless the pizza delivery person happens to be young, cute, single and female. I can assure you, I've consumed more than a programmer's allotment of pizza, and these conditions have never aligned. - Christopher Duncan - 18/04/2002
|
|
|
|
|
sort(I i1, I i2, T t1)
{
while (i1 != i2)
{
if ( *i1 == t1)
return i1;
++i1;
}
return i1;
}
Man, what is that? Seems like a search routine.
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
Ooops....
I guess I should look more closely....
Christian
The tragedy of cyberspace - that so much can travel so far, and yet mean so little.
And you don't spend much time with the opposite sex working day and night, unless the pizza delivery person happens to be young, cute, single and female. I can assure you, I've consumed more than a programmer's allotment of pizza, and these conditions have never aligned. - Christopher Duncan - 18/04/2002
|
|
|
|
|
Okay. I have determine one major problem, or should I say characteristic of WSASend and/or WSARecv.
For some reason, I cannot call WSASend one after another. For example, let say I call WSASend to send a 4 byte buffer to the client indicating the size of the incoming data. That works find and the client receives the first WSASend package without problems. However, for some reason I cannot call WSASend the second time to send the actual package. The error on the *sending* side is WSAEFAULT:
// WSAEFAULT: "Bad address"
The error on the *receiving* side is WSAEWOULDBLOCK:
// WSAEWOULDBLOCK: "Resource temporarily unavailable"
The bottomline is I cannot send two data buffer consecutively. I am using the WSAAsyncSelect I/O Mode. Is there a specific specification that I missed as far as sending and receiving?
Please message me if you have any ideas.
Thanks,
Kuphryn
|
|
|
|
|
kuphryn wrote:
// WSAEFAULT: "Bad address" More specifically, this means: The lpBuffers, lpNumberOfBytesSent, lpOverlapped, lpCompletionRoutine parameter is not totally contained in a valid part of the user address space. Check the pointers you pass to WSASend.
kuphryn wrote:
// WSAEWOULDBLOCK: "Resource temporarily unavailable"
This simply means that there's no incoming data to be read.
|
|
|
|