Saturday, May 22, 2010

Confused with .dll files?

Just need some knowledge on .dll files. Can I lock multipul files into a .dll or only c++ source code files or what? Help, please.

Confused with .dll files?
you got your answer for "someone else editing my source files".





the answer to "someone else READING (and therefore getting a chance to copy) my source file" is to make a library out of it. a standard C/C++ library (whatever that is in Windows) and not a .dll.





thanks!
Reply:I am confused as to why you feel the need to get into .dll files?


Normally, these are files that are part of the cab files and, one shouldn't ever mess around with them. Your needs may be different ....I just wouldn't give the average computer user the impression they can or should "mess" around with these files.


I am sure you know that a huge amount of errors messages relate to missing .dll files..


Good Luck~
Reply:Dll's are dynamically loaded shared objects that can be used by different executables. The code is relocatable and does not rely on a fixed memory offset when loading.





You can use multiple files and compile them into a single dll.





Unless you are planning to share the dll between multiple executables there should be no need to use it.





Just change you file permissions so that no one else can modify the source code.
Reply:I once saw an interview question that asked "What is the difference between an EXE and a DLL?" The correct answer was "The first four bytes".





EXEs and DLLs are basically identical, but in practice an EXE is executed as an application while a DLL is not. A DLL does, however, contain an entry point function and it also holds both code and data in the same way that an EXE does. At the very low level there are some minor implementation details....when a DLL is loaded it's given it's own data segment that is different to that of the calling EXE, and that has to be taken into account when the EXE is accessing the DLLs data, and vice-versa.





The broad answer to you question though is that when multiple EXEs share common code, then that code is placed in a DLL. It could, theoretically, be placed in another EXE which the other two EXEs call, but protocol dictates that you use a DLL.
Reply:Dll files are similar to exe files in many ways. Most of them contain executable machine code. The difference is that you can't run a dll, the code is there for other programs to use.





Things like printer drivers are dlls. This allows you to change the driver (or printer) without affecting the programs that use it.





Dlls can also hold almost any sort of data, text, pictures, icons, sound or whatever. They are stored as program resources so that other programs or windows can use them.





For example, there is a dll in the windows\system32 directory called moricons.dll which just contains icons.





You could put your source code into a dll (as text resources) though I cant see why you would want to.


No comments:

Post a Comment