DLL size
-
I have a simple DLL project created in VS2003. I don't use MFC, just plain Windows API. I call only FindWindowEx(), SetWindowsHookEx(), UnhookWindowsHookEx(), SendMessage(), PostMessage() and CallNextHookEx(). I export only two of four functions and use only four global variables. Why my relese DLL is ~50kb?? Is VS2003 adding soe other resources? I have seen some DLL's smaller than mine (10-20kb) - how is it possible?? Well, I actualy don't care about the size of this DLL, I'm just curious what makes it so 'big'??
-
I have a simple DLL project created in VS2003. I don't use MFC, just plain Windows API. I call only FindWindowEx(), SetWindowsHookEx(), UnhookWindowsHookEx(), SendMessage(), PostMessage() and CallNextHookEx(). I export only two of four functions and use only four global variables. Why my relese DLL is ~50kb?? Is VS2003 adding soe other resources? I have seen some DLL's smaller than mine (10-20kb) - how is it possible?? Well, I actualy don't care about the size of this DLL, I'm just curious what makes it so 'big'??
This fascinates most programmers. Your size depends a lot on the compile settings you have. Are you statically linking into ATL? Is it a debug version? Do you have it optimized for speed or size? Are you using exception handling? All these things take up space, personally I think you've linked into the C runtime library statically, so you have /MD Multi-threaded. If you select /MD you'll link dynamically and won't have to have a copy of strcpy and what not in your application. Some people have been known to make their application really small by not using the C runtime and writing or calling the Windows equivalent of all the C runtime functions. Hope this helps, Mark
-
This fascinates most programmers. Your size depends a lot on the compile settings you have. Are you statically linking into ATL? Is it a debug version? Do you have it optimized for speed or size? Are you using exception handling? All these things take up space, personally I think you've linked into the C runtime library statically, so you have /MD Multi-threaded. If you select /MD you'll link dynamically and won't have to have a copy of strcpy and what not in your application. Some people have been known to make their application really small by not using the C runtime and writing or calling the Windows equivalent of all the C runtime functions. Hope this helps, Mark
I'm not using ATL/MFC. I compile with default "Release" settings for the Win32|DLL project template. When I remove ALL my functions and variables (just plain DllMain(){return TRUE;}) I get ~45kb DLL... Maybe that's this /MD switch... I will try to play with this. Thanks for suggestion.
-
I have a simple DLL project created in VS2003. I don't use MFC, just plain Windows API. I call only FindWindowEx(), SetWindowsHookEx(), UnhookWindowsHookEx(), SendMessage(), PostMessage() and CallNextHookEx(). I export only two of four functions and use only four global variables. Why my relese DLL is ~50kb?? Is VS2003 adding soe other resources? I have seen some DLL's smaller than mine (10-20kb) - how is it possible?? Well, I actualy don't care about the size of this DLL, I'm just curious what makes it so 'big'??
"Big"? 50k is pretty good, IMHO. Change your release mode optimization from "optimize for speed" to "optimize for size".
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997
-----
"...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001 -
I have a simple DLL project created in VS2003. I don't use MFC, just plain Windows API. I call only FindWindowEx(), SetWindowsHookEx(), UnhookWindowsHookEx(), SendMessage(), PostMessage() and CallNextHookEx(). I export only two of four functions and use only four global variables. Why my relese DLL is ~50kb?? Is VS2003 adding soe other resources? I have seen some DLL's smaller than mine (10-20kb) - how is it possible?? Well, I actualy don't care about the size of this DLL, I'm just curious what makes it so 'big'??
PatrykDabrowski wrote:
Why my relese DLL is ~50kb??
Read here.
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
-
PatrykDabrowski wrote:
Why my relese DLL is ~50kb??
Read here.
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
I've already read this article. It's interesting but I want to know why this DLL is so 'big' having only couple of functions and variables. I don't care how much memory it would take (adress space, heap etc.) and how to optimize it - I'm just curious what's inside this almost empty DLL. When I remove ALL functions/variables having only DllMain(){return TRUE;} I still get ~45kb DLL....
-
I've already read this article. It's interesting but I want to know why this DLL is so 'big' having only couple of functions and variables. I don't care how much memory it would take (adress space, heap etc.) and how to optimize it - I'm just curious what's inside this almost empty DLL. When I remove ALL functions/variables having only DllMain(){return TRUE;} I still get ~45kb DLL....
PatrykDabrowski wrote:
It's interesting but I want to know why this DLL is so 'big' having only couple of functions and variables.
"So big" in terms of the DLL's size on disk, or some number reported by Task Manager?
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
-
PatrykDabrowski wrote:
It's interesting but I want to know why this DLL is so 'big' having only couple of functions and variables.
"So big" in terms of the DLL's size on disk, or some number reported by Task Manager?
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
I mean the size of my DLL on disk.
-
I have a simple DLL project created in VS2003. I don't use MFC, just plain Windows API. I call only FindWindowEx(), SetWindowsHookEx(), UnhookWindowsHookEx(), SendMessage(), PostMessage() and CallNextHookEx(). I export only two of four functions and use only four global variables. Why my relese DLL is ~50kb?? Is VS2003 adding soe other resources? I have seen some DLL's smaller than mine (10-20kb) - how is it possible?? Well, I actualy don't care about the size of this DLL, I'm just curious what makes it so 'big'??