COleDateTime Issue

Hi All,

MS DTP Control is implemented such that, if

a) you type in 2 digit year, it takes it as 20XX where XX is the year you 
entered is <=29.

b) you type in 2 digit year, it takes it as 19XX where XX is the year you 
entered is >=30.

As soon as user types a 2 digit year in MS DTp control, it automatically 
converts it to 19XX or 20XX depending upon what user wrote. So, even if I do 
an UpdateData() and get the value to a contrl variable .. I get the 4 digit 
value and not a 2 digit ... and there is no way for me to know thatuser typed 
a 2digit year(which MS control automatically updated) or a 4 digit year.

Is there any way to override this behaviour as I want MS DTP to take 20XX 
everytime when a user gives 2 digit value ?

One way is to use SDK to change Calendar format but I cannot use it as it 
will affect the System regional settings which I don't want.

Thanks in Advance,
Cagespear

0
Cagespear (4)
2/7/2007 11:24:01 AM
vc.mfc 33608 articles. 0 followers. Follow

5 Replies
402 Views

Similar Articles

[PageSpeed] 35

>MS DTP Control is implemented such that, if
>
>a) you type in 2 digit year, it takes it as 20XX where XX is the year you 
>entered is <=29.
>
>b) you type in 2 digit year, it takes it as 19XX where XX is the year you 
>entered is >=30.

>Is there any way to override this behaviour as I want MS DTP to take 20XX 
>everytime when a user gives 2 digit value ?

I wonder if setting the minimum date with the DTM_SETRANGE message
would affect this behaviour?

Dave
0
davidl7375 (2060)
2/7/2007 2:33:19 PM
No, because if I set the min year as say 2000 in my case using DTM_SETRANGE, 
user will not be able to type year below 2000 which is not desirable.
0
Cagespear (4)
2/7/2007 5:00:01 PM
>No, because if I set the min year as say 2000 in my case using DTM_SETRANGE, 
>user will not be able to type year below 2000 which is not desirable.

OK, then is the crux of the problem that the control is showing YY so
the user isn't aware of the situation?

If so, how about overriding the default format and forcing the control
to use a 4 digit year format?

I must admit that I hadn't realised before now that the actual year
split behaviour is user alterable in the "Customize Regional
Options"/Date page of the Control Panel regional settings.

Dave
0
davidl7375 (2060)
2/7/2007 10:10:59 PM
Thanks for the info Dave. But that would be pretty much machine specific 
thing which will affect other apps also which I can't offord.

I think there is no other way than what you told or using setcalendarinfo 
API, both of them seem to be undesirable in my case.

I wonder why MS didn't put this intelligence into COleDateTime or 
DateTimeCtrl!!

Regards,
Amit
0
Cagespear (4)
2/15/2007 5:35:28 PM
>Thanks for the info Dave. But that would be pretty much machine specific 
>thing which will affect other apps also which I can't offord.

I was only proposing that you enforce the 4 digit year in your use of
the date time control using DateTime_SetFormat (the DTM_SETFORMAT
message), not that you alter the system settings.

Dave
0
davidl7375 (2060)
2/15/2007 7:44:03 PM
Reply:

Similar Artilces:

domain issue and/or server configuration issue
I'm sure I sound like an idiot, but... I need to install CRM into the following environment and have some trepidation about it: Domain A - server 1 is Win2k3 Server with SQL Server is the domain controller. Server 2 is Win2k3, Exchange 2k server (yes, allready the trouble begins) and proposed CRM server. Domain A currently runs in mixed mode because - Domain B is a Win2K Domain and Domain C a WinNT4 Domain and both have external two way trusts with Domain A and I suppose each other? Unless I'm looking at the wrong type of info, if I raise function level on domain A to native mode ...

Issues with facebook...
Whenever I use any app on facebook, it says "I'm not logged in to do that" and then I have to re log in. Is there some kind of issue I'm missing here? I've got the Firefox 3.5.3 browser, I have f/b store my password so I DON'T have to constantly log in to everything. Can anyone help?!? Thanks! Please note that your problem has nothing to do with Windows XP. You should contact Facebook administrators or post your query on Mozilla newsgroups. Hope this helps. Sorry we can't help you here. "spookyginger" <spookyginger@discussion...

