A while back, I asked a question on here about how to run an application as a thread in the memory space of another application, rather then a new process: http://stackoverflow.com/questions/3169234/executing-a-program-as-a-thread-and-not-as-a-process
As a follow up to that question, I think I have a theory on how I might do this to acheive what it is I'm trying to do. First off, let me say, the reason I am doing this is because I am trying to create a test bed application that can "test" other applications, but control them so if they get an exception, my test bed application can end the thread and restrart it automatically.
My theory on how to do this is to create an interface, called ITestBed for example and have the main class in my application implement this. The implementation will contain one method, TestApp(), for example. All I need to do from my test bed application is call this method and this method on the application side can just mirror the constructor of my current object? Will this work?
Essentially, what I am trying to do is mimmick how Visual Studio works. If you set a break point in your program, hit to run your application in Visual Studio, your application is running as a child of the Visual Studio application. To test this, you could end the visual studio application and your application will also end. How can I acheive this?