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!

Building a DLL with ASM 1

Status
Not open for further replies.

Pavlo

Instructor
Apr 25, 2001
106
0
0
RU
Greetinx!

I want to compile and link a DLL with clean ASM.
How can i put some function to DLL export section?
PUBLIC publics it for local external function only.

Thanks! Happy programming!))
 
You need to have a definition file like this:
Code:
LIBRARY mhook2
EXPORTS 
MouseProc
InstallHook
UninstallHook
TrackMouseLeave

MouseProc, InstallHook, UninstallHook and TrackMouseLeave are the functions you want to make available to other programs.

Then you link this (assuming you use Hutch's MASM32):
Code:
\masm32\bin\Link /SECTION:.bss,S  /DLL /DEF:mhook2.def /SUBSYSTEM:WINDOWS /LIBPATH:\masm32\lib dllfile.obj

where dllfile is the filename of the dll. It will also create an import library with a lib extension which allows your source files to treat the dll as a lib.

You can get more info at win32asmboard.cjb.net but make sure you try to use the 'search' button at the upper left of each page, if you don't the people there might ask you to do that anyway. Or try win32asm.cjb.net specifically Iczelion's Tutorial 24 for more info on DLL's.
"Information has a tendency to be free. Which means someone will always tell you something you don't want to know."
 
Greatfully Thanx!

And one question yet.
Where can i find in internet assemby tuturial i.e full description of directive set?
Happy programming!))
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top