Domain name issue migrating 5.5 to Exchange 2003
We are prepairing to migrate Echange 5.5 to Exchange 2003. This has come up as an issue: Our domain is cornerstone instead of cornerstone.com Our email address is "firstname.lastname@cornerstonegrp.com" instead of: "firstname.lastname@cornerstone.com" ...

Laptop Client Issues
I've got 2 issues with Laptop client: 1. When I open outlook, crm add-in works fine. I close outlook and reopen and I get the cannot load crm functinality error. I open again and it works. If I am in a state where there is an error, I can go to the add-in manager and uncheck crm addin, hit ok, the recheck crm addin and it will connect. This happens when I am online or offline. 2. Outlook hangs synching with exchange server. Sometimes the send/receive finishes and then seems to just hang. If I turn off crm addin, it always works correctly. Anyone else experiencing these iss...

Public Folder Replication issue #3
I have a single domain which is linked across a VPN to two sites. At both sites I have a DC and an Exchange box. The issue I am having is on Server A, I can see and access all public folders, on Server B I cannot see one folder and two other folders have no data. I have checked to ensure they are set up for replication and even in ESM it shows they are "In Sync" or "Local Modified". Any suggestions on how to resolve this would be greatly appreciated. Douglas Hiser In each public folder's properties do you have both servers showing as having replicas? Do yo...

CRM 4.0
Hi, I'm a relatively new CRM developer. I just attended the CRM conference in Toronto a week ago and I'm pretty excited about coming in on a fresh release. One of the options that seem very useful of course are "many to many" relationships. I've tried to customize the products entity to create my own relationship. Basically the situation I have is that I'm creating course packages (products) with sub-products (courses). So I'm going into the products table and creating a many-to-many relationship with itself. So far so good. Indeed, all the "...

Outlook Express Issue
Greetings I have inadvertently deleted a folder. The associated DBX file still exists. Any ideas as to how I might get it to reappear in my folders list in Outlook Express? TIA Maurice You can use import for this. For additional support ask in an Outlook Express forum. This is an Microsoft Office Outlook forum. Outlook Express is family of Internet Explorer and Outlook of the Office family. Here is the link for the right forum http://communities.microsoft.com/newsgroups/default.asp?icp=InternetExplorer Good Luck! -- Robert Sparnaaij [MVP-Outlook] www.howto-outlook.com Tips of th...

Deleting issues
I'm using Outlook XP. Every time I try to delete an item, it tells me "Errors have been detected in the file ...outlook.pst. Quit all mail-enabled applications, then use the Inbox Repair Tool." So I go and use the Inbox Repair Tool, SCANPST. I scan outlook.pst, re-open Outlook, try to delete an item and get the same error message. Can someone help? How big is your .pst file? Can you create a new one and then drag and drop the items from the old to the new one? --� Milly Staples [MVP - Outlook] Post all replies to the group to keep the discussion intact. Due to the (inser...

SBS 2003 RRAS/VPN issue
I've got a SBS 2k3 box, SP2. I believe it's Prem since I see SQL 2k5, but ISA isn't installed. The firewall in place is the NAT/firewall in RRAS for the internet interface. The internal server IP is 192.168.16.1. I can successfully establish a VPN connection remotely from an XP machine, and get an IP address. It looks to be from the DHCP range from the internal server (16.37 for example), dhcp enabled says no. It's PPTP. From there, I can't get on the internet, nor can I ping or access the server in any way shape or form. I am unsure if this used to w...

Exchange 2003 SP1 and SP2 compability issue
Hi expert, I have 3 Exchange 2003 with SP1 installed. May I know is it possible to upgrade 1 member server to SP2 only? so the rest(1 member and 1 primary server) are still running with SP1. any official document regarding this issue? PS: we are not using FE/BE model, all exchange servers are able to send and receive internet mail. Regards, Vincent It is best practice to install SP2 to all servers in the farm but there are no problems I know of to upgrade just one if they are all mailbox servers. "vincent" <vincent@discussions.microsoft.com> wrote in message news:08DC...

