 |
SiComponents Forums Here you will be able to get help and share your experience
|
View previous topic :: View next topic |
Author |
Message |
joakim
Joined: 04 Sep 2008 Posts: 5
|
Posted: Mon Feb 01, 2010 12:46 am Post subject: Unicode wowes |
|
|
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 |
|
 |
isiticov Site Admin
Joined: 21 Nov 2002 Posts: 2112
|
Posted: Thu Feb 04, 2010 3:55 am Post subject: |
|
|
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 |
|
 |
joakim
Joined: 04 Sep 2008 Posts: 5
|
Posted: Thu Feb 04, 2010 9:23 pm Post subject: |
|
|
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: |
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 |
|
 |
|
|
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
|