Application Architecture
-
I've been trying to architect an application that will expose an object model similar to MS Office Applications. It will have a Top-level Application Object and some Document objects. I've been at this for nearly a week now and I have discarded everything I've tried. Any suggestions??
-
I've been trying to architect an application that will expose an object model similar to MS Office Applications. It will have a Top-level Application Object and some Document objects. I've been at this for nearly a week now and I have discarded everything I've tried. Any suggestions??
Break it down into sections. What you want to expose, what you need to expose. Then sub group them into objects and collections. Then you pretty much have your DOM you just have to supply the methods, properties, and abilities you want them to do and have them interact with your application. Cheers, -Erik
-
Break it down into sections. What you want to expose, what you need to expose. Then sub group them into objects and collections. Then you pretty much have your DOM you just have to supply the methods, properties, and abilities you want them to do and have them interact with your application. Cheers, -Erik
This is what I'vd got so far.
public sub main() dim app as new App app.run end sub public class App private frm as new system.windows.forms.form private mDocs as new DocumentCollection 'Documents Collection public sub Run() application.run(frm) end sub end class public class DocumentCollection inherits CollectionBase 'Omitted for brevity, Normal CollectionBase implementation end class
Question is: How do I get the currently running instance of the App Class from another application? I would like to be able to allow other applications to get my App Object through calls like GetObject(,"Excel.Application") returns the currently running instance of an Excel.Application Object. Is there a .NET method similar to VB'6 GetObject? Is there also a .NET Method similar to RegisterActiveObject? Thanks.:) -
This is what I'vd got so far.
public sub main() dim app as new App app.run end sub public class App private frm as new system.windows.forms.form private mDocs as new DocumentCollection 'Documents Collection public sub Run() application.run(frm) end sub end class public class DocumentCollection inherits CollectionBase 'Omitted for brevity, Normal CollectionBase implementation end class
Question is: How do I get the currently running instance of the App Class from another application? I would like to be able to allow other applications to get my App Object through calls like GetObject(,"Excel.Application") returns the currently running instance of an Excel.Application Object. Is there a .NET method similar to VB'6 GetObject? Is there also a .NET Method similar to RegisterActiveObject? Thanks.:)I don't know of any .NET BCL method that does this, but you can put your main application class into the ROT (Running Object Table) using the COM RegisterActiveObject() method as you mentioned. This is what a BCL registration method would do if there was one.