VB Dates under vista

I noticed today that after running a compiled vb6 app - that all dates in vista (clock, file dates etc) are broken, and only show as "DD-09-YY" instead of say "30-09-06"!!

Rebooted - same.

Went into my wife's login and desktop, her system dates were ok, then I ran a vb app and again her dates broke and stayed that way. wtf?

so much for legacy vb6 support huh?

Anyone else had this happen and is there a fix? If not then any legacy vb app could break vista's date handling. I have vb6 pro with SP6 so wondered if the service pack is the cause because of dll incompatibility etc but no warnings came up at installation time. Vista is build 5600 CR1

[711 byte] By [blackwagon] at [2007-12-25]
# 1

UPDATE!!!

I found and fixed the problem. My app sets the system locale (to ensure british date format) as below:

iRet = SetLocaleInfo(Locale, LOCALE_SSHORTDATE, "DD-MM-YY")

Under XP & 2K this works fine HOWEVER under Vista it does not! the format string must be like this to work in Vista:

iRet = SetLocaleInfo(Locale, LOCALE_SSHORTDATE, "dd-MM-yy")

any other version of the dd-mm-yy part is useless and causes the whole OS to report dates as DD-?-YY

VB programmers beware!! - If you have done this like me just goto Locale Settings (control panel) and set to US - apply - back to UK - apply. hey presto, back to normal. PHEW!

blackwagon at 2007-10-8 > top of Msdn Tech,Software Development for Windows Vista,General Windows Vista Development Issues...

Software Development for Windows Vista

Site Classified