Is there a VB equivalent function to the following C++ function?
Code:::GetLocaleInfo(LOCALE_USER_DEFAULT, LOCALE_SLIST, szBuf, sizeof(szBuf)) ;
Printable View
Is there a VB equivalent function to the following C++ function?
Code:::GetLocaleInfo(LOCALE_USER_DEFAULT, LOCALE_SLIST, szBuf, sizeof(szBuf)) ;
is this what you are looking for ?
Code:Public Declare Function GetLocaleInfo Lib "kernel32" Alias "GetLocaleInfoA" (ByVal Locale As Long, ByVal LCType As Long, ByVal lpLCData As String, ByVal cchData As Long) As Long
Well... it may be...
I declared it as you provided it...
Then I am using it like this... (FYI... I don't know much about VB... I am more familiar with C++)
I get 1024 and 12 from the definitions of LOCALE_USER_DEFAULT and LOCALE_SLIST which I am using in a C++ app...Code:Dim txt As String
Dim lResult As Long
lResult = GetLocaleInfo(1024, 12, txt, 100)
txt comes back empty... and lResult comes back as zero...
The C++ version seems to work quite well...
I will be very grateful for any suggestions you can offer... Thanks!
Take a look at the sample which at the bottom which at the bottom of this page
http://allapi.mentalis.org/apilist/GetLocaleInfo.shtml
That example was very helpful...
It turns out the only thing I needed to change was to init the buffer
Code:Dim Buffer As String, Ret As String
Buffer = String$(256, 0) '<-- LIKE THIS...
Ret = GetLocaleInfo(LOCALE_USER_DEFAULT, lInfo, Buffer, Len(Buffer))