Unicode wowes

This forum designated to discuss the Resource Builder
Post Reply
joakim
Posts: 5
Joined: Thu Sep 04, 2008 9:31 pm

Unicode wowes

Post by joakim »

Hi,

it appears that when creating a resourse only dll it's not unicode aware, although I have saved RC file as Unicode and then compile dll, only LoadLibraryA and FindResourceA works, LoadLibraryW and FindResourceW not.

I create a custom resourse FILE and add a unicode format file, but when reading the resource into application I only get unreadable garbage?

I have version 3.0.3.25

isiticov
Site Admin
Posts: 2265
Joined: Thu Nov 21, 2002 3:17 pm

Post by isiticov »

Hi,

All string resources in EXE/DLL are always in Unicode format. LoadLibraryW and FindResourceW are not related to DLL but to your main EXE. So it may be good idea to check it.

How do you link resources to application? Do you use Resource Builder to compile RC to RES or not?

There could be many places of proble, so could you please provide more details about this? Which IDE/Compiler do you use to create EXE, DLL and so on. How do you read resources and display...
Best regards,
Igor Sitikov.

joakim
Posts: 5
Joined: Thu Sep 04, 2008 9:31 pm

Post by joakim »

Hi Igor,

I create my resorce in Resource Builder, of course ;-) Been poking around a lot the last days so things has changed a bit. What I do is create a Resource only dll in RB, then in my VB6 project I use the dll, using Win32 API's.

Code: Select all

   
Private Declare Function LoadLibrary Lib "kernel32" Alias "LoadLibraryA" (ByVal lpLibFileName As String) As Long
Private Declare Function FindResource Lib "kernel32" Alias "FindResourceA" (ByVal hInstance As Long, ByVal lpName As String, ByVal lpType As String) As Long
...
 'Load the dll in memory and get its handle
    m_lngResourceHandle = LoadLibrary(strResourceDLL)
...
hRsrc = FindResource(m_lngResourceHandle, ResName, ResType)

etc. I tried with W versions of API call's but already LoadLibraryW fail (return 0 aka no handle), only LoadLibraryA aka ANSI version works.

Now I have changed .RC file format to ANSI and currently limit to western languages. But even in Unicode format, as an example Czech language doesn't work because when saved all accents are removed, like č becomes c, also creating a custom resoulce type and store a full text files there seem to be problems when reading back the file.

Now I will leave for 1 week holiday on Saturday so don't have time explore further now, but when coming back I will try put together real exaples of anything that doesn't work.

Post Reply