The MASM Forum Archive 2004 to 2012

General Forums => The Campus => Topic started by: jj2007 on April 11, 2008, 11:46:58 PM

Title: RichMasm: an editor that remembers your formatting
Post by: jj2007 on April 11, 2008, 11:46:58 PM
RichMasm is a special editor for working with assembler source code. It has been designed for long
source codes, and concentrates on effective navigation rather than on beauty and/or abundance of features.
The package includes a number of easy-to-use "skeletons", including dll and library examples, and
MasmBasic, a library that allows to use Basic syntax in assembler.
Download the package (updated 7 October 2009) at the bottom of the MasmBasic (http://www.masm32.com/board/index.php?topic=12460) top post.

RichMasm has three main features for navigation:
1. The bookmarks: select some text and press Control D, as in your browser
2. The left & right arrows in the upper right corner provide you with a history of recent changes
3. Double-click on a word, e.g. on MyProc, press F3, and see a listbox of matches
(http://www.webalice.it/jj2006/pics/RichMasm.png)
Version 06 October 2009: MasmBasic (http://www.masm32.com/board/index.php?topic=12460) added
Version 28 July 2009: fixed a little problem with the Find box
Version 22 July 2009: very simple DLL example added, works with ml/JWasm, link and polink; support for RTF JavaScript sources
Version 10 July 2009 has tooltips for URLs and context-sensitive help (within the limits of HtmlHelp (http://helpware.net/FAR/far_faq.htm#HH_CLOSE_ALL))
Version 14 May 2009 features Last good version in the File menu, allowing you to revert to the last version that assembled without errors.
Version 31 March improves handling of linker warnings - see note on NoWarn option in Configure project.
Version 17 March 2009 has an AutoFormat entry in its menu, for harmonising blocks of obscurely formatted code.
Version 3 November adds support for tiny com apps - look for "8-byte Hello World programme" in the guide (inspired by this thread (http://www.masm32.com/board/index.php?topic=10252.msg75057#msg75057)).
Version 30 October adds support to JWasm: If RichMasm finds \masm32\bin\JWASM.EXE, Japheth's tool will be automatically used (override with OPT_Assembler ml). Same applies for polink.
Version 8 October fixes a bug that occasionally showed an empty window when opening repeatedly docs from the same instance. My apologies :red
Version 7 October scratches the 50k size limit but also offers some goodies, especially for navigating through a long text - see below an example for the wildcard search sm*WM_ (sm is my equate for invoke SendMessage, ).
The new library example shows how to build MyLib.lib from several modules.
Full package attached below under the MasmBasic (http://www.masm32.com/board/index.php?topic=12460) top post, feedback and suggestions welcome as always :bg
Title: Re: RichMasm: most needed code snippets?
Post by: hutch-- on April 12, 2008, 01:14:30 PM
jj,

I just downloaded it but when I try to run it in instantly GP faults. I am running win2000 sp4. Any idea of why this is happening ?
Title: Re: RichMasm: most needed code snippets?
Post by: anuradha on April 12, 2008, 01:43:45 PM
it works fine with me .
runnig XP proffetional  Sp2
Title: Re: RichMasm: most needed code snippets?
Post by: jj2007 on April 12, 2008, 02:38:18 PM
Quote from: hutch-- on April 12, 2008, 01:14:30 PM
I just downloaded it but when I try to run it in instantly GP faults. I am running win2000 sp4. Any idea of why this is happening ?

Hutch, I sent you a debug version by email. It might be a problem specific to Win2000.
While checking this, I stumbled over a problem:

.Repeat
         invoke GetMessage, ADDR msg, NULL, 0, 0
         invoke GetKeyState, VK_DOWN
.Until ax<8000h         ; GetKeystate needs a WORD

When debugging, it looped endlessly. My beta 0.9 seems not to be affected, and is fairly stable... mysteries of Windows!

Attached a new version which avoids this loop, and also has one more code snippet called "Controls skeleton".

Thanxalot for testing this.
Title: Re: RichMasm: most needed code snippets?
Post by: hutch-- on April 13, 2008, 02:15:43 AM
jj,

Solved the problem, your app requires GDIPLUS.DLL which I did not have installed. I added it back in and it displays correctly. Suggestion is to put a GDIPLUS detect routine in the startup code and advise the user if it is not available.

From a quick look it is certainly different.
Title: Re: RichMasm: most needed code snippets?
Post by: jj2007 on April 14, 2008, 04:06:47 PM
Quote from: hutch-- on April 13, 2008, 02:15:43 AM
jj,

Solved the problem, your app requires GDIPLUS.DLL which I did not have installed. I added it back in and it displays correctly. Suggestion is to put a GDIPLUS detect routine in the startup code and advise the user if it is not available.


FIXED - see attachment, with other changes (e.g. Menu "File Open" is now as usual, while Control O is still the "either love it or hate it" way)

Quote
From a quick look it is certainly different.

Wow! I did not expect such a big complement from Sir Hutch, thanxalot! :cheekygreen:

EDIT:
Version of 7 July 2008 attached, now with DLL and LIB examples in the AutoCode section. Unzip to the root folder of your Masm32 drive with "use folder names".

EDIT(2):
Version of 18 September 2008 attached with next post (http://www.masm32.com/board/index.php?topic=9044.msg72809#msg72809).

What's new?
RichMasm is a special editor for working with assembler source code.
This is a beta, so you are using it at your own risk. Save frequently...
(If you really, really forgot to save, try to rename name.bak to name.asc).
RichMasm has been designed for long source codes, and concentrates on
effective navigation rather than on beauty and abundance of features.
An example: You wrote this great new CAT$ macro that is driving you mad...

Assembling: tmp_file.asm
tmp_file.asm(29) : error A2091: index value past end of string
MacroLoop(52): iteration 5: Macro Called From
  CAT$(96): Macro Called From
   MsgBox(1): Macro Called From
    tmp_file.asm(29): Main Line Code

So in line 96 of the macro, there is a problem. How do I get there, if the macro starts in line 231?
Either the hard way: 231+96-1=326; press Alt Goto, type 326, Enter...
Or the easy way: Place the cursor in the MACRO line and press Ctrl Shift Offset. From now on, the
line counter shows e.g. Line 326/96, meaning you are in line 326 of the doc and in line 96 of the macro.
To make things even easier, Alt Goto will now act relative to the start of the macro.

How to use Pelle's linker:
; OPT_Linker   polink

(you can specify quite a number of options embedded into the source through the OPT_ keyword; in general, you don't need any of them. For example, it is not necessary to tell RichMasm whether you want a CONSOLE or WINDOWS app - there is a pretty efficient autodetect routine that does it for you)
Title: Re: RichMasm: most needed code snippets?
Post by: jj2007 on September 18, 2008, 10:31:13 AM
Version 18 September 2008 attached replaced by 21 30 September version attached with this post (http://www.masm32.com/board/index.php?topic=9044.msg73451#msg73451).

More stable, some bugfixes, hyperlinks.

For the fans of OllyDbg:

int 3      ; F6 assembles %file%.asm, links and starts \masm32\OllyDbg\ollydbg.exe %file%.exe
(you may have to press F9 yourself to start the debugging :bg)

; int 3      ; F6 assembles, links and starts %file%.exe without debugging

You can have multiple int 3's. If at least one (lowercase, int<space>3) is present, Olly will be launched, otherwise not. And of course, it will not be launched if Olly is not present at the exact location shown above in bold.

Remember RichMasm autodetects whether you have a console or windows app.
Title: Re: RichMasm: most needed code snippets?
Post by: Farabi on September 18, 2008, 01:00:51 PM
This would be the smallest editor I ever seen. Looking forward for the next version.  :cheekygreen:
Title: Re: RichMasm: most needed code snippets?
Post by: herge on September 19, 2008, 03:22:39 PM

Hi jj2007:

How do you set up help files?
I am having all sorts of trouble with
the help.

Regards herge
Title: Re: RichMasm: most needed code snippets?
Post by: jj2007 on September 19, 2008, 05:01:11 PM
Quote from: herge on September 19, 2008, 03:22:39 PM

Hi jj2007:

How do you set up help files?
I am having all sorts of trouble with
the help.

Regards herge

Check \masm32\RichMasm\menus.ini - entries can only work if the corresponding file is present. The format is shamelessly stolen from Quick Editor.
Title: Re: RichMasm: most needed code snippets?
Post by: herge on September 19, 2008, 06:54:53 PM
 Hi jj2007:

This editor should be put in the  beta trash can!

Regards herge
Title: Re: RichMasm: most needed code snippets?
Post by: jj2007 on September 19, 2008, 07:40:46 PM
Quote from: herge on September 19, 2008, 06:54:53 PM
This editor should be put in the  beta trash can!
Thanks for the nice feedback :8)
However, if you refer to the help files, remember it behaves exactly like Quick Editor... :bg
Title: Re: RichMasm: most needed code snippets?
Post by: jj2007 on September 20, 2008, 11:06:32 PM
Quote from: Farabi on September 18, 2008, 01:00:51 PM
This would be the smallest editor I ever seen. Looking forward for the next version.  :cheekygreen:

Well, it's 50% bigger than qeditor.exe, but I won't enter in competition with Hutch.

New version is attached. I convinced RichEdit that hyperlinks are a useful feature, and that internally they should have the forum's format. In practice this means you can:

- insert a hyperlink in your source with Control K (e.g. a link to the post from which you copied all your good ideas :bg)
- select a code snippet
- press Control Shift C (i.e. plain text copy)
- switch to the Masm Forum
- press Control V to get a perfectly formatted code snippet including the url=http:// code

As Sir Hutch wrote earlier, RichMasm is certainly different :toothy

P.S.: In response to herge's problems, those help entries for which no file exists on disk will no longer be included in the menus. See also \masm32\RichMasm\menus.ini

EDIT: 23 September version attached here (http://www.masm32.com/board/index.php?topic=9044.msg73057#msg73057).
Title: Re: RichMasm: most needed code snippets?
Post by: hutch-- on September 20, 2008, 11:33:27 PM
JJ,

I have found one bug for you, when you start the editor and move the mouse over the "Autocode" menu entry, you get a RichMasm error saying the handle is invalid. The "Autocode" entry then disappears from the menu but you get the error msgbox if you move the mouse where it used to be.

The missing GDIPLUS warning works correctly and when I added it to the windows\system it detects it properly and I get the pictures as well.
Title: Re: RichMasm: most needed code snippets?
Post by: jj2007 on September 20, 2008, 11:56:42 PM
Quote from: hutch-- on September 20, 2008, 11:33:27 PM
when you start the editor and move the mouse over the "Autocode" menu entry, you get a RichMasm error saying the handle is invalid.
Thanks, Hutch, this is indeed a fat bug. Question: Did you launch it with all files extracted to the root, option "using folder names" on? I have seen this problem when a menu had no files at all, so the only explanation I have it does not find any of the autocode files. They are hardcoded in menus.ini

MessageBox,\Masm32\RichMasm\messagebox.asc

I guess the format looks familiar to you :bg

EDIT: I fixed it, new attachment below. Now, it grays out the first file in the list if it is missing, instead of complaining. This should work (please confirm), although in practice the user should simply follow the instructions and extract all files to the root folder, thus creating the proper \masm32\RichMasm tree.
Title: RichMasm: Version 24 September
Post by: jj2007 on September 23, 2008, 03:00:30 AM
Version of 24 September fixed a harmless bug (text scrolled when typing something in the Find box), and greatly enhanced the Ctrl K insert hyperlink feature.
Title: Re: RichMasm: most needed code snippets?
Post by: jj2007 on September 23, 2008, 11:06:58 PM
Version 24 September attached right above:

- Hyperlinks now fully functional, either by pressing Ctrl K or by selecting Format/Insert link. If http: or x:\file.ext are present on clipboard, the edit field will be prefilled.
- Right-click to edit an existing link.
- F4 toggles comments (if first non-whitespace char is ;, then all comments will be removed, if not, ; will be added to all selected lines)
- New Win & Console app option added to File menu
- Build & run option added to File menu
- if int 3 is present, F6 assembles, links and starts OllyDbg; for console apps, the nagging console window will be automatically minimised
Suggestions welcome, of course :bg
Title: RichMasm: text anchors added
Post by: jj2007 on September 29, 2008, 10:02:28 PM
In addition to "normal" hyperlinks, version 30 September 08 has now text anchors, i.e. you can create html-like anchors in a document to which you can link. Example:

(page 5):
   mov ecx, hList
   .if ShowLB      ; attention may be reset by this procedure (http://this%20procedure)
      mov ecx, hRE
      mov eax, BST_UNCHECKED
   .endif

(page 25)
   .if ShowLB
      or ecx, -1
      mov eax, BST_CHECKED
      and ShowLB, 0
   .endif

This feature turned out to be pretty complex, but it seems stable now - feedback and bug reports wanted...

RichMasm saves a temporary plain text file to disk, then launches ml.exe. Internally, an anchor is preceded by a 5 letter (hidden) code telling RichMasm its name and length. This code will obviously be removed before launching the build process. In practice, this means your text anchor can be embedded in the code. The link, however, will not be removed, and therefore must appear in a comment.

Edit: Fixed a minor bug that caused unexpected scrolling.
See top of thread for latest attachment.
Title: Re: RichMasm: an editor that remembers your formatting
Post by: jj2007 on October 07, 2008, 10:24:51 AM
See top of thread for latest version.
Title: Re: RichMasm: an editor that remembers your formatting
Post by: jj2007 on October 09, 2008, 10:45:29 PM
Version 10 October, attached above: Improved reading in of plain text sources. Bookmarks are now generated for .data, .data?, .code, macros, procs, and a number of WM_ messages. The guide contains a little table with links to the Masm32 examples.
Title: Re: RichMasm: an editor that remembers your formatting
Post by: hutch-- on October 10, 2008, 01:09:52 AM
:bg

JJ,

If you ever succeed in getting RichMasm comprehendable to mere mortals it could end up a dangerous weapon. No the important question apart from what you have designed it to do is can it make good cappachino ?

Keep up the good work.  :thumbu
Title: Re: RichMasm: an editor that remembers your formatting
Post by: jj2007 on October 10, 2008, 08:22:34 AM
Quote from: hutch-- on October 10, 2008, 01:09:52 AM
dangerous weapon

I am working on it, as the snippet below shows - for notebooks only, unfortunately.

CheckQuality proc
  call AnalyseCode
  .if NoobScore>20
invoke PlayMidi, chr$("ViolentLaughter.mid")
  .elseif BadCodeScore>20
call CloseCoverAndSmashProgrammersHands
  .else
MsgBox hWnd, chr$("Compliments, your code is fine!"),
addr AppName, MB_OK
  .endif
  ret
CheckQuality endp


Quote
Now the important question apart from what you have designed it to do is can it make good cappuccino?

Now you caught me in the act, Hutch! But I am having problems with the hardware interface. Anybody aware of standard protocols for communicating with a coffee machine?

Quote
Keep up the good work.  :thumbu

You too :thumbu
By the way: I have added a couple of links to the \masm32\examples section into the manual. Usage should be simple enough for mere mortals: Click on the link, and hit F6 when you see code. Afaik they all assemble fine and don't need the build.bat any more... \masm32\RichMasm\bldallRM.bax has some goodies, but beware, I don't check if it has been changed, so every new installation will overwrite the bax.
Title: Re: RichMasm: an editor that remembers your formatting
Post by: jj2007 on March 17, 2009, 09:43:20 AM
RichMasm has been updated - see above below the screenshot.

Major changes:
- a recent files menu aka MRU (most recently used)
- a template for using TIMERS.ASM (under File/New Masm source)
- assembly output now integrated
- jumps directly to the error line where possible
- autoformat for blocks with ugly formatting
- under the hood: added SSE2 for faster strlen (http://www.masm32.com/board/index.php?topic=1807.msg81400#msg81400)

Feedback welcome, of course.

EDIT: The search function has been improved. Example:

Find uMsg*VK will find all lines where VK follows uMsg. Problem: They are not in the same line...

  .elseif uMsg==WM_KEYDOWN
   .if wParam==VK_RETURN

Find uMsg**VK will find the block above. And in case you have something like this:

  .elseif uMsg==WM_CHAR   ; KeyFiles
   ; status wParam, chr$("CHAR ")
   .if wParam==VK_SPACE || wParam==VK_RETURN

... just add one star more: Find uMsg***VK will find VK within the next two lines.
Title: Re: RichMasm: an editor that remembers your formatting
Post by: lingo on March 17, 2009, 01:12:25 PM
Not a big deal but I can't see the menu titles
under Windows 64 bit Vista Ultimate SP1.

[attachment deleted by admin]
Title: Re: RichMasm: an editor that remembers your formatting
Post by: jj2007 on March 17, 2009, 05:07:30 PM
Quote from: lingo on March 17, 2009, 01:12:25 PM
Not a big deal but I can't see the menu titles
under Windows 64 bit Vista Ultimate SP1.

Thanks, Lingo. It seems that Vista doesn't like painting on the Window DC. "Not a big deal" is an understatement :wink
Title: Re: RichMasm: an editor that remembers your formatting
Post by: lingo on March 17, 2009, 07:52:58 PM
"Not a big deal" is an understatement"

"Not a big deal" means Vista has special properties options for exe files and if we mark "Disable desktop composition" option
from Properties\Compatibility of the richmasm.exe all appears OK...



[attachment deleted by admin]
Title: Re: RichMasm: an editor that remembers your formatting
Post by: jj2007 on March 17, 2009, 08:07:54 PM
Quote from: lingo on March 17, 2009, 07:52:58 PM
if we mark "Disable desktop composition" option from Properties\Compatibility of the richmasm.exe all appears OK...


Ok, I admit you are a genius :bg
Title: Re: RichMasm: an editor that remembers your formatting
Post by: jj2007 on March 31, 2009, 10:27:04 PM
Update above, below the screenshot.

Handling of linker warnings is now improved, see OPT_NoWarn in File/Configure project.
Title: Re: RichMasm: an editor that remembers your formatting
Post by: jj2007 on May 14, 2009, 09:40:35 AM
Update above, below the screenshot. Main change: a "Last good version" in the File menu allows to revert to the last version that assembled & linked without errors. Can be a handy feature :bg
Title: Re: RichMasm: an editor that remembers your formatting
Post by: UtillMasm on May 16, 2009, 04:20:37 AM
Your editor look good. When will you post code? I guess I can speak for everybody when I say we are curious. :toothy
Title: Re: RichMasm: an editor that remembers your formatting
Post by: hutch-- on May 16, 2009, 04:26:34 AM
JJ,

How is it going with the Capochino ?

Keep up the good work.  :U
Title: Re: RichMasm: an editor that remembers your formatting
Post by: UtillMasm on May 16, 2009, 04:54:59 AM
哈哈哈!

keep sleeping...zzzZzzz..zz.zzZzzzz.z.z
Title: Re: RichMasm: an editor that remembers your formatting
Post by: jj2007 on May 16, 2009, 07:20:23 AM
Quote from: UtillMasm on May 16, 2009, 04:54:59 AM
keep sleeping...zzzZzzz..zz.zzZzzzz.z.z

Hey, wake up, the yankees are attacking!!
:toothy
Title: Re: RichMasm: an editor that remembers your formatting
Post by: UtillMasm on May 16, 2009, 09:39:18 AM
oh my fo! software war or opium war again?
:eek

ok, we are ready. come on! :boohoo:
Title: Re: RichMasm: an editor that remembers your formatting
Post by: jj2007 on July 22, 2009, 10:41:51 AM
Since I will have some fun with JavaScript from now on, I added support to "rich" JavaScript sources - see new version at top of thread.

For the curious ones:
- open a JavaScript source, e.g. MyTest.js
- add somewhere //OPT_JsWt   My homepage   ; start of window title
- do whatever you like to add some colour to your code - this is RTF, right?
- save the file as MyTest.asc (the RichMasm ending)

What happens when you hit F5 is that RichMasm...
1. checks for the presence of the OPT_JsWt code
2. checks if there is an open window whose title starts with My homepage (or whatever)
3. writes a plain text copy named MyTest.js (danger... no nag box asking if you really want to overwrite your precious code) to disk
4. moves the My homepage window to the foreground

Step 5 is obviously that you hit F5 again to reload the homepage.
Title: Re: RichMasm: an editor that remembers your formatting
Post by: hutch-- on July 22, 2009, 04:33:32 PM
 :bg

jj,

Is it well enough developed to withstand its own coffee yet ?

Keep up the good work.  :U
Title: Re: RichMasm: an editor that remembers your formatting
Post by: jj2007 on July 22, 2009, 09:47:26 PM
Quote from: hutch-- on July 22, 2009, 04:33:32 PM
Is it well enough developed to withstand its own coffee yet ?

No progress on the cappuccino front, sorry :8)

Quote
Keep up the good work.  :U

I'm trying hard. The source is now at slightly over 10,000 lines, and loading time starts bothering me - 2.5 seconds for the RTF/ASC version, 1.6 for its plain text version. RichEdit is powerful but not very fast...
On the other hand, the bookmarks and hyperlinks, the find listbox and the individual colouring help a lot with a source of that size. I sometimes wonder how people manage to keep control over such a source with a plain text editor... ::)
Title: Re: RichMasm: an editor that remembers your formatting
Post by: ToutEnMasm on July 23, 2009, 06:46:43 AM

Quote
I sometimes wonder how people manage to keep control over such a source with a plain text editor...

Good question ,seems you have understand why some IDE cut this in pieces and add a navigator of source code.Those IDE have no problem with the few lines of your source.
You are too much limited with only one window.
Title: Re: RichMasm: an editor that remembers your formatting
Post by: jj2007 on July 23, 2009, 08:04:42 AM
Quote from: ToutEnMasm on July 23, 2009, 06:46:43 AM
Quote
I sometimes wonder how people manage to keep control over such a source with a plain text editor...
Good question ,seems you have understand why some IDE cut this in pieces and add a navigator of source code. Those IDE have no problem with the few lines of your source.

Hi Yves,
Since you seem the only one world-wide who also uses RTF for a code editor, I installed yesterday your EditMasm (http://pagesperso-orange.fr/luce.yves/Editmasm.htm) package - 34 MB, wow! Now I wonder what you mean with "navigator"? The "Explorateur de Projet"? That only gives me a long list of procs and similar, starting with the list of my ACCELs:
(http://www.webalice.it/jj2006/pics/YvesProcExplorer.png)

Not very helpful, frankly speaking. With RichMasm, I just type e.g. OpenFile into the Find box and get a much "richer" output:
(http://www.webalice.it/jj2006/pics/OpenFileRM.png)

Quote
You are too much limited with only one window.
I use hyperlinks for jumping between distinct pieces of code. The destination can be in the same file, but also in another file; in this case, when you click on the link, the other file will open, and the cursor jumps right to the destination:
(http://www.webalice.it/jj2006/pics/LinksRM.png)
IMHO there is no advantage having multiple windows in the same editor instance; Alt Tab switching is more comfortable.

By the way, I could not convince EditMasm to open a file from the file dialog. It just crashes silently. Launching editmasm.exe myfile.asm works, dragging a file over the editor window should work (the cursor changes to the WM_DROPFILES type, so you are obviously using it) but it doesn't, unfortunately.

EDIT: Yves, I reinstalled EditMasm on another machine and now the FileOpen dialogs work fine. By the way, "Recent files" in the open menu would be a great thing to add. I also noticed that when you confirm the "Open" by hitting Return, EditMasm inserts a new line into the newly opened document. Another little glitch: When you close EditMasm with Alt F4, there is no box asking if you want to save the changes - that could be dangerous. Hope this helps, jj
Title: Re: RichMasm: an editor that remembers your formatting
Post by: ToutEnMasm on July 23, 2009, 03:07:00 PM
 :bg

Editmasm works with XP.
A source navigator is what you have not try,the RIGHT CLIC (chercher le plan) +  left clic in the "explorateur de projet" + combobox for proc.
Editmasm don't work with files,only wiht project (that is further files).
With files,you can edit them,that is only of little interest,If you try to compile them,editmasm ask you for the creation of the project (all files must be in the same directory).
No need of hyperlink to find code,the right clic is enough.



Title: Re: RichMasm: an editor that remembers your formatting
Post by: jj2007 on July 23, 2009, 06:09:16 PM
Quote from: ToutEnMasm on July 23, 2009, 03:07:00 PM
Editmasm works with XP.
On one of my machines it works, on the other one - XP SP2 - the file dialog fails miserably.

Quote
A source navigator is what you have not try,the RIGHT CLIC (chercher le plan)

Most of the time it only extends the selection to the end of the line. Very confusing. A propos: What does the menu entry "Rechercher les confuses"??
Title: Re: RichMasm: an editor that remembers your formatting
Post by: ToutEnMasm on July 23, 2009, 07:00:07 PM

The use of the right clic is very complex.
Put the cursor on a word,right clic,editmasm made the rest (I have a headache explaining that)
Title: Re: RichMasm: an editor that remembers your formatting
Post by: jj2007 on July 23, 2009, 07:32:10 PM
Yves, here is a disassembly of the failing dialog. The exception raised is 6BA:
7C812A55         FF15 0815807C             call near [<&ntdll.RtlRaiseException>]  ; ntdll.RtlRaiseException

0040D2B8        >  8D05 0A414200           lea eax, [42410A]
0040D2BE        .  8945 A4                 mov [ebp-5C], eax
0040D2C1        >  C745 A8 58000000        mov dword ptr [ebp-58], 58
0040D2C8        .  FF75 08                 push dword ptr [ebp+8]
0040D2CB        .  8F45 AC                 pop dword ptr [ebp-54]
0040D2CE        .  FF35 648C4200           push dword ptr [428C64]                 ;  editmasm.00400000
0040D2D4        .  8F45 B0                 pop dword ptr [ebp-50]
0040D2D7        .  C745 B4 469A4200        mov dword ptr [ebp-4C], 00429A46        ;  ASCII "Tous"
0040D2DE        .  FFB5 94FDFFFF           push dword ptr [ebp-26C]
0040D2E4        .  8F45 C4                 pop dword ptr [ebp-3C]
0040D2E7        .  68 A00F0000             push 0FA0
0040D2EC        .  8F45 C8                 pop dword ptr [ebp-38]
0040D2EF        .  FF75 14                 push dword ptr [ebp+14]
0040D2F2        .  8F45 CC                 pop dword ptr [ebp-34]
0040D2F5        .  FF75 18                 push dword ptr [ebp+18]
0040D2F8        .  8F45 D0                 pop dword ptr [ebp-30]
0040D2FB        .  FF75 A4                 push dword ptr [ebp-5C]
0040D2FE        .  8F45 D4                 pop dword ptr [ebp-2C]
0040D301        .  C745 D8 139A4200        mov dword ptr [ebp-28], 00429A13        ;  ASCII "Ouvrir Fichier"
0040D308        .  C745 C0 02000000        mov dword ptr [ebp-40], 2
0040D30F        .  C745 DC 003A0800        mov dword ptr [ebp-24], 83A00
0040D316        .  8D45 A8                 lea eax, [ebp-58]
0040D319        .  50                      push eax                                ; /pOpenFileName = 0012FAB0
0040D31A        .  E8 B1160100             call <jmp.&comdlg32.GetOpenFileNameA>   ; \GetOpenFileNameA

Title: Re: RichMasm: an editor that remembers your formatting
Post by: ToutEnMasm on July 24, 2009, 05:00:17 AM

If it is for the open file dialog problem,no need of that.Upgrade your XP and all will be OK.
Title: Re: RichMasm: an editor that remembers your formatting
Post by: jj2007 on July 24, 2009, 06:31:40 AM
Quote from: ToutEnMasm on July 24, 2009, 05:00:17 AM

If it is for the open file dialog problem,no need of that.Upgrade your XP and all will be OK.


You are really funny - you should work for Microsoft :cheekygreen:

By the way: I do use the open file dialog in RichMasm, without problems :bg
Title: Re: RichMasm: an editor that remembers your formatting
Post by: ToutEnMasm on July 24, 2009, 07:53:10 AM

Quote
By the way: I do use the open file dialog in RichMasm, without problems
This surely the only one problem you solve with it  :lol


To be serious , i think i will finally don't use the OFN_EXPLORER  style with a multiple files selection or made a two versions of it to avoid the problems .
Seems there is two many people who don't want to pay microsoft to have something working well.
Title: Re: RichMasm: an editor that remembers your formatting
Post by: jj2007 on July 24, 2009, 09:02:50 AM
Quote from: ToutEnMasm on July 24, 2009, 07:53:10 AM

Quote
By the way: I do use the open file dialog in RichMasm, without problems
This surely the only one problem you solve with it  :lol

To be serious , i think i will finally don't use the OFN_EXPLORER style with a multiple files selection or made a two versions of it to avoid the problems .
Seems there is two many people who don't want to pay microsoft to have something working well.


I have no problems with OFN_EXPLORER. Maybe you should consider a hook:    mov ofn.lpfnHook, HpDlg with
HpDlg proc hwnd:DWORD, uMsg:DWORD, wParam:DWORD, lParam:DWORD

For example, it is much more convenient if you can center the file dialog, enlarge it vertically, and select the detailed listview instead of the standard crap view supplied by Microsoft... and it doesn't crash:
(http://www.webalice.it/jj2006/pics/RichMasmFileOpen.png)
Title: Re: RichMasm: an editor that remembers your formatting
Post by: ToutEnMasm on July 24, 2009, 11:07:33 AM

Your openfilename dialog box is whithout the internet explorer style.She is standard.

The   OFN_EXPLORER style show five buttons  in the left panel .This allow to go to the desktop,the recent documents and so on.
My problem is to know exactly which conditions are needed to show that.The comctl32.dll (version 6.02) seem needed if i remember well the first time i have encountered the problem.
Title: Re: RichMasm: an editor that remembers your formatting
Post by: jj2007 on July 24, 2009, 12:34:05 PM
Quote from: ToutEnMasm on July 24, 2009, 11:07:33 AM
Your openfilename dialog box is whithout the internet explorer style.She is standard.

From my source: mov ofn.Flags, OFN_EXPLORER or OFN_HIDEREADONLY or OFN_ENABLEHOOK or OFN_ENABLESIZING

Quote
The   OFN_EXPLORER style show five buttons  in the left panel .This allow to go to the desktop,the recent documents and so on.
My problem is to know exactly which conditions are needed to show that.The comctl32.dll (version 6.02) seem needed if i remember well the first time i have encountered the problem.

> desktop,the recent documents
For non-coding documents, the left panel might be useful. I chose not to use it.
Title: Re: RichMasm: an editor that remembers your formatting
Post by: ToutEnMasm on July 24, 2009, 12:39:25 PM

Your source can show the style,he had no effect because .....Something is missing ....
in the resource.
Title: Re: RichMasm: an editor that remembers your formatting
Post by: jj2007 on July 24, 2009, 02:50:30 PM
Quote from: ToutEnMasm on July 24, 2009, 12:39:25 PM

Your source can show the style,he had no effect because .....Something is missing ....
in the resource.


I don't use a resource file. The recent docs is not "missing", it is deliberately omitted because I never use it.
Title: Re: RichMasm: an editor that remembers your formatting
Post by: jj2007 on July 28, 2009, 02:36:11 PM
I stumbled into a strange phenomenon, most probably "by design":

- imagine you have a small edit control (e.g. a find box) with style ES_MULTILINE or ES_AUTOHSCROLL
- you write some text, then hit Enter
- now what could be easier than an invoke SendMessage, hFind, WM_GETTEXT, 99, ptr2buffer?

You are up for a surprise if and only if your text is larger than the edit control's width. In that case, what you get is not "MyLooongText" but rather 13, 10, "MyLooongText" ... and of course, the find box will not find anything.

That bugdesign feature has driven me crazy for some time, but since I found out yesterday night by accident that it was linked to the length of the text, a solution was near:

invoke SendMessage,  hFind, EM_SETSEL, 0, 0 ; prevents deletion of current
invoke SendMessage,  hFind, EM_SCROLLCARET, 0, 0 ; selection and insertion of CrLf


If you have a current version of RichMasm, test it with the Find box. Afterwards, you may download the new version from the top of this thread :wink
Title: Re: RichMasm: an editor that remembers your formatting
Post by: jj2007 on October 06, 2009, 10:37:52 PM
Update: MasmBasic (http://www.masm32.com/board/index.php?topic=12460) added, plus minor improvements of the editor itself. Download the package from the top of the MasmBasic thread.
Title: Re: RichMasm: an editor that remembers your formatting
Post by: nathanpc on October 07, 2009, 10:32:01 PM
o_O
That's cool!
I'm going to try it! :U
Title: Re: RichMasm: an editor that remembers your formatting
Post by: juozas on May 01, 2011, 10:11:48 PM
On XP SP3 RichMasm from MasmBasic package throws an error on startup like this:
Quote---------------------------
Fatal error:
---------------------------
GetLastError (line ??):

The handle is invalid.


---------------------------
OK   
---------------------------
Is there any way to fix this? Becouse now i can't run it totally. Thank you.
Title: Re: RichMasm: an editor that remembers your formatting
Post by: jj2007 on May 01, 2011, 10:19:54 PM
Quote from: juozas on May 01, 2011, 10:11:48 PM
On XP SP3 RichMasm from MasmBasic package throws an error on startup like this:
Quote---------------------------
Fatal error:
---------------------------
GetLastError (line ??):

The handle is invalid.


---------------------------
OK   
---------------------------
Is there any way to fix this? Becouse now i can't run it totally. Thank you.

Thanks for the feedback, juozas. I am using XP SP2, so that might be the culprit. Could you please test the attached debug version? Extract to \masm32\RichMasm\richmasm.exe and tell me which error line.
Thanks :U

P.S.: Note that the MasmBasic library works also with QEditor or good ol' Notepad etc - but using RichMasm is convenient because you can e.g. select Open and press F1 to get help on the Open command. There are also numerous keyboard shortcuts, such as deb for the powerful debug macro.

EDIT: Please test the new attachment. Most probably, when using the original MasmBasic archive, you did not use the "use folder names" options of your unzipper and/or you did not extract to the Masm32 root folder. The MasmBasic/RichMasm package relies on being installed to \masm32\RichMasm\ and \masm32\MasmBasic\
More specifically, the editor should sit in \masm32\RichMasm\RichMasm.exe
Title: Re: RichMasm: an editor that remembers your formatting
Post by: juozas on May 02, 2011, 05:10:17 AM
Yes, I extracted it with subfolders where it should reside, becouse I'm using 7-zip. It always extracts where files should be without problem, and, yes, RichMasm resides on \masm32\RichMasm.
Will try the debug version then.

Edit: Now it shown
Quote---------------------------
File not found:
---------------------------
D:\masm32\RichMasm\Res\RecentFiles.ini not found!

Try to move RichMasm.exe to its native folder, i.e. to

\masm32\RichMasm\RichMasm.exe
---------------------------
OK   
---------------------------
As i did not update MasmBasic

Screenshot Attached
Edit: Created a RecentFiles.ini with contents of full path to some file, now it works :)
Title: Re: RichMasm: an editor that remembers your formatting
Post by: jj2007 on May 02, 2011, 07:56:40 AM
Thanks a lot, Jouzas. I don't know at what point that bug crept in, but it needed to be fixed. New version posted here (http://www.masm32.com/board/index.php?topic=12460) is OK, it will create the ini files if needed.