|
Hi Wim, I'll respond offline.
/ravi
Let's put "civil" back in "civilization"
http://www.ravib.com
ravib@ravib.com
|
|
|
|
|
Rule number one:
There's always a crack, that's how the light gets in
Rule number two:
Ur always a bpx away from finding that light
Forget about hiding code, just dont put it there
Papa
while (TRUE)
Papa.WillLove ( Bebe ) ;
|
|
|
|
|
[ Crossposted in the XML forum]
My brief exposure to XML has been restricted to writing a compiler using SAX (in Java). I'm now back in C++/MFC land and need to populate a data structure with data read from an XML file, validated against a DTD. I also need to create an XML file, given a DTD.
Can you recommend a good "teach yourself DOM in 21 minutes" book or link? I'd especially like to know how to use DTDs to validate incoming data and write XML files.
Thanks!
/ravi
Let's put "civil" back in "civilization"
http://www.ravib.com
ravib@ravib.com
|
|
|
|
|
Hmm, MSDN's XML tutorial[^] seems like what I was looking for. Book and link recommendations are still welcome. Thanks!
/ravi
Let's put "civil" back in "civilization"
http://www.ravib.com
ravib@ravib.com
|
|
|
|
|
Please check out
http://codeguru.earthweb.com/xml/XMLDOMFromVC.html
Very nice article .
PLus get the functionalities of the DOM Objects at W3schools.com
|
|
|
|
|
|
How can one determine if a root item is expanded?
|
|
|
|
|
You can use EnsureVisible(htItem) on one of the root's child items to see if it's showing, or use Expand(htItem, TVE_EXPAND) to expand the tree (if it's not already expanded).
"No one goes to hell because of their sin, but because of rejecting God's method of salvation: His Son's life for yours..."
|
|
|
|
|
BOOL bExpanded = (TVIS_EXPANDED & pTreeCtrl->GetItemState(hRoot, TVIS_EXPANDED));
Shog9
------
No one's immune now, from a world of problems
No one's exempt now, from a world of pain
That's the way that it goes
when you're down here with the rest of us...
|
|
|
|
|
|
Ok ok -- your way is better -- I just couldn't remember it...
"No one goes to hell because of their sin, but because of rejecting God's method of salvation: His Son's life for yours..."
|
|
|
|
|
It helps i had the code handy for other reasons.
Shog9
------
No one's immune now, from a world of problems
No one's exempt now, from a world of pain
That's the way that it goes
when you're down here with the rest of us...
|
|
|
|
|
I'm currently working on a project that uses COM/ATL. I try as much as I can to stay away from MFC for:
1) I want to learn something else
2) Size of project
3) MFC dll redistribution problems (if there's any)
Should I be concerned about that or should I just link to the MFC library (static or dynamic?) and use it only when I need it? It's just that if you link MFC statically, the size of the DLL gets bigger and if you link dynamically, the user needs mfc42.dll...
Any hints?
Thanks!
---------------
Concentrating on Ideas
http://www.edovia.com
|
|
|
|
|
Another problem with linking statically is that every app that uses a statically linked copy of MFC will have its own copy of MFC in memory, whereas if two or more apps both use the dll, only one copy of the dll needs to be loaded into memory
--
Help me! I'm turning into a grapefruit!
|
|
|
|
|
benjymous wrote:
will have its own copy of MFC in memory
well, more accurately, it will have in-memory the parts that it uses, not all of MFC.
-c
"[it was..] one of those evenings when you feel that not only will there definitely be a revolution, but that the Association of Manufacturers will foot the bill."
-- Umberto Eco, Foucault's Pendulum
|
|
|
|
|
Static linking is the safest way to ensure that your executable will work regardless of what happens elsewhere in the system. It also makes for a smaller distributable (since you don't have to include the 1 meg+ MFC DLLs), and does not necessarily have a huge impact on exectuable size (since the linker is pretty good about thoring out unused code).
|
|
|
|
|
its a trade off
if u can control the environment to some extent then dynamic linking will be cool
otherwise i use static linking
i had a client who used another app that used crystal reports but that one used a really old version of the dll's and we had endless problems with both apps running on the same machine ... we ended up running one on terminal server
u cant escape all problems either way i guess
"... and so i said to him ... if it don't dance (or code) and you can't eat it either f**k it or throw it away" biz stuff about me
|
|
|
|
|
Hi! I come across a strange thing: I try to gray a menu
item, the codes as follow:
CMenu *pMenu = GetMenu();
CMenu *pOP = pMenu->GetSubMenu(2);
pOP->EnableMenuItem(ID_OP_START, MF_GRAYED | MF_BYCOMMAND);
******************************************************
The menu item with ID ID_OP_START is supposed to be
grayed and GetMenuState() does return MF_GRAYED; but the
item is actually not grayed and can still function as
it does. Do I need to do something in order for this
method to work?
Thanks a lot!
|
|
|
|
|
Wenrich wrote:
Do I need to do something in order for this
method to work?
What you're doing will work for a menu attached to a dialog in a dialog based app. However, if you're using MFC's doc/view framework (SDI/MDI), you need to put the enable/disable logic in the command's UpdateUI handler.
/ravi
Let's put "civil" back in "civilization"
http://www.ravib.com
ravib@ravib.com
|
|
|
|
|
Ravi Bhavnani wrote:
What you're doing will work for a menu attached to a dialog in a dialog based app. However, if you're using MFC's doc/view framework (SDI/MDI), you need to put the enable/disable logic in the command's UpdateUI handler.
This may be the case, but what if you need the change the menus from a different location other than in the UpdateUI handler? do you basically have to create a boolean to keep track of the state and then check it in the UpdateUI? Is this the only way?
Thanks!
Dan
|
|
|
|
|
Another method would be to handle the WM_INITMENUPOPUP message and enable/disable the items in that handler.
Roger Allen
Sonork 100.10016
I have a terminal disease. Its called life!
|
|
|
|
|
groover4life wrote:
create a boolean to keep track of the state and then check it in the UpdateUI?
Yes, that follows the standard MVC model and would be the preferred way imho.
/ravi
Let's put "civil" back in "civilization"
http://www.ravib.com
ravib@ravib.com
|
|
|
|
|
Hi
I am unable to open HELP from my visual studio environment. As soon as I click on any of the menuitems (contents, index etc) under HELP, the cpu shoots to 100% and it just sits like that.. I have also noticed that its allocating more and more memory, but the help window does not open at all.
MSDN was properly installed and it was working just fine before. I don't recall to have changed any of my settings.
I have already tried uninstalling/re-installing MSDN couple of times but no luck.
Any clues. Thanks
|
|
|
|
|
have u done a virus scan?
"... and so i said to him ... if it don't dance (or code) and you can't eat it either f**k it or throw it away" biz stuff about me
|
|
|
|
|
Hi, it happens the same to me, and it is not a virus.
Any help?
|
|
|
|