
VB4 16 bit LoadPicture not accepting above ascii 127 chars
Quote:
> its a way the unicode characters and ansi code characters get translated
> during runtime
> --
> Michael Gernaey
> Microsoft Corporation( I don't own it I just work there ;) )
> MSN Operations Development
> NT/SQL Server VB/C++
> > I use VB 4 in Denmark, where we have some more letters in the
> > alphabet than in the USA.
> > I am converting a 32 bit application to an 16 bit application.
> > I can't load pictures into my image-control with LoadPicture
> > in this version if the filenames contains these Danish
> > letters.
> > During design time I can load the same pictures by the
> > property-window without problems, so the problem is not
> > in the control, but in the LoadPicture function.
> > Do any one know about a bug fix for this, or a suggestion
> > for working around, e.g. a way to load pictures from disk
> > other than the LoadPicture function?
> > Palle M. Pedersen
> > Neuropsychologist
> > The Aphasia Computer Rehabilitation Project
I finally solved my problem:
I call the Windows 3.1 function AnsiToOem before passing the string
to LoadPicture
Declare Function AnsiToOem Lib "Keyboard" (ByVal lpAnsiStr As String, _
ByVal lpOemStr As String) As Integer
Dim retval As Integer
Dim tempStr As String * 255
Dim tempAStr As String * 255
retval = AnsiToOem(tempAStr, tempStr)
I don't know why that solves the unicode problem (or why there
should be unicode in 16 bit VB4. But it works ok
Palle M. Pedersen