SiComponents Home Page SiComponents Forums
Here you will be able to get help and share your experience
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Unicode wowes

 
Post new topic   Reply to topic    SiComponents Forums Forum Index -> Resource Builder
View previous topic :: View next topic  
Author Message
joakim



Joined: 04 Sep 2008
Posts: 5

PostPosted: Mon Feb 01, 2010 12:46 am    Post subject: Unicode wowes Reply with quote

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
Back to top
View user's profile Send private message
isiticov
Site Admin


Joined: 21 Nov 2002
Posts: 2097

PostPosted: Thu Feb 04, 2010 3:55 am    Post subject: Reply with quote

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...
Back to top
View user's profile Send private message
joakim



Joined: 04 Sep 2008
Posts: 5

PostPosted: Thu Feb 04, 2010 9:23 pm    Post subject: Reply with quote

Hi Igor,

I create my resorce in Resource Builder, of course Wink 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:
   
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.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    SiComponents Forums Forum Index -> Resource Builder All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by p h p B B  © 2001, 2005 p h p B B  Group