News:

Masm32 SDK description, downloads and other helpful links
Message to All Guests

Main Menu

Radasm3 Get filename

Started by ragdog, January 20, 2019, 09:29:01 PM

Previous topic - Next topic

ragdog

Hello

For my addin need i information about the project Main.rc,main.asm etc

But the AddinData struct is this both empty

.if (uMsg==AIM_PROJECTOPENED)
invoke SendMessage,hWnd,AIM_GETDATA,NULL,NULL
mov esi,eax
invoke TextOutput, addr [esi].ADDINDATA.szMainRC
invoke TextOutput, addr [esi].ADDINDATA.szMain
invoke TextOutput, addr [esi].szMainAsm


radasm open a project in store it correctly to this structur

GetProjectFiles

invoke GetTheFileType,addr pbi.szitem
.if eax==ID_EDITCODE
invoke strcpy,addr da.szMainAsm,addr buffer
.elseif eax==ID_EDITRES
invoke strcpy,addr da.szMainRC,addr buffer
.endif
.endif


if i debug Radasm da.szMainAsm,da.szMainRC is filled with the correct filenames.

Has any an idea how i can get it?

fearless

The FlipCase addin project has an example.
It gets the pointer to the addindata during the InstallDll proc:
    ;Get pointer to data struct
    invoke SendMessage,hWin,AIM_GETDATA,0,0
    mov        lpDStruct,eax

and during the DllProc it uses this info:
                        ;Change from .tmp to .asm
                        lea        edx,[buffer+eax-3]
                        mov        dword ptr [edx],'msa'
                        mov        eax,lpDStruct
                        mov        edx,[eax].ADDINDATA.lpFile

and has a commented section showing project opened:
;    .elseif eax==AIM_PROJECTOPENED
;        ;Always return false
;        ;hWin        handle of mdi frame
;        ;lParam        pointer to ProjectFile
;        ;Added by NEMO
;        mov        eax,[lpDStruct]
;        mov        edx,(ADDINDATA ptr [eax]).lpProject
;        push    ebx
;        mov        ebx,(ADDINDATA ptr [eax]).lpFile
;        invoke lstrcpy,ebx,edx
;        invoke lstrlen,ebx
;        mov        dword ptr [ebx+eax-4],4D53412Eh
;        invoke GetFileAttributes,ebx
;        pop ebx
;        .if eax!=-1
;            ;Open the file
;            push    TRUE
;            mov        eax,[lpPStruct]
;            mov        eax,(ADDINPROCS ptr [eax]).lpOpenProjectFile
;            call    eax
;        .endif

you might have to check the values in eax and ecx you are returning at end of InstallDll to check that the correct hooks are being used, so that the RadASM knows which stuff to handle.

ragdog

Hello

My problem is solved it works.
accidentally i used an older include and with a older structur. :icon_rolleyes: