   [.net] External program API
  Hi!Does anybody know of any good tutorials on programming an API for a .NET application? I would like to make it possible to access a program object, and thereby have direct control of the program. Any suggestions?-Thanks in advance   
  Maybe the word '.NET assembly' is what you are looking for?   ;  Oh... sorry... I was a bit tired when I wrote the message.. what I meant was an external API to control the program like for instance photoshop has. I would like to have a couple of functions that gives you access to the application object from other programs.   ;  Just expose the application object (whatever you mean by that) as a public property of something (something static maybe?). Then any application that can use your assembly can access it. I don't quite know what you mean by 'have direct control of the program', but a standard .Net library is usable from other programs with nothing special.   ;  Hmm... ok... I'll try to explain a bit better: I have two different projects. One that contains a gui application, and one command line tool that makes it possible to manipulate the first program while it's running. I want the command line tool as well as any other program that includes an API assembly to be able to communicate with the instances of the gui program.I expect the usage to look a bit like this:foreach (GuiApplication app in GuiApplication.RunningInstances){   app.PerformSomeAction();};  may be a better way but you could always just write a little server in the main app.  Then write a little API that communicates with the main app's server via sockets.  The little API would have hooks for sending appropriately formatted data streams to the main app's server which would then execute them within the main app.  Likewise you could have method calls which would query for info from the main app such as getting a list of objects and such.-me   ;  Palidine: That might be a solution, but It's a bit hack-ish. I was hoping there's a way to retrieve managed objects from a running program, but there's perhaps no simple way?   ;  I wrote a little article on Plugin Interfaces in .NET a little while ago that covers how to implement a plugin archatecture into a .NET environment.  In this case, your GUI application would be a plugin to the main console application.  When you write a command into the console, you could call a function in the GUI Application (IPlugin).   ;  Have your GUI application expose an interface via remoting. Then your application can be accessed like this:IApplication app = (IApplication)Activator.GetObject(typeof(IApplication), "tcp://localhost:1234/Application");app.DoStuff();;  Rob Loach:I've done something similar, but the problem with this approach is that the gui part of the program is dependent on the console part, which is undesirable in my situation, since I consider the console part to be an external tool.Arild Fines:Now that seems interesting.. Could you elaborate on how it works?   