Class creation launching another C# exe
CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums
Results 1 to 2 of 2

Thread: Class creation launching another C# exe

  1. #1
    Join Date
    Sep 2009

    Question Class creation launching another C# exe


    I have a .NET forms application that I have created in C#. This forms application is built as an exe and has a set of public interfaces to public classes contained within the exe. Call this exe App1. Question 1: I want all these classes to be non-createable by other .NET applications that call them (similar to the noncreatable attribute in COM). How can I specify this for a .NET C# class?

    I now have another .NET forms application that I created in C# as well. Call this exe App2.

    Now from within App2 I would like to create an object of one of the types of public classes in App1. This I am able to do with no problem. What I would really like this to do is launch the executable when I create the class from App1 in App2, as opposed to just creating an instance of the class. Question 2: How can I do this?

    Background: I am trying to duplicate functionality previously done in a C++ MFC exe with a COM interface. This exe exposed several COM CoClasses, all of which where noncreatable. When an outside application tried to instantiate a new object of one of these COM CoClasses, the exe would actually launch with its associated GUI and message loop and return an interface to that object that was instantiated inside the exe. I would like to replicate this behavior with a C# exe. Unfortunately I am not quite sure how this actually worked in COM, so I really don't know where to start when trying to do this in .NET C#.

    Any help would be appreciated. Thanks in advance.

  2. #2
    Join Date
    Oct 2008

    Re: Class creation launching another C# exe

    Since these two appear to be two different packages, you can declare the constructor as "internal".

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Windows Mobile Development Center

Click Here to Expand Forum to Full Width

On-Demand Webinars (sponsored)