Let's say I had a program (if you're wondering, I'm thinking about the pseudo-OS project I am going to play about with). The way I plan to write it is that there will be a bunch of "commands" written specifically for it that other modules (separate programs written into it) would be able to use themselves. These commands will be stored in DLLs as functions and declared/called when needed.

However, I am thinking about making it so that each "application" within the OS is actually a DLL file so people don't *have* to have everything loaded at once.

My first question is this: Can I have a DLL (application) loaded dynamically just by giving a command or function (something actually already in VB) to load (for instance) "dllaps1.dll" into program memory? Would I be able to write a DLL that was basically a program (with a form/forms, possibly?) in its own right and which could be loaded into the OS dynamically or is this too much work?

My second question: If, for instance, I was running text.exe (a text editor) and that called for an encrypt function in another DLL, would that DLL's data be exclusive to the calling DLL (text.exe) or would it be shared? What I am thinking is if I were using multiple programs using the same DLL file would they be interfering with each other? This is a possibility as some functions would be used often...I am trying to write it so that the functions provided in the DLL enhance the experience of using the actual OS and programming in it :-)