News:

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

Main Menu

Creating .dlls in masm32

Started by Anaryl, April 01, 2016, 05:43:41 PM

Previous topic - Next topic

Anaryl

Hey there

Having some trouble with creating .dll files in masm

http://www.programminghorizon.com/win32assembly/tut17.html

This is the tutorial I've been doing this afternoon. So I kind of blithely expect that maybe it would just handle the dll creation after linking the .def to skeleton - but it didn't create a .dll at all. So I tried from thereout to use the command link /DLL /SUBSYSTEM:WINDOWS /DEF:DLLSkeleton.def /LIBPATH:c:\masm32\lib DLLSkeleton.obj (although the workspace path is a:\masm32\workspace\tut17) but running link from the command line just returned 'no obj files specified, libraries used instead lnk4001, machine not specificed and not outputfile specified.

So the tute doesnt seem quite specific on how it intends for me to create the dlls. THe code compiles okay but simply does do anything, nor is there a /dll to read from.

Any help would be greatly appreciated.

P.s i did read the other thread a couple of pages in about this but it didnt seem to provide any real clues apart from something about polink.

jj2007

Quote from: Anaryl on April 01, 2016, 05:43:41 PMP.s i did read the other thread a couple of pages in about this but it didnt seem to provide any real clues apart from something about polink.

Yeah, that thread was a bit confused. Or do you mean that one? Try your luck again, see attachment. Two words have been added to the asm source, using the solution of Vortex.

Anaryl

So I added that to my dllskeleton.asm and that went ahead and created .lib file - so where from here do i go to create the .dll? The useDll exe still shows no library.

;--------------------------------------------------------------------------------------
;                           DLLSkeleton.asm
;--------------------------------------------------------------------------------------
.386
.model flat,stdcall
option casemap:none
include \masm32\include\windows.inc
include \masm32\include\user32.inc
include \masm32\include\kernel32.inc
includelib \masm32\lib\user32.lib
includelib \masm32\lib\kernel32.lib

.data
.code
DllEntry proc hInstDLL:HINSTANCE,reason:DWORD,reserved1:DWORD
        mov eax,TRUE
        ret
DllEntry Endp

;---------------------------------------------------------------------------------------------------
;                                                This is a dummy function
; It does nothing. I put it here to show where you can insert  functions into
; a DLL.
;----------------------------------------------------------------------------------------------------

TestFunction proc syscall export
    ret
TestFunction endp

End DllEntry

jj2007

Quote from: Anaryl on April 01, 2016, 06:56:24 PMso where from here do i go to create the .dll?

Did you study and use the batch file in the archive attached above?


hutch--

 :biggrin:

Have you every bothered to look at the menus in the MASM32 editor ? Under "Code" you have a category "Create New DLL". Follow the option and you will create a basic DLL that you can add what you need to it.