CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Page 2 of 2 FirstFirst 12
Results 16 to 21 of 21
  1. #16
    Join Date
    May 2007
    Posts
    1,546

    Re: reference to classes in another namespace

    What it sounds like you're trying to describe is a normal plugin like system where arbitrary third party libraries can be loaded by your program and executed. Is this the case? If so, how does the main application know what to load in the third party library? Is there a specific interface/class which the third party library must implement?
    Can you answer those questions? Otherwise my answer is: It's impossible, you may as well give up now.
    www.monotorrent.com For all your .NET bittorrent needs

    NOTE: My code snippets are just snippets. They demonstrate an idea which can be adapted by you to solve your problem. They are not 100% complete and fully functional solutions equipped with error handling.

  2. #17
    Join Date
    Oct 2009
    Posts
    16

    Re: reference to classes in another namespace

    I must do a terrible job of explaining or I don't get it

    What it sounds like you're trying to describe is a normal plugin like system where arbitrary third party libraries can be loaded by your program and executed. Is this the case? If so, how does the main application know what to load in the third party library? Is there a specific interface/class which the third party library must implement?
    The main application is the dynamically created namespace which is created after changes in my scripts that will part of the main application. My scripts in the main application obviously can access the classes in the 2nd namespace I am working on as the main application can load other class libraries. So I can pass a reference of the dynamically generated assembly.

    The third party software I was referring at in the beginning is the main application.

    So the question is can I use instances of a class in my script in the main application from my own class library as per the code example in my previous post?
    Last edited by safra; December 1st, 2009 at 05:21 AM.

  3. #18
    Join Date
    May 2007
    Posts
    1,546

    Re: reference to classes in another namespace

    I must do a terrible job of explaining or I don't get it
    Possibly the latter

    It's impossible to instantiate an arbitrary class from an arbitrary assembly and do something useful with it. That's true for every programming language and set of libraries. What you are describing just does not make any sense whatsoever.

    Code:
    public class X
    {
        void A ();
        int B ();
        bool C ();
        X D ();
        R Q ();
    }
    Tell me what the above class does and then use it to do something useful. Based on your explanation, this is what you're trying to do. As you can imagine, if you can't tell me what the above class does then how could a program figure it out and use it.

    So if you can't answer the questions in my last post, it's impossible and you'll have to completely redesign your system.
    www.monotorrent.com For all your .NET bittorrent needs

    NOTE: My code snippets are just snippets. They demonstrate an idea which can be adapted by you to solve your problem. They are not 100% complete and fully functional solutions equipped with error handling.

  4. #19
    Arjay's Avatar
    Arjay is offline Moderator / EX MS MVP Power Poster
    Join Date
    Aug 2004
    Posts
    13,490

    Re: reference to classes in another namespace

    What 3rd party software are you using? Is there online documentation for us to look at?

  5. #20
    Join Date
    Oct 2009
    Posts
    16

    Re: reference to classes in another namespace

    Quote Originally Posted by Mutant_Fruit View Post
    Possibly the latter
    Probably both!

    This is about www.unity3d.com. They have a free version. We are about to outsource some work that uses custom editor scripts we made. We don't want to make it too easy to access the source of the scripts so we like to put as much as possible in another class library.

    I doubt whether you will find info about all of this in the documentation though! The software allows you to drag scripts (a specific class) on 3d objects to control their behaviour. These are the instances I need access too. Unfortunately it is not possible to attach scripts from another class library to these objects.

  6. #21
    Join Date
    May 2007
    Posts
    1,546

    Re: reference to classes in another namespace

    Unity is pretty well documented so definitely check there first. If it's not mentioned in their docs, check the unit scripts wiki and finally you could post on their forums. If you can't get the info there then no-one knows the answer

    This is probably what you're looking for: http://www.unifycommunity.com/wiki/i...tle=Extensions
    www.monotorrent.com For all your .NET bittorrent needs

    NOTE: My code snippets are just snippets. They demonstrate an idea which can be adapted by you to solve your problem. They are not 100% complete and fully functional solutions equipped with error handling.

Page 2 of 2 FirstFirst 12

Posting Permissions

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





Click Here to Expand Forum to Full Width

Featured