CTime issue
Hello all, for my application, I need to store birthdays into a database. So I decided to use CTime a CDateTimeCtrl. It worked well until I entered the a date from 1956. After reading the documentation, it seems that CTime can't handle dates /before/ 1970-01-01. How can I handle this? Or should I do it manually (an int for day, another one for the month and the last one for the year)? Thanks in advance. On Wed, 16 Jul 2008 21:02:28 -0500, Fernando G�mez <fernando.a.gomez.f@gmail.com> wrote: >Hello all, > >for my application, I need to store birthdays into a database...

fix issue described in KB897268 article -
We just ran into this 'known bug' ... namely, that if you print picking tickets in batches (in SOP) you will get the wrong info on your comment fields (I expect the same issue occurs if you print any SOP document via the batch printing, but have not checked). We use the comment fields to communicate customer specific information to our shipping department - ie. customer specific ups / fedex accounts, special shipping instructions for the order, etc ... I cannot understand how this is not considered a high priority issue that should have been fixed a while ago. I read the '...

Cannot Send Email to certain addresses, TCP Reset Issue?
I'm been trying to send email to an email address at voxmedica, when I send the message I get: REMOVED@voxmedica.com on 3/6/2006 10:14 AM The e-mail system was unable to deliver the message, but did not report a specific reason. Check the address and try again. If it still fails, contact your system administrator. < mailgate.voxmedica.com #5.0.0 X-Kleg-Moore-Mail-Daemon; host 10.10.1.93[10.10.1.93] said: 554 5.1.0 Sender Denied (in reply to MAIL FROM command)> The address is valid. I called up their IS department and was told that my exchange server is ...

COleDateTime Confusion
Using the code COleDateTime Date1( 2003 , 8 , 31 , 0 , 0 , 0 ); COleDateTime Date2( 2003 , 8 , 1 , 0 , 0 , 0 ); COleDateTimeSpan DateDifference = Date1 - Date2; sprintf( aux , "From %s to %s is %s days" , (LPCTSTR) Date2.Format( "%B %d %Y" ) , (LPCTSTR) Date1.Format( "%B %d %Y" ) , (LPCTSTR) DateDifference.Format( "%d" ) ); pdc->TextOut( 100 , currow - 2*rowHeight , aux ); the program displays that the difference is 29 days. My quick calculation usi...

Is this an Oulook issue, or Word issue?
I use Outlook at work, with "use Word as editor" (all Office 2000 in Win 2000). Normally, using Word, I do not use Track Changes: nothing is highlighted either on the screen or in print. However, I right-click a document to "Send to E-mail Recipient", when I use Insert>AutoText>Email Signature, the Signature is inserted with change markings: color, underlined, and a vertical bar in the left margin. I have to manually go back up and deselect all the Track Changes options that got turned back on. Can I fix this either in Word or in Outlook? Or do I just live with it...

Probably a hardware issue, but...
....it only seems to happen while using Outlook 2003. Basically it has to do with mouse/pointer losing the focus. For example, While a mail message is selected in any mail folder, the selected message is "blue". But without warning or any action on my part, the focus will "go away" and the seleceted object becomes "grey". I must them go back and click on that object to make it active again. This also seems to happen when I am in a dialog box of some sort. Even right in the middle of typing, the focus on the dialog box gets lost and I cannot continue typing ...

Smartlist Export issue
Hi, I am implementing GP in the Gulf region where all the data entry is in Arabic. Now in the smartlist, the report shows the Arabic characters without any problem but when I export to Excel or Word it brings junk characters. Is there any configuration to be done or what is the workaround. I am using Arabic_CI_AS collation setting and it works fine with GP. Thanks Leo This issue is solved by installing Arabic Language Pack for MS Office. "Leo" wrote: > Hi, > > I am implementing GP in the Gulf region where all the data entry is in > Arabic. Now in the smartlist...

