So its looking like the windows api is not working properly, which is another added to the list of api’s not working properly.
Edit. I think I’ll process the strings as per Raymondo’s blog post The format of string resources - The Old New Thing (microsoft.com), ie process the RT_Strings seperately and just run through the ID numbers looking for strings, because the EnumResourceNames is just not working properly.
Edit2.
Well Raymondos blog doesnt work.
Whats works but is clunky is
load the library
RT_String Equate(6)
Loc:Cstring = ‘MyEXE.EXE’
Loc:LibraryHandle = LoadLibraryA(address(Loc:Cstring))
Loc:LanguageWord = 1033 !Lang_English + Sublang_English_US
Loc:ResourceBlockHandle = FindResourceExA(Loc:LibraryHandle,RT_String,X,Loc:LanguageWord)
Loc:ResourceHandle = LoadResourceA(Loc:LibraryHandle,Loc:ResourceBlockHandle)
Loc:ResourceStartByteAddress = LockResource(Loc:ResourceHandle)
Loc:Counter = 0
Loop 10000 times
Loc:Counter +=1
Loc:Address = address(Loc:ResourceDisplayCString)
Loc:Size = size(Loc:ResourceDisplayCString)
Loc:RVlong = LoadStringA(Loc:LibraryHandle,Loc:Counter,Loc:Address,Loc:Size)
End
Then I can see all the RT_Strings, using the loop. Thing is the Loc:ResourceBlockHandle points to the block of RT_Strings in memory starting at the NameID. So the X thats returned by EnumResourceNamesA gives me the NameID or block of 16 as Raymondo refers to it, and in memory I can see a number before each unicode string, but they dont seem to tie up to any pattern that I can work out, hence the loop 10000 times cludge.
I had hoped that by locking the resource, the loadstring would be forced to start at the Loc:ResourceStartByteAddress and then loop 1 to 16 for that block (or Hungarian notation 0-15), but it doesnt work like that.
This one is bugging me, but there’s alot more strings in the resource than whats declared in the trappable runtime errors in the help docs, they are all clarion error messages though.
Resource String 543 - Slider Controls are only available n 32bit programs, is an interesting message, because I cant see any slider control in the clarion control line up! And that message is in both the C6 and C11 runtime.
Edit.
Figured it out.
Loc:Counter = 0
Loop 16 times
Loc:Counter +=1
Loc:Address = address(Loc:ResourceDisplayCString)
Loc:Size = size(Loc:ResourceDisplayCString)
Loc:ResourceBlockStringID = ((X * 16) - 16) + Loc:Counter
Loc:RVlong = LoadStringA(Loc:LibraryHandle,Loc:ResourceBlockStringID ,Loc:Address,Loc:Size)
End
Where X is the value in the Res Name Name column in the attached images.
Jam Software’s Treesize Free is German, so I can see its calculating the German language resources correctly, but I need to blank them when there is no LanguageID. Their Resource string data is interesting (3rd app across). The Clarion debugger has its own string data messages as well.
Oh and this resource editor is called from a Clarion template inside the appgen, just to show what can be done with the templates!