locked
Pointers into the AppDomain RRS feed

  • Question

  • I am writing a plugin to an application that loads two of my dlls. One is managed and loaded into an AppDomain. The other is unmanaged and loaded with LoadLibrary. I would like to be able to pass a pointer to a struct in the unmanaged dll into the AppDomain into the managed dll from the application's call to the unmanaged dll.
    Is this even possible? The other option is to use a named pipe or memory mapped file to pass data.
    I am able to synchronize the thread in the managed dll to the unmanaged call using a named event.

    Any thoughts?

    Monday, November 30, 2009 1:01 AM

Answers

  • Hello

    I'm not sure that understand the question rightly. Objects in different application domains communicate either by transporting copies of objects across application domain boundaries, or by using a proxy to exchange messages. MarshalByRefObject is the base class for objects that communicate across application domain boundaries by exchanging messages using a proxy. Objects that do not inherit from MarshalByRefObject are implicitly marshal by value. Therefore, if'd like to pass a pointer (IntPtr) value across two domains, the value is copied for you.
    Regards,
    Jialiang Ge
    MSDN Subscriber Support in Forum
    If you have any feedback of our support, please contact msdnmg@microsoft.com.
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.
    Welcome to the All-In-One Code Framework! If you have any feedback, please tell us.
    Monday, November 30, 2009 12:17 PM

All replies

  • Hello

    I'm not sure that understand the question rightly. Objects in different application domains communicate either by transporting copies of objects across application domain boundaries, or by using a proxy to exchange messages. MarshalByRefObject is the base class for objects that communicate across application domain boundaries by exchanging messages using a proxy. Objects that do not inherit from MarshalByRefObject are implicitly marshal by value. Therefore, if'd like to pass a pointer (IntPtr) value across two domains, the value is copied for you.
    Regards,
    Jialiang Ge
    MSDN Subscriber Support in Forum
    If you have any feedback of our support, please contact msdnmg@microsoft.com.
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.
    Welcome to the All-In-One Code Framework! If you have any feedback, please tell us.
    Monday, November 30, 2009 12:17 PM
  • Hello

    How are you? If you have any other questions, please feel free to post here.


    Regards,
    Jialiang Ge
    MSDN Subscriber Support in Forum
    If you have any feedback of our support, please contact msdnmg@microsoft.com.
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.
    Welcome to the All-In-One Code Framework! If you have any feedback, please tell us.
    Monday, December 7, 2009 3:15 AM