If I put all my controls inside the EXE, is it accessible from outside like it would be accessible when it's placed in a DLL?
A:
So, the thing you're after is this notion of exporting symbols typically, unless you do something explicit, the symbols are not exported when you compile an exe in Windows. Now, if you're talking about .NET then the issue is a little different. However, I notice you tagged this with security; I wouldn't rely on this fact for security purposes. Code injection and so forth attacks are a little more sophisticated than that.
BobbyShaftoe
2009-10-18 02:44:34
A:
David
2009-10-18 02:52:17
Your third paragraph makes no sense to me. A DLL and an "executable" are both PE files on modern Windows with the ability to export symbols or not to. In either case you still need to export symbols explicitly if you want them to be "visible" to another user of your PE file. Or, exported or not, you can resolve the symbol yourself (instead of using `GetProcAddress` on an exported on) and execute the code. I think you're making a distiction between DLLs and "executables" that simply isn't there.
mrduclaw
2009-10-18 03:03:19
Good point. It seems to me, though, that the *purpose* of an EXE (as opposed to a DLL) is more in line with what the OP wants, if he's looking to make the symbols inaccessible. If you can provide some examples of reasons to export symbols in a deployed EXE, this would seem to answer the OP's question better. (I would try myself, but I'm not a Windows programmer, and so would probably miss out the intricacies of the way MS have decided to do it ;-)
David
2009-10-18 03:22:23
I was talking about managed .NET code, sorry for not mentioning it at first.
Shimmy
2009-10-18 17:06:45