I hope will useful for somebody. For me, it will. I know code is a bit sloopy but who dares. Tested only on w98.
Attachments:
Posted on 2005-09-16 13:53:04 by cakmak
Hi cakmak

Nice addin.
Reminds me of the good old Basic days where you could type .p for Print and .g for GoTo.

After a few minor changes I was able to make it work on my XP.
There is still a bug somewhere after adding new words.
You must restart RadASM to make the new words work.

KetilO
Attachments:
Posted on 2005-09-18 09:57:03 by KetilO
Hi KetilO,

Glad to hear you liked this idea. In fact first i start to do more plain addin but later it started to more long and a pain in my .ss :) This was a lot of first for me. So after complately implement my plannes, and worked enough. A bit tired and thought, is time to share.

BTW, if i remember, it was worked in my system w/o restarting RA for new addeds. I will look. But maybe you meant only for XP.

I will check your version. Happy coding.

Greets,
cakmak
Posted on 2005-09-18 12:38:27 by cakmak
I have implemented,

1. Responsing enter key in listview like double click
2. AutoCorrect.dat path has relative path. But this will be a problem when project folder is not in the same drive where RA loaded.

but not with me just now. If anybody dare this situations tell me. Little details.

cakmak
Posted on 2005-09-21 12:12:31 by cakmak
Hi

Would it not be a good idea to use ADDINDATA.lpAddIn?
This is a pointer to the addin path.

KetilO
Posted on 2005-09-21 13:36:22 by KetilO
Hi,

Yes it is. Exactly actually. Also did. But forgot to get it to a diskette.

greets,
cakmak
Posted on 2005-09-22 12:56:00 by cakmak
Hi cakmak

Found the following:

RAEditProc proc hWnd:HWND,uMsg:UINT,wParam:WPARAM,lParam:LPARAM

Should be:

RAEditProc proc uses ebx,hWnd:HWND,uMsg:UINT,wParam:WPARAM,lParam:LPARAM


Suggestion:


This causes the entered space char to be ignored if the caret position is set:

invoke SendMessage,.ADDINHANDLES.hEdit,EM_REPLACESEL,TRUE,eax ; replace
.if cpos ; if string needs caret positioning (~)
  mov eax, startofw ; starting pos of keyword(if is) string
  add eax, cpos ; add this ~ pos
  .if bMult ; if was a mult
    dec eax ; really dont know why needs :P maybe later. Now i finished.
  .endif
  invoke SendMessage,.ADDINHANDLES.hEdit,EM_SETSEL,eax,eax ; set caret pos
  invoke SendMessage,.ADDINHANDLES.hEdit,EM_SCROLLCARET,0,0 ; Update caret pos
  xor eax,eax
  ret
.endif


KetilO
Posted on 2005-09-23 08:30:20 by KetilO
Thank you again KetilO,

Yesterday, i was upload a new one. But after seeing your suggest, give up this. Now here is a better work then previous.

Also, fixed some bugs. One of them is which you mentioned above about not work correct before reloading RA. Meanwhile,
i suppose the fix which you mentioned for this bug is not in your upload above. There was only a one more AddMenu for difference. BTW, i added it too.

For new changes may find in both txt file with in zip file and source code with a,

; 1.0.4

comment. I suppose this is better.

Cheers,
cakmak
Attachments:
Posted on 2005-09-24 12:41:19 by cakmak
Hi cakmak

Works well.

There is still a bug if you try to open the list when no project is opened.
Suggested fix:

.elseif eax==AIM_INITMENUPOPUP
        mov eax, lpData
        mov eax, .ADDINDATA.fProject
        ;Enable/disable the menuitem
        mov edx,MF_GRAYED
        .if eax
            mov edx,MF_ENABLED
        .endif
        mov    eax,
        mov    eax,(ADDINHANDLES ptr ).hMenu
        invoke EnableMenuItem,eax,IDAddIn,edx


I think it would be a good idea to create an own list for each assembler (like: masmAutoCorrect.dat).

.elseif eax==AIM_PROJECTOPENED
    mov eax, lpData                            ; Get RadAsm path  1.0.2
    mov eax, (ADDINDATA ptr).lpAddIn      ; eax = path ( w/o ending "\" )
    invoke lstrcpy,offset DataFullName,eax      ; x:\..\RadAsm\Addins
    invoke lstrcat,offset DataFullName,offset BackSlash
    mov eax, lpData
    invoke lstrcat,offset DataFullName,addr (ADDINDATA ptr).szAssembler
    invoke lstrcat,offset DataFullName,offset DataFileName  ; x:\..\RadAsm\Addins\masmAutoCorrect.dat


KetilO
Posted on 2005-09-26 08:42:13 by KetilO
Hi,

Thank you. In fact i was know that bug you said but forgot to fix.

The suggestion is ok but why? Maybe a separate cpp & asm. What did you think, can you tell me please?

cakmak

note: Any suggestion for more effective or speed or short way to work? If possible.
Posted on 2005-09-27 12:06:32 by cakmak
The syntax for each assembler or programming language is different.
An own file for each programming language is the most flexible solution.

KetilO
Posted on 2005-09-27 15:01:42 by KetilO
Understand. I will upload next time but you may too.

cheers
Posted on 2005-09-28 12:06:23 by cakmak
Hi all

This is the updated version (1.0.5)

o Own file for each programming language / assembler.
o Subclassing of the RAEdit control done the right way.

KetilO

EDIT:
Attachment deleted.
There was a bug in the unsubclassing in AIM_MDIACTIVATE
Posted on 2005-09-30 08:32:51 by KetilO
Hi all

There was a bug in the unsubclassing in AIM_MDIACTIVATE

Here is the way to do it.

KetilO
Attachments:
Posted on 2005-09-30 17:36:25 by KetilO
Hi KetilO,

The latest upload is a bit problem in w98, at least in my system. I back to previous one.

while opening a dialog in project, lots of RadAsm exception window poping up.

cakmak

Posted on 2005-10-02 12:22:38 by cakmak
Hi cakmak

It is also important to update the other addin that subclasses RAEdit (CodeComplete tutorial, CodeTemplates, ObjAsm32 addin).

KetilO
Posted on 2005-10-02 13:29:26 by KetilO