|
Thnks, But i want to localize date format according to system settings. how can i archive this. i'm using .Net 2003.
|
|
|
|
|
can u just tell me what you mean by localise?
|
|
|
|
|
I mean if user set its short date as dd:mm:yyyy i want it in that format or if user set it as mm-dd-yy, i want it that way !!.(according to local computer settings)
|
|
|
|
|
how ever the format you want ultimately, CTime brings you all the fields, what all you have to do is to format them as you want by using str.Format, as i specified in my earlier post.
|
|
|
|
|
yaar, how can i know current system settings, how can i know system date format??
|
|
|
|
|
iam unable to agree the point that a system will have some date format.
as far as i know, the format is only our interpretation, and we can typecaset it in any of our required format.
how ever, spell out your actual requirement, then i can suggest some technique.
|
|
|
|
|
Ok, i tell u where u can set time and date format. Go To Control Panel>Date,Time,Language, and Regional Settings>Regional And Language Options>Regional Options> you can see a button saying Customize... press it and u can see a dialog where u can customize all regional settings. i want my date to be shown in status bar in that format which Current Window Logged in user set for it in
Control Panel>Date,Time,Language, and Regional Settings>Regional And Language Options>Regional Options >Customize > Date > Short Date.. I hop u can now understand..
|
|
|
|
|
COleDateTime::Format may help you.
- NS -
|
|
|
|
|
I've a MFC dialog with two edit boxes...
By default focus in on first text box.
I want that during dialog load if first edit box contains some text,
then second edit box should have focus... I've tried SetFocus() in InitDialog()
but it's not working... focus still remains on first control.
How should I do it? Please Help!
|
|
|
|
|
make sure that Set focus() is the last statement in the init dialog.
if it is so,
just post a sample of your init dialog code, i shall solve it
|
|
|
|
|
You have to return FALSE from OnInitDialog if you need to set the focus to a particular control by yourself.
- NS -
|
|
|
|
|
In addition to what NS17 stated, you should also use GotoDlgCtrl() instead of SetFocus()
when setting the focus to edit controls.
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
If you change the focus in OnInitDialog() to something other than the first control, make sure that your OnInitDialog() handler returns FALSE. If it returns TRUE, the default Window handler sets the focus for you, overriding anything you did.
Software Zen: delete this;
|
|
|
|
|
i advice all the members who are starting the threads to indicate a keyword like [SOLVED] by prefixing the same to the main subject, once they are solved
thanks.
-- modified at 3:59 Saturday 1st September, 2007
|
|
|
|
|
Put that advice directly as 'Subject' like mine.
It will be more visible
Russell
|
|
|
|
|
thanks russel,
but can you suggest me some idea such that it always sits on top of all the posts. like that of chris maunder.
|
|
|
|
|
|
Wow I said what happend you used of B tags;) its good idea.;)
|
|
|
|
|
Hi all.
Here are the two classes one base and other Derived ( virtually inherited from Base)
Class Base
{
Public:
Virtual void FunB(){}
};
Class Derived: virtual public Base
{
Public:
Virtual void FunD(){}
};
When I derived class Derived virtually from Base, and when I saw the memory layout of objects of Derived in debug window; I saw two separate vfptrs; one for Base and one for Derived.
But if I do not derive class Derived virtually from Base, then there is only single vfptr in object of Derived class?
Why an extra vfptr is added/required in case of virtual inheritance?
Sameer Thakur
|
|
|
|
|
Try reading this article[^] in the C++ FAQ, especially section 25.9 on virtual inheritance.
Software Zen: delete this;
|
|
|
|
|
Hi,
How can find handle to the treeitem if i know its path in a tree control.
-- modified at 4:33 Saturday 1st September, 2007
|
|
|
|
|
See GetNextItem(handle to item on the tree,here flags you can use for example TVGN_CHILD
|
|
|
|
|
Thanks,but i don't have any handle.I have only path(for ex: A\Apple\fruit).What i need is handle to the tree item "fruit".How to get it.
|
|
|
|
|
Here some function on the CTree class that you can use of them for get handle to root GetRootItem and GetParentItem. but I think you are new to this section so I suggest see articles on the codeproject about CTree.
|
|
|
|
|
You have to use the GetRootItem() and GetNextItem() [^] member functions in the CTreeCtrl class to traverse the nodes in the tree. Use the GetItem() function to retrieve information about each node, including the node's text. Compare the node's text to that part of the 'path'.
For example, if the path is C:\Forest\Orchard\Apple, start at the root and look for the node with the text 'Forest'. Within the nodes attached to the 'Forest' node, look for one with the text 'Orchard', and so on.
I'll give you a hint: a recursive routine is the way to go here.
Software Zen: delete this;
|
|
|
|