|
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;
|
|
|
|
|
I am a fairly new Visual c++ user and probably have a newbie question to ask.
I am using Visual Studio c++ v6.0 cs2 I think.
I have an array of combo box values to read in from an extremely rudimentary dialog box all created with the use of the graphical tools as much as possible.
The normal way to read data in from MFC controls seems to be to asign a variable to exchange data with the control with DDX commands and UpdateDate();.
Did I mention that I the array is fairly large? Discovering that the DDX statement doesn't even use the control's IDtag, but only the #define integer, I decided that using a large number of variables and thus a large number of DDX statements was a lot of unnecessary code and a lot of time defining variables, so I decided to get a little clever. Probably too clever...
I noticed that the resource.h file associates each control item keyword with an integer value with a #define. So I edited that file and the control box integers to reflect a series of integers that I could read control data into an array of variables with a nested for loop and one single DDX statement for a 9x9 array of combo boxes.
for (i=0; i<9; i++) {<br />
for (j=0; j<9; j++)<br />
{<br />
DDX_Text(pDX, (1000+(10*j)+i), CSarray[i][j]);<br />
}<br />
}<br />
This actually works great . . . until, for some unexplained reason, I try to access items [6][7], [6][8], [7][6], [7][7], [7][8], [8][6], [8][7], and [8][8].
Strangely enough [6][6] works fine. These values represent the far corner combo boxes of the array.
The above code always compiles fine, but I get a run-time error - "Debug Assertion Failed!" on some file dlgdata.cpp line 43 (I have never seen this file) and I have tracked the problem by accessing each of the 81 possibilities manually. All other values read in with this method fine.
I DID have to change some other values in this file to move them out of the range of integer values I chose to make this work. (A few button controls which work fine and maybe the _APS_NEXT_CONTROL_VALUE whatever that is.) Still compiles fine. I noticed that resource.h is a header file for the ProjectName.rc file (which I don't understand at all).
So I don't have any idea what to try next. I suspect I am stepping over some value assignment limit or have a value conflict, but don't know why 1080 would work as a value when 1078 doesn't.
|
|
|
|