|
Hi,
I have a XML file which needs to be first validated using a DTD and then parsed to get values & properties associated with tags.
I am using Visual Studio's VC++ 6.0 to write my code. Is anyone aware of any reference or tutorial which would help me learn the same.
Thanks You!!
Regards
|
|
|
|
|
I use Xerces[^] to do just that. Imho, it's much faster than MSXML.
/ravi
My new year's resolution: 2048 x 1536
Home | Articles | Freeware | Music
ravib@ravib.com
|
|
|
|
|
Ravi Bhavnani wrote:
Imho, it's much faster than MSXML.
Most anything would be.
Neville Franks, Author of ED for Windows www.getsoft.com and coming soon: Surfulater www.surfulater.com
|
|
|
|
|
Ravi Bhavnani wrote:
Imho, it's much faster than MSXML.
The last version I used was much slower than MSXML (some coworkers of mine actually measured). However that was more than 2 years ago and it is quite possible that things are different now.
My programming blahblahblah blog. If you ever find anything useful here, please let me know to remove it.
|
|
|
|
|
|
Is the source code included in the free version?
/ravi
My new year's resolution: 2048 x 1536
Home | Articles | Freeware | Music
ravib@ravib.com
|
|
|
|
|
No ,
The zip file (free) contanis some examples, include files and .lib files.
Also Apache Xerces is a good alternative.
Ivan Cachicatari
www.latindevelopers.com
|
|
|
|
|
Ivan Cachicatari wrote:
Also Apache Xerces is a good alternative.
Yes, that's what I use.
/ravi
My new year's resolution: 2048 x 1536
Home | Articles | Freeware | Music
ravib@ravib.com
|
|
|
|
|
I was writing a very simple chatapplication, I compiled it with no errors (it was
first about 127 errors) and no warnings. I wanted to run and than suddenly I got that
message:
Debug Assertion Failed!
I thaught that when there is no error occured, my application will work fine.
But in this case , there is this serious error, so I hope somebody is willing
to help me out. I clicked on Debug GO and after clicking on ignore-button
at the "Debug Assertion Failed" message I get on the this-tab the following
text: this CXX0017: Error: symbol "this" not found
On the locals-tab I get the following text:
+ hInstance 0x00000000
+ hPrevInstance 0x816724e4
+ lpCmdLine 0x00540000 ""
nCmdShow 1919251285
So, I really don't know what's going on, this is my first "complex" application
I wrote. And my goal is to make a very simple chat-application, learn from it and
than write an application to control electronic devices via internet with the basic
of my chatapplication.
Loaded symbols for 'C:\WINDOWS\SYSTEM\MFCN42D.DLL'
Loaded symbols for 'C:\WINDOWS\SYSTEM\MFCO42D.DLL'
Loaded 'C:\WINDOWS\SYSTEM\USER32.DLL', no matching symbolic information found.
................
...........
................
This version of oleaut32.dll is fully functional only on Windows 2000 (R) and higher.
Loaded 'C:\WINDOWS\SYSTEM\MSWSOCK.DLL', no matching symbolic information found.
Loaded 'C:\WINDOWS\SYSTEM\4dhook.dll', no matching symbolic information found.
Error: no data exchange control with ID 0x03EB.
First-chance exception in UserTalk.exe (MSVCRTD.DLL): 0xE06D7363: Microsoft C++ Exception.
Loaded 'C:\WINDOWS\SYSTEM\MSWSOSP.DLL', no matching symbolic information found.
Loaded 'C:\WINDOWS\SYSTEM\MSAFD.DLL', no matching symbolic information found.
Loaded 'C:\WINDOWS\SYSTEM\RAPILIB.DLL', no matching symbolic information found.
Loaded 'C:\WINDOWS\SYSTEM\RSVPSP.DLL', no matching symbolic information found.
Loaded 'C:\WINDOWS\SYSTEM\NTDLL.DLL', no matching symbolic information found.
Loaded 'C:\WINDOWS\SYSTEM\COMCTL32.DLL', no matching symbolic information found.
The program 'c:\APPI\UserTalk\Debug\UserTalk.exe' has exited with code 0 (0x0).
If someone wants to help me online (msn), this is my email: ammeniar@hotmail.com
I hope I informed you well so you wizbrotherz can help me to get a step closer
to the magic world of computerprograms.
Thank you very much!
|
|
|
|
|
I thaught that when there is no error occured, my application will work fine
Sorry, but that's so far from the truth. The language rules (which is all the compiler can check) allow many things that are prohibited by the "contract" (that is, how a function is supposed to be used).
No useful programming language can guarantee tzhe program does what you expect, but C++ requires much more discipline, self-control and knowledge than other languages.
Assert's are debug-time checks that verify things that should not happen (like passing a NULL pointer to a function that does not allow NULL pointers)
"this not found" usually means you are currently not in a class' member function.
As much as I'd love to help you, you probably need to start with smaller applications, trying to learn and understand concepts, common tools etc.
I understand the desire for a "real" application, but you need to learn a few fundamentals first. There's nothing magic about things you understand.
we are here to help each other get through this thing, whatever it is Vonnegut jr.
sighist || Agile Programming | doxygen
|
|
|
|
|
hi..
i'm going through hell trying to activate the system speaker. when i try to use the "kernel32" Lib API function "BEEP", i only get a beep in the soundcard's speakers. if they happen to be turned off - i get nothing.
note that:
1) i am using windows 98
2) there is a built-in motherboard system speaker. it's device driver is VMM32.VXD, and the devicer manager says it's functioning properly.
3) the internal speaker itself IS working (it beeps every time i turn the computer on).
4) there is a sound card installed. it's an avance ALS120, and it's driver is ALSWDM.SYS.
if anyone knows anything about this - it doesn't matter if it's in visual C++ or visual basic or whatever, just make the thing beep..
and thanx anyway.
|
|
|
|
|
udi32 wrote:
when i try to use the "kernel32" Lib API function "BEEP",
Are you referring to MessageBeep() ?
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
|
|
|
|
|
#include <iostream>
using namespace std;
int main() {
cout << (unsigned char)0x07 << endl;
}
If you can keep you head when all about you
Are losing theirs and blaming it on you;
If you can dream - and not make dreams your master;
If you can think - and not make thoughts you aim;
Yours is the Earth and everything that's in it.
Rudyard Kipling
|
|
|
|
|
hi.
using MessageBeep(-1) did the trick. thanks for helping, you're all great. if you happen to know a way to control the length of the beep (so i won't have to use a loop) it would be great.
and thanks.
|
|
|
|
|
Has anybody managed to get the grouping working with the list control (as seen in My Computer as it separates your hard drives from your CD ROMs for example)?
It feels like I have been banging my head against a brick wall all afternoon trying to get it to work with no joy.
I have created a new project with VS 2002 so I assume all the manifest requirements have been met.
I then get the list control from the CListView and add a group using the InsertGroup() function.
I then insert two items using the InsertItem() function and for each item I set the Group ID to the corresponding group.
This is the code I have so far. I would be eternally grateful if someone could point out what I am not doing correctly or have failed to do all together.
//Get the listCtrl from the View
CListCtrl& ctrl = GetListCtrl();
//View control in icon veiw
ctrl.ModifyStyle(0, LVS_ICON);
//Enable the Group View so we can group the entries
ctrl.EnableGroupView(TRUE);
//Add a Column
ctrl.InsertColumn(0, "Name");
ctrl.SetColumnWidth(0, 300);
//Add the groups to the control
LVGROUP* pGroup = new LVGROUP;
if(pGroup != NULL)
{
ZeroMemory(pGroup, sizeof(LVGROUP));
pGroup->cbSize = sizeof(LVGROUP);
pGroup->mask = LVGF_HEADER | LVGF_ALIGN | LVGF_STATE | LVGF_GROUPID;
pGroup->pszHeader = L"Coordinate Reference Systems";
pGroup->cchHeader = 28;
pGroup->stateMask = 0;
pGroup->state = LVGS_NORMAL;
pGroup->uAlign = LVGA_HEADER_LEFT;
pGroup->iGroupId = 0;
LRESULT res = ctrl.InsertGroup(0, pGroup);
TRACE("Group added");
}
//Add a second group
LVGROUP* pGroup2 = new LVGROUP;
if(pGroup2 != NULL)
{
ZeroMemory(pGroup2, sizeof(LVGROUP));
pGroup2->cbSize = sizeof(LVGROUP);
pGroup2->mask = LVGF_HEADER | LVGF_ALIGN | LVGF_STATE | LVGF_GROUPID;
pGroup2->pszHeader = L"Coordinate Reference Systems";
pGroup2->cchHeader = 28;
pGroup2->stateMask = 0;
pGroup2->state = LVGS_NORMAL;
pGroup2->uAlign = LVGA_HEADER_LEFT;
pGroup2->iGroupId = 1;
LRESULT res = ctrl.InsertGroup(1, pGroup2);
TRACE("Group added");
}
//Add a couple of items
LVITEM* pLVItem = new LVITEM;
ZeroMemory(pLVItem, sizeof(LVITEM));
pLVItem->mask = LVIF_GROUPID | LVIF_TEXT;
pLVItem->iItem = 0;
pLVItem->iGroupId = 0;
pLVItem->pszText = _T("Andy");
pLVItem->cchTextMax = 4;
ctrl.InsertItem(pLVItem);
LVITEM* pLVItem2 = new LVITEM;
ZeroMemory(pLVItem2, sizeof(LVITEM));
pLVItem2->mask = LVIF_GROUPID | LVIF_TEXT;
pLVItem2->iItem = 1;
pLVItem2->iGroupId = 1;
pLVItem2->pszText = _T("Richie");
pLVItem2->cchTextMax = 6;
ctrl.InsertItem(pLVItem2);
Cheers
AndyC
|
|
|
|
|
You've failed to state the problem. Are you getting compiler or linker errors? Is an assertion firing? Is an exception being thrown? I see very little error checking. Is this intentional, or done for the sake of brevity? Are any of the functions returning "error" status?
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
|
|
|
|
|
The problem is that the groups are not being displayed. When the lsit control gets displayed the two Items are present but like I said there are no groups.
The code included in my original post is a bit of proof of concept code, ie just to see the groups working.
I was convinced that none of the functions were returning error codes, so I have been back and checked just to be sure. None of the functions return an error code, however what doesn't seem right is the fact that bot calls to InsertGroup returns 0 it should return "index of the item that the group was added to". So I would expect the first call to return 0 but the second call I would expect to return 1.
Cheers
Andy
|
|
|
|
|
AndyCheetham wrote:
So I would expect the first call to return 0 but the second call I would expect to return 1.
As grouping is a new thing to VS.Net, I've no experience with it. In your code, you added two groups. You then added one item to each group. My guess is that the items in each group are independent of the other. In other words, if you added five items to the first group, they would be numbered 0-4. If you added five items to the second group, would they be numbered 0-4 or 5-9?
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
|
|
|
|
|
Hi David
Thanks for your input. Just thought I would let you know that I have solved the problem.
You need to include the following line in the rc file!
CREATEPROCESS_MANIFEST_RESOURCE_ID RT_MANIFEST "GLook.manifest"
where Glook.manifest id replaced with the file name for the manifest file for your application.
Unfortunately this is mentioned in the help file that I looked at when I first started looking into the problem. One day I will learn to read instructions more carefully.;)
Thanks for your help
Andy
|
|
|
|
|
What do you think about Linux? Do you use Linux for programming? Have you ever heard about Mono project? .NET strategy is working now under Linux. What do you think about that?
Thanks.
|
|
|
|
|
Well since I am bored, and have already hit my productivity quotient for the day, I'll bite.
I think that as a kernel Linux is fine. It has some nice features, scales well, is reasonably stable, and the new 2.6 version adds some nice performance improvments. So from a 10,000 foot view, it's OK, no better or worse than other kernels out there (well maybe a bit better, at least in terms of flexibility). However from a design standpoint, from a "lets try something new" standpoint, it's mind numbingly boring in a lot of ways. Linux carries on many unix traditions as if they were the be-all end-all of computer OS design, which is a shame, because IMHO, in 2004, many of the Unix design decisions are fairly lame. For example, security. Linux (and most Unices) security is *still* implemented as nothing more than a 32bit value that gets set. Win32 security mechanism (which is almost a direct copy of what's been used on VMS for the last 20 or so years) is infinitely more flexible, and far easier to admin in terms of understanding it, and making changes to the system.
Another example is the insistence on *everything* being a character stream (or practically everything). That and an incomprehensible naming pattern that makes understnading what devices you have connected to the OS extremely difficult. Don't beleive me? Look in /dev and tell me what all that is?
Linux the OS, i.e. all the userland stuff, like cp, ls, man, rm, cat, etc, is a dog, in my opinion. Most of the brain dead unix design decisions that were made in the 70's are *still* there in Linux! Keep in mind that the same group that whines, cries, and belittles MS for being un-innovative, has done *nothing* to bring linux forward using state of the art OS techniques and designs. From incomprehensible commands like cat, rm, ls (WTF is ls? please try explaining that to anyone not a programmer), awk, groff, sed, and on and on and one, ad nauseam.
And if you thought the commands were weird how about getting help? Want help? type man! What's "man" you ask? Why isn't it "help" (this is what VMS uses)?
Once you get used to terse 2-3 letter commands you have the joy of the linux file system to uncover. Want to find where something is executed from? Is it /usr/bin, /bin, /sbin, /usr/sbin, /usr/local/bin, etc etc. What's "bin"? What's "usr"? It's 2004, why can't we move forward and give human readable names to things. Keep in mind this is linux we are talking about - a freely available system that could be changed, but rarely is. Don't get me wrong, there are projects that attempt to changes bits and pieces of all of this, but none which do so in any well thought out cohesive manner. What's even worse is that even if it was done it's adoption would be glacial at best, since by and large the linux community appears to be every bit as conservative and locked into the past as the companies that the community makes fun of.
Another example of linux dippiness: shared libraries. People continually piss and moan about DLL Hell on Win32. And it's a completely valid criticism. Only its just as bad on linux/unix! You have stuff spread out all over the place, in directories whose location you're not even sure about, with symlinks to this, that and the other till you're blue in the face. All so you can load up the *right* version of your SO. When even the easiest option, i.e. putting the library right in the same directory as an exe, and the exe can't load it up! That's right, the ld program (the one responsible for loading the shared library), cannot find a SO that's in the same dir as the starting exe unless the lib is either added to the LD_LIBRARY_PATH, or hard coded into the exe's ld path during compilation/linkage. This is a carry over from unix, and never once has it been questioned AFAIK!
Do you use Linux for programming?
Well that depends on what kind of programming you're referring to. If you mean general system level stuff, then yeah I can imagine using it. But if you mean the nightmarish hack that is linux GUI development then hell no. Why do I say this? Good question!
Linux GUI development is a nightmare for several reasons. But the number one reason is the utter, and complete lack of any sort of suitable basic API to work with. Unlike Win32, MacOS Classic/OSX, AtheOS, NeXT, SkyOS, or BeOS (I threw in some hobby OS's just to show that even non-commercial attempts can get it right), the linux GUI has no standards, no base API to which a developer can write against. Instead there is simply a gaping vacuum that various toolkits try desparately to fill, causing endless, repititious re-invention of the wheel at almost every basic level of UI functionality, with varying degrees of success. For example, in most OS's the core API's you work with provide such basic features as:
-Clipboard support (both text and binary) for Copy/Paste
-Drag/Drop (or direct manipulation)
-Standard directory locations and API's for locating them
-basic graphics routines
-basic font handling and text drawing routines
-Menu bars, menus, and menu items
-tooltips
-a basic help system
-standard controls, like a text control, list control, dropdown, tree control, push button, radio button, check box, etc
When programming a GUI for linux NONE of this is "standard". Part of the treat of linux, one of the things that its' fans make such a big deal of, is the concept of "choice", that you can choose to use what ever you want. This is great from a system designer standpoint, or to someone putting together an OS distro. It's less than helpful to a developer who just wants to write their application. For example, in Win32 or OSX (or the other's I mentioned), one can request a font by passing in a font name (like "Times New Roman", or "Lucida"), and optionally a size, and maybe a few other parameters, and the system will guarantee to return you a font that matches as closely as possible to what you requested. This is accomplished because all these OSs build in a font mapper that knows how to do this.
Now attempting the same thing in linux is nowhere near as simple. First you must choose what toolkit you want to use. Why? Because unlike the other OSs linux has no native, core API's that handle this. B-b-but it has X, you say! X (or X Windows), in it's infinite wisdom, has no support for this either. It forces the end user to implement font mapping behaviour themselves! At best X can plop a rectangular window on a screen (but hey! it can do this remotely too! Woot!), and that's about it. Of course there are extensions to it (like XRENDER, XDAMAGE), but not everybody has them, and then you have to test for them, and ad nauseam, blah, blah, blah! Because X implementers and designers chose the path of least functionality (part of their mantra of "mechanism not policy"), the whole desktop has suffered. Great for university UI designers to play around with research ideas, but utterly lousy for developers who want to write real world applications with a standard UI.
Once you choose a toolkit you now have another problem. Each of the toolkits tends to be kind of mutally exclusive - you don't write an app in Qt and then add Gnome features, or a Gnome app and then add KDE features. It might be possible but it's ugly partially because your app is FORCED to load up both toolkits go achieve this, and then the user is of course forced to have both toolkits on their machine. Thus an application tends to be completely locked in to one toolkit, it's too expensive to change. And since linux offers no base library for any of the features listed above, every toolkit must implement these, which if we have the case above, means loading up dozens and dozens of smaller libraries, duplicating functionality all over the place. Keeping in mind that Gnome and KDE are both multi-million LOC projects.
Have you ever heard about Mono project? .NET strategy is working now under Linux. What do you think about that?
Yes I have heard of it. And I have said many times here on discussions about it that I think it's a walking lawsuit! If you had paying customers, on whose revenue and goodwill you dependended on for your livelihood, would you be willing to bet all of that on a Mono based solution, all on the chance that Microsoft will break with all prior behaviour and not pile-drive Mono into the ground should they ever start to catch on? Of course I'm not really a fan of .NET anyhow, much carbon copy of it, whose legality is kind of shaky at best.
¡El diablo está en mis pantalones! ¡Mire, mire!
Real Mentats use only 100% pure, unfooled around with Sapho Juice(tm)!
SELECT * FROM User WHERE Clue > 0
0 rows returned
|
|
|
|
|
One of the best posts on Linux I have ever heard! It's a pity the rating system only goes up to 5 It deserves at least 10 times that...
Ryan "Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late" John Nichol "Point Of Impact"
|
|
|
|
|
Thanks!
¡El diablo está en mis pantalones! ¡Mire, mire!
Real Mentats use only 100% pure, unfooled around with Sapho Juice(tm)!
SELECT * FROM User WHERE Clue > 0
0 rows returned
|
|
|
|
|
Excellent post Jim. 10 from me as well. Having said that I have to report that I think you need to get VCF going on Linux, as painfull as that will be.
It seems that there is this unstoppable train moving towards Linux. Stuffed if I know what is going to happen to commercial software developers like me when that happens, suffice to say we'll need to change careers or retire, as it is hard to see anyone paying for Linux software.
Neville Franks, Author of ED for Windows www.getsoft.com and coming soon: Surfulater www.surfulater.com
|
|
|
|
|
Thanks!
Well the hardware's a tad more expensive, but, IMHO well worth it, so instead of linux, encourage everyone you know to consider OSX - at least they have a community that appreciates the full range of software, from free to commerical.
¡El diablo está en mis pantalones! ¡Mire, mire!
Real Mentats use only 100% pure, unfooled around with Sapho Juice(tm)!
SELECT * FROM User WHERE Clue > 0
0 rows returned
|
|
|
|
|