Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Calling WINAPI functions inside a DLL

Status
Not open for further replies.

tntcoder

Programmer
Dec 10, 2005
6
GB
Hi,

Im trying to call functions from inside a DLL, im trying to call MessageBoxA at the moment (user32.dll), but i want to be able to call custom functions from my own C++ DLL.

Please could someone give me an example of how to define the function? I think i have to use 'extern' and 'include' but i have no idea how to use them correctly. Im using MASM 615, it has a WIN.INC and a user32.lib file if i need them? In terms of calling the function am i correct in thinking this is correct:

Code:
push 0
push offset msgtitle
push offset messagetext
push 0
call MessageBox

Also would i need any extra linking options?

Thanks
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top