|
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
|
|
|
|
|
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.
|
|
|
|
|
"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
|
|
|
|
|
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....
|
|
|
|
|
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.
|
|
|
|
|
Probably because you are statically linking to the C Runtime. There is an option there somewhere to not do that - so that it dynamically links.
Jon Humphreys
ActivePlanet Software
|
|
|
|
|
hi
i have to add some functionality in an already exsisting application which was made in VC++ 6. But the problem i am facing is, due to some setting in the already exsisting project, i am not able to see all methods/classess/objects in the intellisence. I can only see the project level classess/methods/objects. As i am a bigineer i am finding it difficult to program .. pls help
vikram
|
|
|
|
|
Deleting .ncb and rebuilding project solves problem sometimes.
|
|
|
|
|
thanks mate it .... worked...
vikram
|
|
|
|
|
Hi to all,
I have developed an exe in VC++ 2005 in Debug mode.
When I try to run it on other PC with having .Net installed alongwith all it's required dll's; It show an Error message "Falied to initialize the
exe.... Re-installing it may solve the problem."
Same error occurs for Release mode exe also, even I have installed "Visual C++ Redistributive dll" using 'vcredist_x86.exe'.
But when I install the 'Visual C++ Static Multi-Threaded CRT Libraries' OR 'Visaul C++ Dynamic CRT Libraries' from Visual Studio 2005 Setup CD, (on other PC) , my application runs properly but Visual Studio 2005 IDE is also get installed on other PC?
I have search from Google for solution, but in almost all site there are suggesting to run 'vcredist_x86.exe'.
I also tried to run my application by setting 'Émbed Manifest' property in code as 'No'. But them application fails to run PC having .Net installed.
Please Guide Me...
|
|
|
|
|
Installing the runtime dlls via vcredist_x86.exe will install and register all the runtime dlls on the target machine. With these dlls installed VC8 release build applications can be run on the target machine.
Are you linking to some other nonstandard dlls? Have you used the dependancy walker (depends.exe) to see which dlls the application is being linked to and comparing that list to which ones are missing from the target machine?
You may be right I may be crazy -- Billy Joel --
Within you lies the power for good, use it!!!
|
|
|
|
|
Hi!
I've got some cpp/h-files that I want to put into a MS VS .NET 2003 project so I can step through the program.
When I try to build I get strange errors and because of this I would rather want to build the project from the settings of the makefile that came along with the source files. This makefile is called "makefile" with no extension.
How do I make project from a file like this??
|
|
|
|
|
Hello all -
I need to implement a full featured auto complete combo box just like what it is in internet explorer. Thanks to a lot of help available on codeproject, I implemented the basic features. But there is one bug which is driving me mad.
The details:
I have handled CBN_EDITCHANGE message here. and I let it be handled by the parent also using the ON_CONTROL_REFLECT_EX method.
The idea is that I store the original combo entries in a vector. When user types in something, on edit change, I get the string, if it matches, I modify the comob entries with the search entries found (As i already have the original combo entries with me)
and then call the drop down method to show the search strings.
When user closes the dropdown or expands it, I restore the original state of the combo box. similarly when the search string is empty, i restore the state again.
Everything works fine, but when the dropdown is closed, and I try to enter a string, the combo box selects the first matched string in the combo (Which I do not want)
Whereas if I expand the combo box, the string is not selected.
I Guess this is too much. But still I hope someone has the answer.
Thanks in advance
Be the change you wish to see...
|
|
|
|
|
It seems more information is needed in order to answer this, since there is no specific question. You want to know why your code doesn't work but you haven't given us all the information required to answer it. Perhaps showing the code that is relevant will help us catch something.
|
|
|
|
|
Actually i am using ShellExecuteEx function in an Embeded VC++(MFC Based) to run other application whose window get minimized at startup.
i am trying to retrieve handle to an minimize application .Is there any function to do so ? I want to maximize this application by using ShowWindow(hwnd,SW_SHOW) function.
priyank
Software developer
Cyber G India Pvt Ltd.
priyank
|
|
|
|
|
You can use EnumWindow function (see MSDN). This way you'll get handles of all toplevel windows from your system. Now if you know some properties of the window you want to maximize(ex. windows name), you can easy find and maximize it.
|
|
|
|
|
|
Instead of using ShellExecute , use CreateProcess . You can then eaisly get a handle to the app you executed.
"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
|
|
|
|
|
|
SHELLEXECUTEINFO structure contains a member variable hProcess contains a handle to the new started process, but you mast set fmask to SEE_MASK_NOCLOSEPROCESS. and it will be NULL if no process launched.
Hope this help you.
Programmer/ Eid Mahmoud Taha
|
|
|
|
|
|
pri_skit wrote: Actually i am using ShellExecuteEx function...
Can you use ShellExecuteEx() instead?
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|