News:

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

Main Menu

A question about windows

Started by RuiLoureiro, February 15, 2013, 04:29:01 AM

Previous topic - Next topic

RuiLoureiro

Dave,

«i don't know if these are "problems" it may be the way you intended it to be»

    .   Yes it is to test, to see what happen in each case


«also - the program is 230 kb»

    .   I dont know why. Maybe this has something to do with the inclusion
        of my lib, no ?

RuiLoureiro

Dave,
        The problem (of 230K) is with my lib.
       
        The masm assembler put all things
        that belong to my lib into the
        previous Overlapped.exe files.
       
        I would like to know why if
        it needs only one file or so ?
        Is there no way to avoid it ?

        Here is Overlapped12 10K bytes.

        Now i want to put a green button.
        Do you know how to do that ?
        Thanks !

qWord

Quote from: RuiLoureiro on February 23, 2013, 05:16:10 AMIs there no way to avoid it ?
there is a way: put everything in separate modules, whereas procedures/functions and variables that have a direct dependency can be place in one module (e.g. function A call function B -> A and B could be in the same module*)

EDIT: *as long as B private for that module.
MREAL macros - when you need floating point arithmetic while assembling!

dedndave

setting the background color on buttons can be a pain in the butt   :P
the easiest way might be to set a green image into the button

as for the library....
yes - everything in seperate modules, as qWord said
but, there is more at play than that
your library module(s) have large arrays of uninitialized data or something that are declared in the .DATA section
they should be moved to the .DATA? section
we can't really say, because  we don't have the source   :P

i know your lib has a lot of code
and it has a lot of text strings in it (probably the biggest thing)
but, i would guess it should be under 50 kb or so

RuiLoureiro

qWord,
        Thanks !
        You should know that my lib is a set of asm files
        something like this: Cnv0.asm, Cnv1.asm, Cnv2.asm,
        Win0.asm, Win1.asm, Msg.asm, Prn0.asm, Prn1.asm,
        Fic2.asm, FicIo.asm, FicLis.asm, Fnt.asm, etc. etc. etc.       
        This is compiled to Mylib.lib (now 660K only).
        Each file has its externdef/protos in files .glb
        (Cnv0.glb, etc. etc.).
       
        In Overlapped9.exe i used Mylib.lib and i included
        only Win1.glb and i got 230K. I copy/paste Win1.asm
        into Overlapped12 and i got 10K !
        Why 230K in this case ?

        Well when i work in a large project i need nearly all
        Mylib.lib or so. And nowadays memory is not a problem
        to run it.

Dave,
        «your library module(s) have large arrays of uninitialized data»
       
        .   I cannot define arrays of uninitialized data because
            all my arrays have a structure behind like all my strings,
            tables, etc.
       
        Now Overlapped12.zip is .exe and .asm.

dedndave

i am guessing that the object modules are not seperate, though
when you build the library, you should be adding numerous small OBJ's

on the other hand, you may intend to use the entire library when you make your calculator program
if that's the case, it will work, as is
but - not very nice if you want to use a specific module elsewhere

the source we needed to see was for the lib code - not the GUI   :P
you probably don't want to give that up, yet
but - you'll figure it out   :t

RuiLoureiro

Dave,
          the calculator program doesnt use any file of mylib
          and doesnt use mylib.lib. It was written as a standalone,
          procedure by procedure. And what is in that program is
          not in any file of mylib and is not in mylib.lib. 
          It is in a separate lib ;)

dedndave

ok - my mistake - it is something else
the fact remains that the library probably requires a little re-organization   :P

dedndave

hey, Rui - i just happened to think....
if you look at how Hutch builds the masm32.lib,
in the \masm32\m32lib folder, you will find a file named make.bat
it shows how he creates a response file to build the lib

RuiLoureiro

Dave,
        i am using the same as make.bat in m32lib folder

Is this:

@echo off
cls
del    MyLib.lib
dir /b *.asm > ml.rsp : create a response file for ML.EXE
echo.
echo    *******************************************
echo    ** Assembling MyLib.lib library modules **
echo    *******************************************
echo.
:\masm32\bin\ml /c /coff MyLib.asm
:dir  *.obj

\masm32\bin\ml /c /coff @ml.rsp
if errorlevel 0 goto okml

del ml.rsp
echo ASSEMBLY ERROR BUILDING LIBRARY MODULES
goto theend

:okml
echo.
echo    ********************************
echo    ****** Linking MyLib.lib *******
echo    ********************************
echo.

\masm32\bin\link -lib *.obj /out:MyLib.lib

if exist MyLib.lib goto theend

echo ---------------------------------
echo LINK ERROR BUILDING LIBRARY
echo ---------------------------------

:theend
if exist MyLib.lib del *.obj

dir *.lib
pause