Not sure WHY, but the following code does not compile for me...



.386
.model flat, stdcall
option Casemap:none

include MyProject.inc

.code

start:
invoke GetModuleHandle, NULL
mov hInstance, eax
invoke GetCommandLine

CDTrayProc proc
;Open the CD Tray
.if CDTrayState == 0
invoke mciSendString, CStr("Set cdaudio door open"), NULL, 0, 0
mov CDTrayState, 1 ;Set the CDTrayState to 1 so we know door is open
.else
invoke mciSendString, CStr("Set cdaudio door closed"), NULL, 0, 0
mov CDTrayState, 0 ;Set to zero so we know it is closed
.endif
ret
CDTrayProc endp

end start

Now, I am using RadASM to work with the files and RadASM only reports "Make error (s) occured."

When I try to compile from the command-line, I get the error "MyProject.inc(10) : fatal error A1000: cannot open file : WINDOWS.INC," which is simply too odd for me. Heh, I simply do not understand it... oh and, yes, line 10 in MyProject.inc is "include windows.inc" I do not have this trouble with any other project I have and everything else is compiling fine.

Well, any help on this is, as usual, appreciated very much. :)

Thanks in advance!

P.S.
It is just an app to help me learn to work with mciSendString for a small CD player I want to try and build.
Posted on 2004-08-17 06:25:30 by The Beginner
include masm32includeswindows.inc ?
Posted on 2004-08-17 07:27:24 by JimmyClif
Or better, set up your INCLUDE and LIB paths, and stop using those messy hardcoded paths.
Posted on 2004-08-17 07:48:49 by f0dder
Didn't work.

This is the ONLY program I am having this trouble with. I have tried opening and compiling other programs I have made and they ALL compile fine, with no errors.



<--- Comments Snipped out, but windows.inc is line 10 when you include header comments--->
;#### .INC Includes
include windows.inc
include kernel32.inc
include user32.inc
include advapi32.inc
include winmm.inc

;#### LIB Includes
includelib kernel32.lib
includelib user32.lib
includelib advapi32.lib
includelib winmm.lib

CStr MACRO text:VARARG ;### Real string macro
LOCAL TxtName

.data
TxtName BYTE text, 0
.code

EXITM <offset TxtName>
ENDM

.data
CDTrayState dd 0

.data?
hInstance dd ?

That is what the .INC file currently looks like. It looks like this in all of my other programs and compiles fine in them, but not in this one. The sad thing is that I KNOW it is something incredibly simple that I am overlooking and it will bug me when I find out what it is. =P

Thanks for trying to help anyway. :)
Posted on 2004-08-17 08:16:22 by The Beginner
Have you saved this particular project/asm file in another folder, or on another partition?
Posted on 2004-08-17 08:35:01 by f0dder
Dunno how masm is with that, but maybe windows.inc is called Windows.inc and the case is important?

Is windows.inc there? Is windows.inc named exactly that way?

Cut out the code and start a new project and see if it happens too. Figure out what's different then :)
Posted on 2004-08-17 09:07:38 by JimmyClif
if you "include masm32includewindows.inc", you must have the source file on the same partition as the masm32 install (a reason hardcoded paths == sucky). Case doesn't matter on windows.
Posted on 2004-08-17 10:03:36 by f0dder
Case doesn't matter on windows.


Well, in that case forget about the case checking. :)
Posted on 2004-08-17 10:08:22 by JimmyClif

Have you saved this particular project/asm file in another folder, or on another partition?

No, they are both on the same drive. Just like all my other projects, they are in my ASMProjects directory. But for some reason, this is the only one giving me this trouble.

RadASM Output:
------------------------------------
Assembling: MyProject.asm

Make error(s) occured.
------------------------------------

I just don't understand it. I even tried defining the entire path to windows.inc, but it did not work.
Posted on 2004-08-17 11:50:12 by The Beginner
Very strange... I rebooted and it compiled fine.

Heh, welcome to Windows - May I piss you off today?

Anyway, thanks a bunch guys. I appreciate the effort. :)
Posted on 2004-08-18 16:54:26 by The Beginner