I Got the INCLUDE File for the MessageBox directly in my Program. So as you see I don't have to use the INCLUDE\user32.inc. i mark it out...

Now I am trying to do the SAME THING with the .LIB File.

I think I got the right .LIB file. It is _MessageBoxA@16 or _MessageBoxA@20

What section do i have to put it....... in the .data----.cont----.data?
and how do I declare it...as equ...DWORD...DB or what.
or do it HAVE to be in a .LIB Module.

::::::::::::::::::::::::::::::::::::::::::::::
:::::::::::::::::::::::::::::::::::::::::::::::
::::::::::::::::::::::::::::::::::::::::::::::::

.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

MessageBoxA PROTO :DWORD,:DWORD,:DWORD,:DWORD

_MessageBoxA@16 dd 0 ....< Posted on 2002-01-13 10:23:07 by cmax
As far as I know if you declare a prototype (like MessageBoxA) and make a reference to this symbol in your prog, MASM automatically defines an "external", in case of stdcall convention it should be _MessageBoxA@16. So if you define such a symbol (possibly in the .data section, lets say "_MessageBoxA16 dword 0") the reference is solved and you dont need the libs (its user32.lib in this case) for linking any more. But you shouldn't expect your program will still work. How is the loader to know now that you want to call a function in a dll? I think you cannot avoid using the libs (and why do you care about that, I wonder?)

japheth
Posted on 2002-01-13 11:18:38 by japheth
Hello japheth

Thanks for the Reply

The word "external" may be the key word i am looking for.

Since early last year i got in my mind to pack everything under one file and have been trying to do it every since.

I trying to learn how to use less API and more Regesters... I think that's what masm32 is really all about.

It's a habit now and to end this task i only have to get the .LIB in somehow if it is possible. Than there may be a way to comply it somehow. There are many people here that got a rotine for everything i think even tho he may never use it.

And also it has taught me how to line things up to make the wierdest things start working. After that happen a couple of times i got hook on packing it all under one file. And it's kind of fun trying to do things in a difference way....Not easy but Very intresting

Thanks Again
Posted on 2002-01-13 20:58:24 by cmax
cmax, you might want to look into using FASM - it doesn't require any external files to build a windows executable - just one asm file is all you need.
Posted on 2002-01-13 21:31:40 by bitRAKE
Three more questions.

Can you Rig NASM to do it?
Can you Rig Masm to do it?
Can you still us M32.lib code with either FASM or NASM?

I just got use to that .lib and know how to use it fairly well now.
Posted on 2002-01-14 03:10:22 by cmax