The MASM Forum

General => The Campus => Topic started by: SHDA on January 31, 2015, 06:13:07 PM

Title: 1st steps, 1st problem
Post by: SHDA on January 31, 2015, 06:13:07 PM
Hello guys.

After some adventures and pointless time with C++ and Delphi
i am trying to start for good with assembly. A past project that
most of it have been done in Delphi 7 SE (but i never finished it)
will be my goal while learning step-by-step and setting it up in
assembly. (*)

As Greek polytonic language and characters will be the main
codepage as data and content manupulation to be presented,
(localization will be an option for menus etc) i tried to setup the
1st main form (DialogAsMain.tpl) in RADasm under masm32.

I've just make an addition to IDD_DIALOG Dialog (Resource file)
by adding a Greek word to it, but once i press enter or tab the caption
becomes as "Dialog As Main ????a?d???". I have change the DIALOG
properties of LANGUAGE to LANG_GREEK
and after enter or tab in the Language field the values of "8,1" appeared.
I have save the resource file, re-build the project but i've got no Greek
letters appeared in the Dialog's title.
I have tried the addition of UNICODE equ 1 before include statement,
nothing.
Any help please?

I am using:
   VMware 11
   Windows 7 x64 Ultimate
   masm32 installation (vanila)
   RadAsm 2013

(*) Ancient & Modern Greek Literature. A totaly free application.
Title: Re: 1st steps, 1st problem
Post by: jj2007 on January 31, 2015, 08:44:53 PM
Hi SHDA,

When you open the resource file in Notepad or Wordpad, do you see Greek or ???? characters?

MasmBasic's editor called RichMasm handles Greek etc just fine, and menus are no problem, but I have no idea if it's compatible with RadAsm. I attach a sample Win GUI "project", where only the menu titles are translated. To build it, RichMasm needs only the *.asc file (which you could also see in MS Word or Wordpad), but I have included also the rc file. I am curious if RadAsm can edit the resource, let me know.

Check the source for invoke AppendMenuW, hMenu, MF_POPUP, hM1, uCat$("&φάκελος")
Title: Re: 1st steps, 1st problem
Post by: SHDA on January 31, 2015, 10:18:54 PM
jj2007,
thank you very much for your reply.

I can't see the Greek characters in my .rc file at all.
Even if i tried to edit the file by adding the Greek
characters and then save it as UTF-8, RADASM
found an error that couldn't re-build the project. (Mine project, not yours)
(If i got your point, maybe it is RADASM's problem, and not masm32. Ok,
but if yes what about a masm32 source example from somebody here ?
Will this cost me a lot ?  :biggrin:
)

For your project that you have send to me (thank you, my  Italian neighbour  :biggrin:)
i can see Greek in all 3 menus while i am running your .exe. Also in the code .asm.
But i don't have RichMasm found in my installation.
As for the resource file i will try it and i will inform you.
Title: Re: 1st steps, 1st problem
Post by: ragdog on January 31, 2015, 10:27:08 PM
Can you upload you project to view  whats the problem is?
Title: Re: 1st steps, 1st problem
Post by: SHDA on January 31, 2015, 11:42:40 PM
ragdog,
thank you for your reply.
Here is the whole project directory in a .zip form. As i said
it is a RADASM project file from my custom D:\_InProg\_RADasm-3009c\MASM\Projects location.
I have include a text file with two Greek words saved as UTF-8: Greek_InsertionWords.txt
Title: Re: 1st steps, 1st problem
Post by: jj2007 on February 01, 2015, 12:26:11 AM
Quote from: SHDA on January 31, 2015, 10:18:54 PMBut i don't have RichMasm found in my installation.

