 |

|
Good article
cheers,
Donsw
My Recent Article : Ajax Calendar Control
|
|
|
|

|
Class works excellent, you got my 5.
This class is the only acceptable solution for saving xml settings from MFC app.
|
|
|
|

|
Agree, this is just a simple solution that works! Need some small changes to work with UNICODE and to store files in app_local_data. The rest is just perfect.
|
|
|
|

|
Hi Jason,
Thank you very much for your article!
One question, I think already asked by another CP reader: How easy would it be to support XML Attributes?
For example:<MySettings>
<Users>
<User ID="Fred"> <-------- ID is an attribute
<Font>Courier</Font>
</User>
<User ID="Bob">
<Font>Arial</Font>
</User>
</Users>
</MySettings>Apart from this suggestion for improvement, your code is simple, yet very functional. A great piece of work, well done!
--
/stokos
|
|
|
|

|
Hi
I am able to wite diffrent type of shapes using xmlwitter.
But not able to read that shapes using xmlreader.
please help me out.
Prajakta
|
|
|
|

|
I've never worked with shapes in xml before. I assume its still just text? If so, I wouldn't know why you couldn't read it. Does it give you an error code?
"Acceptance without proof is the fundamental characteristic of Western religion, rejection without proof is the fundamental characteristic of Western science." - Gary Zukav |
|
|
|

|
I have finished with saving shapes. But I'm not able to save images and text font. I have two separate controls one is Bitmap and another one is Textbox. Using Bitmap user can add image to current drawing and using Textbox Text.
I'm not able to save the image file and font related information to xml.
Can you help me out??
Prajakta
|
|
|
|

|
void Release() throw()
{
ATLASSERT( nRefs != 0 );
if( _InterlockedDecrement( &nRefs ) <= 0 )
00438A42 lea eax,[ecx+0Ch]
00438A45 or edx,0FFFFFFFFh
00438A48 lock xadd dword ptr [eax],edx /*<< HERE*/
00438A4C dec edx
00438A4D test edx,edx
00438A4F jg ATL::CStringData::Release+19h (438A5Bh)
{
pStringMgr->Free( this );
00438A51 mov eax,dword ptr [ecx]
00438A53 mov edx,dword ptr [eax]
00438A55 push ecx
00438A56 mov ecx,eax
00438A58 call dword ptr [edx+4]
}
}
00438A5B ret
The Parser Works fine, but if my app end a [debug][cancel][send to ms] Erro occurres. I just have to do:
CXMLSettings *xmlSettings;
xmlSettings = new CXMLSettings();
anywhere to cause this.
-- modified at 3:35 Wednesday 20th December, 2006
|
|
|
|

|
Check the obvious first - are you deleting the pointer you allocated?
delete xmlSettings;
"Acceptance without proof is the fundamental characteristic of Western religion, rejection without proof is the fundamental characteristic of Western science." - Gary Zukav |
|
|
|

|
If the code is truly lost, this article should be removed.
Too bad, it sounds useful.
I'm guessing that there is another article with the same name.
|
|
|
|

|
TomM wrote: If the code is truly lost, this article should be removed.
Too bad, it sounds useful.
I'm guessing that there is another article with the same name.
The URLs to the zips were incorrect. It's been fixed now. Please try downloading the zips once more.
Regards,
Nish
|
|
|
|

