When I am programming, why is it that my files get several K bigger evey time I include one little win32 api call, isn't most of the work supposed to be contained in my dlls?
Besides using loadlibrary functions, is there other ways of compacking my code?
Besides using loadlibrary functions, is there other ways of compacking my code?
You could use a compression programm like UPX.
Yes but "several KB's for each API call" will be a challenge even for UPX. :grin:
You can squeeze some VB apps to a 10th of their size with UPX ;)
Yes, I know Markus Oberhumer's UPX and the NRV compression that it uses. ;)
I was just joking on the original poster's affirmation that his EXE's grow of "several KB's for each API call" that he includes. :)
I was just joking on the original poster's affirmation that his EXE's grow of "several KB's for each API call" that he includes. :)
zenwaters,
your question lacks logic, if you think about it you will see why. When you call "little" API calls, are you including more lib and inc files to make that api call possible? Or maybe you have to do some parameter setups before calling that API?
When you make an API call, the call itself uses 10's of bytes, *not* 1000's of bytes. If it is using K's of bytes, then you are either doing lots of prepatory work, or you are doing something wrong.....
your question lacks logic, if you think about it you will see why. When you call "little" API calls, are you including more lib and inc files to make that api call possible? Or maybe you have to do some parameter setups before calling that API?
When you make an API call, the call itself uses 10's of bytes, *not* 1000's of bytes. If it is using K's of bytes, then you are either doing lots of prepatory work, or you are doing something wrong.....
Zen,
I agree with Sluggy here, API calls only increase your code size by a few bytes at a time, push/call instruction size etc ....
If you can give us some idea of what you are doing or paste in a small amount of your code, maybe someone can help you track down the problem.
Regards,
hutch@movsd.com
I agree with Sluggy here, API calls only increase your code size by a few bytes at a time, push/call instruction size etc ....
If you can give us some idea of what you are doing or paste in a small amount of your code, maybe someone can help you track down the problem.
Regards,
hutch@movsd.com
Afternoon, zenwaters.
The only way your proggys would increase in size by a few kbs each time you included an API call, is if you were actually using a static lib. Anything from the user32/kernal32/etc32 libs won't increase the size of your proggys dramatically.
I can only think of two ways inwhich your proggy is increasing in size.
1) you are using a static lib (i.e. like d3dx8.lib).
2) You're actually adding buffers/structs in your .data section for use with these APIs.
What're the libs you're including in your proggy? We'd be able to give you a more accurate assessment of what's happening, if we knew;).
Cheers,
Scronty
The only way your proggys would increase in size by a few kbs each time you included an API call, is if you were actually using a static lib. Anything from the user32/kernal32/etc32 libs won't increase the size of your proggys dramatically.
I can only think of two ways inwhich your proggy is increasing in size.
1) you are using a static lib (i.e. like d3dx8.lib).
2) You're actually adding buffers/structs in your .data section for use with these APIs.
What're the libs you're including in your proggy? We'd be able to give you a more accurate assessment of what's happening, if we knew;).
Cheers,
Scronty
My apolgoies all -
I seem to have made a mistake here, sorry... what I thought was happening wasn't when I looked at it a second time.
For some reason I thought when I compiled my PE .exe file it got signifigantly bigger with each .dll call that I added into my source, but that's not the case... I looked at it again, with one api call my .exe was 16k. If I add another, it is still 16k, and another, still 16k.
Sorry for the confusion, thanks for your willingness to help! :alright:
I seem to have made a mistake here, sorry... what I thought was happening wasn't when I looked at it a second time.
For some reason I thought when I compiled my PE .exe file it got signifigantly bigger with each .dll call that I added into my source, but that's not the case... I looked at it again, with one api call my .exe was 16k. If I add another, it is still 16k, and another, still 16k.
Sorry for the confusion, thanks for your willingness to help! :alright:
zen,
If you initial size is 16k, it sounds like you are using one of the C/C++ linkers that is aligned differently, try using the linker from MASM32 that is from the win98ddk, it will drop your file size a lot as it uses alignment suitable for VxD files.
You can also look up the options on a C/C++ linker to change the alignment to get the size down.
Regards,
hutch@movsd.com
If you initial size is 16k, it sounds like you are using one of the C/C++ linkers that is aligned differently, try using the linker from MASM32 that is from the win98ddk, it will drop your file size a lot as it uses alignment suitable for VxD files.
You can also look up the options on a C/C++ linker to change the alignment to get the size down.
Regards,
hutch@movsd.com
I rather think he made the typical "newbie" mistake and used only initialized buffers ;)