Just add MasmBasic (http://masm32.com/board/index.php?topic=94.msg264#msg264) to your Masm32 installation, it's straightforward; the editor will be in \Masm32\MasmBasic\RichMasm.exe. Once you see the help file, use File/Open to load the *.asc file, then hit F6 when you see the source in front of you.

RichMasm is a very idiosyncratic editor, though - not everybody's taste. If you want to use RadAsm instead, you need a solution for editing your rc files in Unicode format. Otherwise, edit the rc files only with RichMasm and use File/Save As with "Unicode RC format".
Title: Re: 1st steps, 1st problem
Post by: ragdog on February 01, 2015, 02:53:27 AM
Hi

I have test it but i have add "Αλέξανδρος" manually to the resource and save it to Unicode and it works
I think Radasm (RaRes) support not unicode but im not sure.

You can use jj2007 solution to use Unicode Apis

AppendMenuW, hMenu, MF_POPUP, hM1, uCat$("&φάκελος")

Title: Re: 1st steps, 1st problem
Post by: hutch-- on February 01, 2015, 07:35:21 AM
There is an editor in MASM32 called UNIEDIT that writes in UNICODE so if you construct you RC file as UNICODE rather than ANSI you will have no problems storing the Greek character set as resource. Then you use the UNICODE versions of the API functions to display your Greek text.
Title: Re: 1st steps, 1st problem
Post by: SHDA on February 01, 2015, 05:35:03 PM
Quote from: jj2007 on January 31, 2015, 08:44:53 PM
Check the source for invoke AppendMenuW, hMenu, MF_POPUP, hM1, uCat$("&φάκελος")
You mean that by using uCat$("&xxxxxx") i can pass unicode characters to any child component in masm32 ?

I installed MASMBASIC but when i tried to load your WinGreek.asc
i've got the following alert:
Richedit Assert
The specified module could not be found (msptls.dll)

Once i tried to compile it i've got the following error:
Tmp_File.asm(1) : Error A2209: Syntax error: $

RADasm doesn't let me to do something with the WinGreek.rc file.
It has just loaded it.


Quote from: ragdog on February 01, 2015, 02:53:27 AM
I have test it but i have add "Αλέξανδρος" manually to the resource and save it to Unicode and it works
I think Radasm (RaRes) support not unicode but im not sure.
Tell me, under which IDE or else you have compile this by this way ?
I have already done this (in RADasm) but with no success there.

Quote from: hutch-- on February 01, 2015, 07:35:21 AM
There is an editor in MASM32 called UNIEDIT that writes in UNICODE
Thank you for your reply hutch.
I load a source file, i save it through UNIEDIT and i build it with masm32. I tried
WinAsm and Radasm also. I saw Hindi unicode characters but not Greek.
I've noticed that UNIEDIT to allow me to load a file the requirement was this file to have
been saved as Unicode. Greek characters are visible to me only if i save the file as UTF-8.
Thank you for your directions but i can't follow them because i can't understand so to know
what to do so to combine the whole flow. Sorry but i am not experient in assembly.

=================================================================
As i am newbie, please:
allow me to make things easier for you that you try to help me
and for me to understand of how i shall proceed further:
I took Iczelion's tutorial no.2 and i add "Αλέξανδρος" in front.
Can you help me to ressolve this as it is a much more simplest paradigm ?
Title: Re: 1st steps, 1st problem
Post by: dedndave on February 01, 2015, 05:58:10 PM
as far as i know, NotePad is capable of handling unicode text

but, that doesn't solve your RadAsm problem
i suspect RadAsm has unicode support, because Ketil is Norwegian   :biggrin:

however, if it doesn't, you could place the unicode string data in seperate OBJ or static LIB and link it with the project
Title: Re: 1st steps, 1st problem
Post by: hutch-- on February 01, 2015, 06:12:44 PM
Have a look in this directory in the masm32 example code.

\masm32\examples\unicode_generic\multi_lingual

Greek characters are no problem to display in UNICODE.
Title: Re: 1st steps, 1st problem
Post by: SHDA on February 01, 2015, 07:44:24 PM
dedndave,
Thank you for your reply.
Quote from: dedndave on February 01, 2015, 05:58:10 PM
i suspect RadAsm has unicode support, because Ketil is Norwegian   :biggrin:
however, if it doesn't, you could place the unicode string data in seperate OBJ or static LIB and link it with the project
I will send to him my questions (Thank you for the data).
Also thanks for the directions. As newbie, now i re-realize that i have (at 1st)
to be fooling by the Assembler so to reach the point (2nd) to fooling him back. :biggrin:

Quote from: hutch-- on February 01, 2015, 06:12:44 PM
Have a look in thios directory in the masm32 example code.
\masm32\examples\unicode_generic\multi_lingual
Greek characters are no problem to display in UNICODE.
Thank you for your guidance. I have read (on the fly) all those examples and many
more, i have collect them for further analysis in a directory, but as i am a linear guy
i have to comply with the usage of include and external files that you have conclude
in their use for some reason-experience for sure. I am not the "write the code for me"
guy but i have just a natural excuse under my present status:
i am newbie and i simitaneusly seeking IDE, Assembler, Syntax, Results, Answers all
at once, just to find out the most suitable programming enviroment for me to start work.
I am sure you that can understand my present stage-level-position. Best wishes my friend!  :t

PS:
i would never imagine  that TXT except english should be out of the main code unit so to be presented correctly
:icon_eek:
Title: Re: 1st steps, 1st problem
Post by: jj2007 on February 01, 2015, 07:46:28 PM
Quote from: SHDA on February 01, 2015, 05:35:03 PM
i've got the following alert:
Richedit Assert
The specified module could not be found (msptls.dll)

Never seen that one. I'll send you a PM.
Title: Re: 1st steps, 1st problem
Post by: SHDA on February 01, 2015, 07:51:11 PM
Quote from: jj2007 on February 01, 2015, 07:46:28 PM
Never seen that one. I'll send you a PM.
OK.
(I am using programming under VMWare 11. Maybe is rellated to this configuration of mine.)
Title: Re: 1st steps, 1st problem
Post by: jj2007 on February 01, 2015, 08:13:46 PM
The "assert" is probably related to the OfficeNN installation - my PC doesn't have msptls.dll, but one C:\Program Files (x86)\Common Files\microsoft shared\Office11\RichEd20.dll and 8 (eight) RichEd*.dll files in C:\Windows and subfolders. Remember Windows is a Microsoft product :bgrin:

As Hutch wrote above, you also have \Masm32\uniedit.exe - check if you get the same assert there.

I attach temporarily a file that seems to be a zip but in reality is in *.arc format, so you'll need FreeArc (http://freearc.org/Download.aspx) to extract it. The result should go to \Masm32\bin - let me know if you still get the "assert" ;-)

The reason to make it that complicated is that as a plain zip, the attachment would be beyond what this forum accepts - and FreeArc is a much, much better archiver. See here (http://www.maximumcompression.com/data/summary_mf2.php#data), sort by last column.

P.S.: In case you do have
C:\Program Files\Common Files\microsoft shared\Office12\RichEd20.dll
but no
C:\Program Files\Common Files\microsoft shared\Office11\RichEd20.dll
... rename the Office12 dll to *.dlx, then launch \Masm32\MasmBasic\RichMasm.exe again.

Google says many people have the same problem ;-)
Title: Re: 1st steps, 1st problem
Post by: ragdog on February 01, 2015, 09:27:13 PM
QuoteQuote from: ragdog on Today at 02:53:27 AM

    I have test it but i have add "Αλέξανδρος" manually to the resource and save it to Unicode and it works
    I think Radasm (RaRes) support not unicode but im not sure.

Tell me, under which IDE or else you have compile this by this way ?
I have already done this (in RADasm) but with no success there.

I have manuelly change your resource with Notepad to your Greek Lang
save it to unicode and you can compile it with radasm but the RaResedior support not unicode and you can not change the resource
in Radasm.

The other way is use a other Reseditor like (http://www.resedit.net/) and save your unicode resource in your project and compile your project with Radasm

Title: Re: 1st steps, 1st problem
Post by: SHDA on February 01, 2015, 09:27:48 PM
jj2007,
there is no Office installation in my virtual system.
Is running under VMware version 11 and is a vanilla
installation of Windows 7 x64 Enterprise with SP1.
I think the missing .dll is related to library calls of a
missing library or include files that not exists in my
system but they may exists in yours. Your build-ready
WinGreek.exe is running here without missing files or
.dlls. So i am sure that it is a matter of compilation run time.
UNIEDIT is running without any requirements or errors.
Title: Re: 1st steps, 1st problem
Post by: SHDA on February 01, 2015, 09:38:33 PM
Quote from: ragdog on February 01, 2015, 09:27:13 PM
I have manuelly change your resource with Notepad to your Greek Lang
save it to unicode and you can compile it with radasm but the RaResedior support not unicode and you can not change the resource in Radasm.
I think we are too close to find what is the difference between our systems:

I have done the same through Windows 7 Notepad, just with one difference: the file was saved as UTF-8 not as UNICODE.
Which version of RADasm do you have ?
What version of Windows do you have ?
Which font are you using in Notepad  and what is your font SCRIPT language ?
Are you using MASM32 SDK 11 assembler or other (such jWASM or else) ?
Title: Re: 1st steps, 1st problem
Post by: SHDA on February 01, 2015, 09:43:59 PM
Quote from: ragdog on February 01, 2015, 09:27:13 PM
The other way is use a other Reseditor like (http://www.resedit.net/) and save your unicode resource in your project and compile your project with Radasm
As i am using an OFFLINE virtual system under VMware 11, ResEdit needs to be online to dload it.
Have you got an OFFLINE solution for it ?
Title: Re: 1st steps, 1st problem
Post by: ragdog on February 01, 2015, 10:07:03 PM
I use

-last Masm32 v11
-Last Radasm3 version
-Win7 x86

Your can see it in the Attach


QuoteAs i am using an OFFLINE virtual system under VMware 11, ResEdit needs to be online to dload it.
Have you got an OFFLINE solution for it ?

Download from your host System and copy it in your VM
Title: Re: 1st steps, 1st problem
Post by: SHDA on February 01, 2015, 11:12:22 PM
Quote from: ragdog on February 01, 2015, 10:07:03 PM
Download from your host System and copy it in your VM
It took me 45 minutes to clear this shit from my system even if i've got
Revo Uninstaller and jv16 PowerTools 2014. And i still got shits in my
browser that i can't unload!!!!!
Do not re-propose this intallation to anyone unless you want to make
someone to reinstall Windows! In fact do not propose any kind of such
kind of installation that you haven't installed in your own system at first.
I have to reinstall my Windows!
:icon13: :icon13: :icon13: :icon13: :icon13: :icon13: :icon13: :icon13: :icon13:
Title: Re: 1st steps, 1st problem
Post by: ragdog on February 01, 2015, 11:38:01 PM
Ohh i have see the last version of Resed installer install adware sorry i have use it for a long time and it was portable
Title: Re: 1st steps, 1st problem
Post by: jj2007 on February 02, 2015, 12:20:23 AM
Quote from: SHDA on February 01, 2015, 09:27:48 PM
jj2007,
there is no Office installation in my virtual system.
Is running under VMware version 11 and is a vanilla
installation of Windows 7 x64 Enterprise with SP1.
I think the missing .dll is related to library calls of a
missing library or include files that not exists in my
system but they may exists in yours.

Really odd, especially since the "missing" dll is nowhere on my system. In case you find a Rich*.dll somewhere in C:\Program Files (x86)\Common Files\microsoft shared, try to disactivate it, thus forcing the C:\Windows version. But don't invest time, I guess you have enough work already... ;-)
Title: Re: 1st steps, 1st problem
Post by: hutch-- on February 02, 2015, 12:35:32 AM
My Win7 64 Ultimate has riched20.dll in the Windows\system32 directory at 473600 bytes.
Title: Re: 1st steps, 1st problem
Post by: jj2007 on February 02, 2015, 02:34:57 AM
Quote from: hutch-- on February 02, 2015, 12:35:32 AMMy Win7 64 Ultimate has riched20.dll in the Windows\system32 directory at 473600 bytes.

Thanks, Hutch. Exactly the same for me on Win7-64 Home Premium, dated 21 Nov 2010. AFAICS the problem is with one of the Common Files\... versions, which work fine on my PC with the free Office starter edition installed. RichMasm picks its DLL as follows:
  mov esi, Chr$("\Masm32\bin\RichEd20.dll")      ; user's favourite
  .if !Exist(esi)
      GetFiles ExpandEnv$("%CommonProgramFiles%\Microsoft Shared\RichEd20.DLL", 1)
      mov esi, offset LibName      ; System32\RichEd20.dll, default if no Office folders found (very slow, factor 32)
      .if eax      ; Sf triggers ## Warning: file size and date invalid
            SortFiles name      ; Office11 is better than Office12/14 - seconds to load 20k lines:
            Let esi=Files$(0)      ; Win7-32: O11: 0.64, O12: 0.78, O14: 0.82, System32 21.0
      .endif      ; Win7-64: O14: 0.7, System32 18.0
  .endif
  invoke LoadLibrary, esi


Looks complicated, but the load times for the System32 version are just too bad :(

And I just found an old comment in the source:
Office 12 needs C:\Program Files\Common Files\Microsoft Shared\OFFICE12\MSPTLS.DLL in the RichMasm folder, and is slower

This hotfix (http://support.microsoft.com/kb/970214) is not working on my two machines (XP and 7-64), so it seems the best option is to disactivate C:\Program Files (x86)\Common Files\microsoft shared\OFFICE14\RichEd20.DLL if present. Of course, we all have learnt that the RichEdit control is a misbehaved pig, but on the other hand, once you know its bugs, pardon: features, it does a very good job.
Title: Re: 1st steps, 1st problem
Post by: MichaelW on February 02, 2015, 04:34:36 AM
My Windows 8.1 has riched20.dll in the Windows System32 directory, version 3.1, 638464 bytes, and also riched32.dll, a wrapper DLL for RichEdit 1.0. It has some version of MSO installed but I did not bother with checking the version.
Title: Re: 1st steps, 1st problem
Post by: jj2007 on February 02, 2015, 06:00:35 AM
Quote from: MichaelW on February 02, 2015, 04:34:36 AMMy Windows 8.1 has riched20.dll in the Windows System32 directory, version 3.1, 638464 bytes

Interesting. Half way between the Win7-64 default 473600 bytes and C:\Program Files (x86)\Common Files\microsoft shared\Office11\RichEd20.dll at 925k...
Title: Re: 1st steps, 1st problem
Post by: SHDA on February 05, 2015, 01:43:48 AM
After i tried the http://www.resedit.net/ (http://www.resedit.net/) online installation
i had to re-install Windows from scratch. Done! Back again.

Sorry to interrupt your further matters but i have to RESUME this thread:
(For my question) the conversation spotted the Resource Editor incapability
to produce unicode characters that refers to other languages than english,
as 1st option, and the programmable 2nd option to do it by using include
files while linking and/or by saving the source in unicode/utf-8 file format
depending of the known assembly IDE's capabilities or restrictions or faults.

As for the visual option:
I found this http://www.resource-builder.com/ (http://www.resource-builder.com/). I haven't try it yet
to include what it creates in an assembly project but indeed contains visible
unicode characters related in many spoken/written languages. Once i will
become capable to manage with comfort assembly code projects and include
files, i will try it. In the meanwhile i will try to experiment with all of your
suggestions, except online installations off course.

Sure your options are related to your opinions/experience but i prefer (while
learning as a newbie or not
) to excaust all cases so to be able to understand,
learn so then, to be able to choose the most fast and suitable programming way
to do the same thing. As an example,
(in Delphi) i've got more fast and real multitasking results in any loop as i
used goto ... label statements by increasing manually the counter, instead
to use the standard-cllassic but slower loop of for 1 to sizeOf that freezes
the CPU, no mouse click etc, till finishes it's job.

Comment:
Also, as a conclussion:
it is pitty that there is no real UNICODE enviroment.
I can't do it right now as i luck of assembly knowliedge
but it is so simple for a programm to set on behalf of the
user:
This character belongs to this code-page language, set it!
and let the programmer to thing about the flow, the structure.