Gantt Chart issue.
I have had a number of users complain that they make customizations to their Gantt charts (color coding, text and drawings) and from time to time their customizations seem to disappear after a save and publish. Is this an issue? has anyone else experienced this and if so, is there a fix? Sorry forgot to mention, MSPS 2007 SP2... "Eric_H" wrote: > I have had a number of users complain that they make customizations to their > Gantt charts (color coding, text and drawings) and from time to time their > customizations seem to disappear after a save and publish....

formatting issues
In Outlook, when a create a 'letter template' style Signature (with right & left justified text), I am experience a problem with the RIGHT JUSTIFIED TEXT lining up properly. Esp when printing, even if on-screen looks justified, some lines on the right side of my signature look skewed. Can anyone help? ...

From CDateTimeCtrl to COleDateTime, plz help me
Hey, I have a question about CDateTimeCtrl, I have a form-view with a CDateTimeCtrl control where the user can select a date (long format). Now i want to store the date the user selected in a COleDateTime object, how do i get the date from the CDateTimeCtrl into the COleDateTime variable? cheers, Paul "Paul Schouten" <vincent_schouten@yahoo.com> schrieb im Newsbeitrag news:42e21af6$0$97483$e4fe514c@news.xs4all.nl... > Hey, > > I have a question about CDateTimeCtrl, I have a form-view with a > CDateTimeCtrl control where the user can select a date (long fo...

Business Portal/FRx Report Issues
After generating a 15 page report in FRXReport Designer I am able to view the entire report in IE. After the report has been published to Business Portal on the page tabs show at the bottom and the report gives the error: The page cannot be found The page you are looking for might have been removed, had its name changed, or is temporarily unavailable. ...

Issue with Macro __DATE__ and UNICODE
Hi, I am trying to port a piece of code under windows mobile where UNICODE is used natively. One line is defined like this : #ifdef _UNICODE #define UL_TEXT(s) L##s #else #define UL_TEXT(s) (s) #endif const wchar_t* _Vendor = UL_TEXT("bla bla"); const wchar_t* _Version = UL_TEXT( "Library Utilities 1.10.24 " __DATE__); When I compile I get : concatenating wide "Library Utilities 1.10.24 " with narrow "Feb 19 2008" it seems __DATE__ is not expanded inside UL_TEXT. I also tried like this const wchar_t* _Version = UL_TEXT( "Library Utilitie...

COleDateTime ???
I have a form with 3 controls on it. They are a Combo box, a date picker and a submit button. I added control variables for the combo box and the date picker and add a function for the submit button. The control variables are c_select, c_date. When the submit button is pressed I want to transfer the info in the controls to the document. So in the function I added code // local variables to make sure I am getting what I want int select; COleDateTime date; // transfer data to locals select = c_select.getcursel(); c_date ?????????????????????????????????????????????? now how can I get th...

Issues with demoting exchange server? #2
Hi, It seems that the previous administrator was not succesful in fully promoting a sever to a DC. We are supposed to have two DCs (CC7=First DC, CC5=DC with Exchange server). There have been continuous replication problems from cc5 to cc7. AD doesnt consider cc5 as a DC and cc7 is the only DC in Domain Controllers group of AD. Manual replication between two DCs results in 'no endpoints' error. AD is unavailable several times on both DCs. Object created on a DC is not replicated within two (!) days on second DC. Clearely cc5 can not communicate with cc7 the way it is supposed to. T...

Import Tool Issue
Just got RMS and am in the process of trying to import our products over from QBPOS using the import tool. For some reason, the import is bringing in all the item numbers, but only the numbers for 80% of the items (the description, qty, cost, etc fields are all blank). The other 20% have all the info, and the complete ones are our most recently added items. Anybody experienced this when they imported? I'm on kind of a tight schedule and was thinking about forgoing messing around with it and just getting that SQL import utility from SQL Manager I saw mentioned in earlier posts. Does any...