views:

105

answers:

2

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
A: 
David
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
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
I was talking about managed .NET code, sorry for not mentioning it at first.
Shimmy