-
June 8th, 2009, 12:31 PM
#1
[RESOLVED] VB equivalent for C++ GetLocaleInfo
Is there a VB equivalent function to the following C++ function?
Code:
::GetLocaleInfo(LOCALE_USER_DEFAULT, LOCALE_SLIST, szBuf, sizeof(szBuf)) ;
-
June 8th, 2009, 01:33 PM
#2
Re: VB equivalent for C++ GetLocaleInfo
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
-
June 8th, 2009, 02:17 PM
#3
Re: VB equivalent for C++ GetLocaleInfo
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++)
Code:
Dim txt As String
Dim lResult As Long
lResult = GetLocaleInfo(1024, 12, txt, 100)
I get 1024 and 12 from the definitions of LOCALE_USER_DEFAULT and LOCALE_SLIST which I am using in a C++ app...
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!
-
June 8th, 2009, 03:45 PM
#4
Re: VB equivalent for C++ GetLocaleInfo
Take a look at the sample which at the bottom which at the bottom of this page
http://allapi.mentalis.org/apilist/GetLocaleInfo.shtml
-
June 9th, 2009, 09:23 AM
#5
Re: VB equivalent for C++ GetLocaleInfo
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))
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|