How can i create a function in the DLL in which i can push my Parameters and then call the procedure from the DLL eg:-
*******************************
MyProgram.asm
*******************************
push OFFSET MyMsg
push OFFSET MyCap
call

Here TestHelloAddr Function displays a messagebox but i want the user to
push his text and caption and then call the Procedure.
So how do i create such a function in DLL such that i will except the
parameters from the user and then use it in the function???

Thankx in advance.
Posted on 2003-04-22 05:09:18 by telophase
How about this example?

Mike
Posted on 2003-04-22 05:56:46 by Mike
Thankyou Mike for your code it has helped me a lot.
But i still have 2 queries:-

In the function that you have defined in the DLL you have used szMsg:DWORD

is it necessary to use the sz Parameter in case of strings or you have used it to

distinguish the function and also you have used szMsg:DWORD should DWORD be always

used or i will vary on the API that you are calling

MsgBox proc szMsg:DWORD, szTitle:DWORD
invoke MessageBox,NULL, szMsg, szTitle, MB_OK
ret
MsgBox endp
Posted on 2003-04-23 08:55:55 by telophase
Hi telophase,

The sz prefix is just a naming convention (string zero terminated) you can use it or not, it's up to you. I haven't looked at the DLL example but the parameters that you are using are pointers to strings, in a 32 bit environment these will always be DWORDs. I only use DWORDs as parameters with DLLs but you can use any valid type that you want as long as the calling program is capable of passing that type, all languages are capable of passing DWORDs.
Posted on 2003-04-23 09:11:28 by donkey
Thankyou donkey i have understood the concept well.
Thanks for your help
:grin:
Posted on 2003-04-23 09:15:06 by telophase
Well, just take it as a form of hungarian notation. It is used so that it would be easier to read and understand what the code is saying. By the way, I think there is something wrong with the usuage of the prefix sz. I think it should be pMsg and pTitle.
Posted on 2003-04-23 09:48:38 by roticv
p would just imply pointer - sz is more intuitive. You can go psz if you want to :). It's a matter of taste anyway.
Posted on 2003-04-23 09:52:51 by f0dder
Haha... My style would be not to use prefix except for handles.
Posted on 2003-04-23 09:55:12 by roticv