My problem:

MASM nor WinAsm will compile my code. It begins compiling, then halts; no errors or anything. I dont understand why, I've had a few friends look over my code for errors but there were none. And with MASM, it wont compile unless I put the .asm file with the includes [ \include\ ] And I found that strange.  The MASM command I used was the " ml /c blah.asm " command.


.386
.model flat, stdcall
option casemap:none

include windows.inc
include user32.inc
include kernel32.inc
includelib user32.lib
includelib kernel32.lib

.code

DLLEntry proc hInstDLL:DWORD, reason:DWORD, unused:DWORD
mov eax,TRUE
Ret
DLLEntry EndP

_ExpFunc1 proc
mov eax,7c800000h
Ret
_ExpFunc1 EndP

end DLLEntry
Posted on 2007-01-03 15:51:12 by asdfcross
You need to either set your INCLUDE environment variable, or use the /I switch with ml.exe - good to see you're not using hardcoded paths!

Doesn't masm give any error output at all? Sounds like something's botched on your machine then...
Posted on 2007-01-03 17:06:55 by f0dder
Here's the error I get...


Now see, if I put my .asm and .def file into the include folder, it'll start assembling.. but watch...
Posted on 2007-01-03 17:30:07 by asdfcross
You don't need to put your stuff in the include folder - as I wrote, use INCLUDE environment variable or /I switch to masm.

the /c switch means "assembly only", after that you'll have to LINK manually. For link, you need to set the LIB environment variable, or the /LIBPATH argument to link.exe.
Posted on 2007-01-03 17:36:09 by f0dder
Okay exactly how do I set the INCLUDE enviroment variable, and for future references if you dont mind telling me the same for LIB. Just so you know, yeah, I'm just starting with asm & I appreciate your help.
Posted on 2007-01-03 17:41:27 by asdfcross
You can either do "set INCLUDE=your_path_here" (and similar for LIB) every time you open a cmd.exe, you can put them in a batch file so you only have to run that, or you can add to your global environment - press <win>+<pause/break>, "advanced" tab, "environment variables" button, and then you can add to either your User or System variables.
Posted on 2007-01-03 17:44:44 by f0dder
Must be something else wrong, cause I did what you said word per word... and it started fine.. but it did like the last picture I shown did.. started compiling, then just out of no where halts.. and theres no .obj file or the .dll and it truely confuses me..
Posted on 2007-01-03 17:54:49 by asdfcross
No .obj file neither in c:\masm32\bin nor c:\masm32\include ?
Posted on 2007-01-03 18:07:27 by f0dder
Not a thing. And now its starting to bother me since you said something might be botched in my pc...
Posted on 2007-01-03 18:16:21 by asdfcross
create a new folder anywhere

save (DLL Source) you posted in the first post in yourdll.asm

create a go.bat file with this content:

c:\Masm32\bin\Ml.exe /c /coff /I"c:\Masm32\include" "yourdll.asm"
c:\Masm32\bin\Link.exe /SUBSYSTEM:WINDOWS /DLL /DEF:"yourdll.def" /LIBPATH:"c:\Masm32\lib" "yourdll.obj"


save to yourdll.def
LIBRARY yourdll
EXPORTS _ExpFunc1


run go.bat, all ok?



now the comments:
- /coff switch should be passed for ml v6.14 (for ml v6.15 and above coff is default)
- it's a good practice to quote the path
- remember not to put the final backslash when writing the path
Posted on 2007-01-03 18:56:40 by drizz
Thanks alot dude, that made the difference, and thanks to f0dder for helping me set the variables aswell. :) I really do appreciate this guys, now maybe next time i wont have this problem T_T;; Lol :)

Later
-DanCROSS
Posted on 2007-01-03 19:11:47 by asdfcross