|
Have you tried TinyXML?
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
I think it might help to know exactly what you need to do with the XML file after loading it. Do you need to parse it and extract data, add/modify data to it, or simply render (display) it in some way?
Also, you mention "window form", which is damn close to "windows forms", which sounds .NET-ish. If you are asking how to do this on the .NET platform, I suggest asking with more details in a .NET-specific forum (like the C# forum).
Peace!
-=- James Please rate this message - let me know if I helped or not!<HR> If you think it costs a lot to do it right, just wait until you find out how much it costs to do it wrong! Avoid driving a vehicle taller than you and remember that Professional Driver on Closed Course does not mean your Dumb Ass on a Public Road! See DeleteFXPFiles
|
|
|
|
|
I need to extract data from the Xml file.
|
|
|
|
|
If you are using .NET and C++/CLI, you can use the System.Xml namespace to access classes such as XmlDocument and XmlReader to extract XML from a file. If you are using "native" Visual C++, you can use MSXML or XmlLite from Microsoft. Except for XmlLite, there are a lot of articles on Code Project and other sites (Can you Google?). XmlLite is new but their is an article about this or last month's MSDN Magazine. Example code for MSXML is not very plentiful also.
"We make a living by what we get, we make a life by what we give." --Winston Churchill
|
|
|
|
|
Actually, the C++/CLI forum might be what this poster wants.
"We make a living by what we get, we make a life by what we give." --Winston Churchill
|
|
|
|
|
For reading XML file, you need a parser (for eg. MSXML). Get MSXML download from Microsoft.
Refer this[^].
Regards,
Paresh.
|
|
|
|
|
|
Hey code mercenaries,
I'm new to MFC, but I've been hired to update a
Visual C++/MFC application. Mostly going pretty
well, but it wouldn't be any fun if there weren't
at least a few hickups, right?
Basically the application that I am working on is
a quasi complicated app with about a thousand
classes or so, which uses numerous pages/tabs/views/lists
to display some database info.
I am adding a new SQL query class to a payment
calculator class so i can do some new calcs on the
db info.
This is causing a Heap Error:
/////
HEAP CORRUPTION DETECTED: after client block (#4531) at 0x015E51B0. CRT detected that the application wrote to
memory after end of the heap buffer.
/////
The error occurs when I am closing the application,
but I have tracked the source down to the following
line of code:
////
CSetspIsAttachedAuthValid* m_pSetspIsAttachedAuthValid2; ////
Basically the error occurs when this line is inserted
into the code, and does not occur when it is commented
out, regardless of whether I actually use this member
or not in any way. Just adding the above line to the
header file causes the heap error, which occurs on
close of the application.
What could possibly be causing this? Is there some reason
why I can't add a member to an existing class in this
application with out causing an error? i have added
other members to this same class with out trouble.
HUGE thanks - Jason
|
|
|
|
|
You've probably exposed an existing problem.
Is the block number always #4531?
Mark
"Posting a VB.NET question in the C++ forum will end in tears." Chris Maunder
|
|
|
|
|
@largeinsd wrote: Basically the error occurs when this line is inserted
into the code, and does not occur when it is commented
out...
Which means you've moved memory around just enough to expose an existing problem. What happens if you insert some other type of pointer (in place of CSetspIsAttachedAuthValid ), or maybe a DWORD variable?
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
Try enabling the page heap[^] for your process. Follow these steps:
1. Download and install WinDBG[^].
2. Select “Start”->“All Programs”->“Debugging Tools for Windows”->“Global Flags”.
3. Select the “Image File” tab.
4. In the “Image: (TAB to refresh)” edit control enter the name of your app then press TAB. Just the name with the extension; not the full path.
5. Tick the following:
- “Enable page heap”
- “Enable heap tail checking”
- “Enable heap free checking”
- “Enable heap parameter checking”
- “Enable heap validation on call”
- “Create user mode stack trace database”
6. Press “Apply”.
7. Debug your application. Any debugger will do but with WinDBG you have access to the stack traces of allocations via the !heap –p –a command, for example. When a heap problem is detected a breakpoint will be generated.
8. When done un-tick all the options you ticked, press “Apply” then dismiss GFlags. This step is important as if it’s skipped all applications named as entered in step 4 will run with the page heap enabled.
Note that when using the page heap your application will run much slower than normal and consume way more memory. It’s good to have a beefy machine to do such tests; and such tests should be ran regularly on all applications you develop as part of regular testing activities. If I find a part of my application that’s too slow with the page heap enabled I optimize the memory allocation in that region.
Steve
|
|
|
|
|
Hello,
I have an OCX control, I've declared a variable that points to that ocx, so I can write "TAM_OCX. and the intellisense shows me all my possibilities.
I've been able to see one function inside that ocx:
TAM_OCX.OnCmdMsg(UINT nID, int nCode, void *pExtra, AFX_CMDHANDLERINFO *pHandlerInfo);
How can I link a function to that event? or how can I handle that event?
As always, thank you in advance.
|
|
|
|
|
HI,
I am new to MFC application pls kindly advice.
Am using Microsoft VC++ .Net 2003,
1.) I am using a animation ctl to play a avi file with the click of a button,however when the avi file is play it will not play sound, it will only show the movie.
2.)Some of the avi that i have down load from the net is unable to use in m appliction,on that those avi files that are in the micrsoft am able to use. Is it because of the video sample size?
3.) How to play a wave file when a button is click?
Thanks in advance.
WSY
|
|
|
|
|
YUANGE wrote:
3.) How to play a wave file when a button is click?
Try sndPlaySound() or PlaySound() .
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
Hi David,
Thanks for the prompt,as am new to MFC can u show example how to use sndPlaySound/PlaySound.
Thanks !!
|
|
|
|
|
YUANGE wrote: ...can u show example how to use sndPlaySound/PlaySound.
See here.
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
Sorry..
I dun seen understand the source code from the net..
can u show me an example..
thanks again
|
|
|
|
|
If this is too much for you, perhaps you should master the basics first.
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
for 1 and 2 -
"Animation controls can only display AVI clips that do not contain audio."
To explore various options for playing AVI (and other) video files, see the following:
Graphics and Multimedia[^]
DirectShow[^]
Windows Multimedia Start Page[^]
"Posting a VB.NET question in the C++ forum will end in tears." Chris Maunder
|
|
|
|
|
I suggest use of MCI functions they can show wav,mp3,mpeg,avi
|
|
|
|
|
Hello all,
I need to close my app (this->SendMessage(WM_CLOSE); ) just when the user set the focus to another application.
In the main dialog pretranslatemessage handler, I've tried to capture the messages WM_KILLFOCUS, WM_ACTIVATEAPP, WM_ACTIVATE and WM_COMMAND . (All of them without luck).
Could you please tell me which one should I use?
Thank you in advance.
|
|
|
|
|
WM_ACTIVATEAPP would be appropriate. Why are you overriding PretranslateMessage? Why not to handle the message through MFC message map; use ON_WM_ACTIVATEAPP() inside the BEGIN_MESSAGE_MAP and END_MESSAGE_MAP pair. Also this is the prototype of the handler
void CMyDialog::OnActivateApp(BOOL , DWORD);
--
=====
Arman
|
|
|
|
|
Worked...
I do not understand why it did not worked inside the PreTranslateMessage...
Thank you for yuor feedback.
|
|
|
|
|
hello i am z1n i'm really interested in learning c++ so where should i go first hoping some of you vets could show me the best resource's?
|
|
|
|
|
A good free online resource is books by Bruce Eckel[^]
--
=====
Arman
|
|
|
|