|
I spent several hours yesterday looking through CodeProject for C++ code that I can use to read and write application settings into an XML file. This project *WAS* one of my prime candidates, the first one I opened of the .ZIP files I fetched. Imagine my "surprise" when, instead of finding .cpp and .h files in the .ZIP file, I found ones with .cs and .resx extensions - leaving me wondering "what is ??this??" (I've never done any "CSharp" programming before, and have no intention of doing any in the future, so these filename extensions meant nothing to me.) Fortunately, a quick look into the third file I tried opening with Notepad - the _project_ file - told me what was going on - and that this code is completely useless to me.
Do us all a favor: Any time you post code to CodeProject, SPECIFY THE LANGUAGE IT'S WRITTEN IN, IN THE BODY OF YOUR ARTICLE, AT LEAST, and, preferably, in the title line.
Of course, if the CodeProject search system would *exclude* C# articles when the C# checkbox is unchecked during a search, that would help also - but it won't work if the system doesn't know what language your code is written in, in the first place.
Just my $0.02 worth ...
|
|
|
|

|
Well Ace, this was a C++ project but it has somehow gotten mixed up with another article. Perhaps an editor messed up or something. Anyway, I do not have the code for the article any longer so you will have to figure it out for yourself or find a different example. I might update it someday, but I'm pretty busy right now. Sorry.
"Live long and prosper." - Spock
|
|
|
|

|
Okay, the zip URLs are wrong. I am trying to fix this now!
Regards,
Nish
-- modified at 17:44 Friday 21st April, 2006
|
|
|
|

|
There was an error in the download URLs. It's been fixed. Please try again.
Regards,
Nish
|
|
|
|

|
Nishant Sivakumar wrote: There was an error in the download URLs. It's been fixed. Please try again.
Thanks for fixing this Nish. I just now noticed.
"Acceptance without proof is the fundamental characteristic of Western religion, rejection without proof is the fundamental characteristic of Western science." - Gary Zukav |
|
|
|

|
Jason Henderson wrote: Thanks for fixing this Nish. I just now noticed.
You are welcome. I was wondering just when you'd thank me. It's been a while now you see.
|
|
|
|

|
I see that.
But thanks again.
"Acceptance without proof is the fundamental characteristic of Western religion, rejection without proof is the fundamental characteristic of Western science." - Gary Zukav |
|
|
|

|
jason u noob! C# or C++? omg! wake up! jesus!
|
|
|
|

|
Hi, I'd like to test your CXMLSettings Class but I can't find it in the sources you gave in Code Project ?
Do you have a version in Visual C++ 6.0 ?
Thank's in advance !
Nicolas
|
|
|
|

|
This is very strange. That is not my source code or demo project.
I will try to find the original code and repost it.
"Live long and prosper." - Spock
|
|
|
|

|
Thanks !
|
|
|
|

|
Any chance you found it yet? The contents of the download still don't seem to match your article.
|
|
|
|

|
No dice. Sorry.
It's not in Google's cache either.
"Live long and prosper." - Spock
|
|
|
|

|
prcarp wrote: Any chance you found it yet? The contents of the download still don't seem to match your article.
The code is restored if you are still interested.
"Acceptance without proof is the fundamental characteristic of Western religion, rejection without proof is the fundamental characteristic of Western science." - Gary Zukav |
|
|
|

|
Thanks, Jason! Just in time for my next project....
|
|
|
|

|
Nicolas DUFAUT wrote: Hi, I'd like to test your CXMLSettings Class but I can't find it in the sources you gave in Code Project ?
Do you have a version in Visual C++ 6.0 ?
Thank's in advance !
The code is restored if you are still interested.
"Acceptance without proof is the fundamental characteristic of Western religion, rejection without proof is the fundamental characteristic of Western science." - Gary Zukav |
|
|
|

|
Hi,
I took me 3 hours to find out why the whole thing doesn't work for me. So if you're making a new projects yourself don't forget to put
CoInitialize(NULL);
in the beginning.
Slawa.
|
|
|
|

|
Good point. The XML parser won't work without it.
Jason Henderson My articles
"The best argument against democracy is a five-minute conversation with the average voter." - Winston Churchill
|
|
|
|

|
Thanks for the submission!
|
|
|
|

|
You're very welcome.
Jason Henderson "You must be the change you wish to see in the world." - Gandhi
articles profile
|
|
|
|

|
Hi, Good work. I like your program a lot. I'm sorry to see the criticism - its completely out in the woods. I see CP as a place to get inspiration, and your program has given me that. Thanks. Do you know anything about adressing attributes in xml?
brgds
Jesper Odgaard Nielsen, DK
|
|
|
|

|
Jesper Odgaard Nielsen wrote:
Do you know anything about adressing attributes in xml?
Not sure what you mean.
Jason Henderson "You must be the change you wish to see in the world." - Gandhi
articles profile
|
|
|
|

|
For those of you who have been discussing the merits of the registry it would seem MS has a new Isolated Storage mechanism which replaces the previous methods of storing data in Windows .ini files and the system Registry.
For more info see: Maintaining User-Specific Data Using Isolated Storage and C# at http://codeguru.earthweb.com/cs_data/IsolatedStorage.html[^] I know they are the enemy but ...;P
Neville Franks, Author of ED for Windows. www.getsoft.com
|
|
|
|

|
Hi,
It's a good idea, I like it, thanks for your article.
So long
Braulio
|
|
|
|

|
Very usefull class!
Thanks.
|
|
|
|
|

|
Get a life.
Jason Henderson start page articles "If you are going through hell, keep going." - Sir Winston Churchill
|
|
|
|

|
I have a life, and in my life I don't put CString in my headers. I am so tired of seeing this. By putting CString in your interface, you force your clients to to use MFC or WTL or something with CString. Use LPCTSTR in your interface and if you must, use CString in your implementation.
|
|
|
|

|
I gave out the source code so if you don't use MFC go change it yourself!
Jason Henderson start page articles "If you are going through hell, keep going." - Sir Winston Churchill
|
|
|
|

|
I knew it would be pointless to even say anything.
|
|
|
|

|
Not to mention that this forces you to use VC6 if CString are compiled in library's compiled with VC6. I also realy hate it. havent we learned to use 'const char*' ?
|
|
|
|

|
Anonymous wrote: I knew it would be pointless to even say anything.
Why did you say something then? Instead of being grateful, cry on.
|
|
|
|

|
Personally, I use MFC and use CString everywhere. If you do not use MFC then simply modify the code yourself. What is the problem?
|
|
|
|
|

|
Anonymous wrote:
How lame
It is hard to beat an Anonymous poster who has probably never written an article for CP nor contibuted in any usefull way who can't even go to the trouble to spell out what his problem is. Talk about lame.
Neville Franks, Author of ED for Windows. www.getsoft.com
|
|
|
|

|
I think, when you were discussing XML vs Registry issue you all forgot that Registry as it implemented is Direct access Database -- meaning you can just change or read just one record without rewriting the whole file...
How would you do it in XML may I ask???...
So, I would say: when efficiency and replication is an issue -- Use Registry... When code portability is of great concern -- use INI file and XML if you want...
However, I didn't encounter any portability reasons in my own work however...
GL
I
|
|
|
|

|
My applications use both the registry and XML, as follows:
HKEY_LOCAL_MACHINE\SOFTWARE\...: User-agnostic application settings
HKEY_CURRENT_USER\Software\...: User-specific application settings
XML: User 'documents'
Admittedly, our documents are relatively small (< 256K), which means the DOM is perfectly adequate for loading/saving them.
As far as support issues go, why not provide a little application that can export the relevant registry contents for the user? If you wanted, you could make it smart enough to export the registry stuff, accumulate system information, accumulate VERSIONINFO stuff from your application, and package it all up and e-mail it to your support folks. If your product is big enough, something like this would pay for itself in short order by providing 99.7% of the info the support person needs.
"Think of it as evolution in action." - 'Oath of Fealty' by Larry Niven and Jerry Pournelle
|
|
|
|

|
Gary Wheeler wrote:
As far as support issues go, why not provide a little application that can export the relevant registry contents for the user? If you wanted, you could make it smart enough to export the registry stuff, accumulate system information, accumulate VERSIONINFO stuff from your application, and package it all up and e-mail it to your support folks. If your product is big enough, something like this would pay for itself in short order by providing 99.7% of the info the support person needs.
Nos you're thinking. There are several application that do just that but may not use XML.
Jason Henderson start page articles "If you are going through hell, keep going." - Sir Winston Churchill
|
|
|
|

|
Hi There
I became extreme happy this morning, when I "felt" over this article, but I can't compile the demo project, because I missing XmlSettingsTest.rc.
Thanks in advance,
Best Regards
Søren Madsen
Denmark
|
|
|
|
 |