hi just have some questions about the dll format
testrun proc mWnd:DWORD,aWnd:DWORD,data:DWORD,parms:DWORD,show:BOOL,nopause:BOOL
LibMain proc instance:DWORD,reason:DWORD,unused:DWORD
could you confirm this for me..
are things like data, mWnd,instance, params, unused etc variables like the usual ones.. or can be
treated like variables , as such ?
-------
They look okay to me. I usually avoid using words such as data though that is just personal preference.
Paul
They're arguments, just as in any 'normal' function.
What Paul means is that 'data' is used by masm as a keyword, and though you might get away with it in this case, try to avoid using keywords for argument/variable names. "value" would work just as well?
General dll startup code.. (this is what you've named LibMain)
DllEntry proc hInstance:HINSTANCE,reason:DWORD,reserved1:DWORD
mov eax,reason
.IF (eax==DLL_PROCESS_ATTACH)
;return TRUE to continue loading, or FALSE to abort
.ELSEIF (eax==DLL_PROCESS_DETACH)
.ELSEIF (eax==DLL_THREAD_ATTACH)
.ELSEIF (eax==DLL_THREAD_DETACH)
.ENDIF
mov eax,TRUE
ret
DllEntry endp
BTW, the last to lines in Tedd's example are not a convenience they are a requirement.
mov eax,TRUE
ret
Also, remember the DEF file. The DLL will not know what to export without it so if it doesn't exist, the DLL will not work which will cause one to think there is an error in the assembly. This error will drive most people absolutely crazy! :red
Paul