The following forum(s) are migrating to a new home on Microsoft Q&A (Preview): Developing Universal Windows apps!

Ask new questions on Microsoft Q&A (Preview).
Interact with existing posts until December 13, 2019, after which content will be closed to all new and existing posts.

Learn More

 none
Sharing Object Between two Runtimecomponent in same project RRS feed

  • Question

  • hi ,

    I wanted to share a object between 2 different runtime component in window phone 8  project . If it is possible .?? 

    Thanks,

    Ravi Ranjan


    rrnjn145

    Tuesday, December 23, 2014 7:37 AM

All replies

  • Yes it's possible.

    Matt Small - Microsoft Escalation Engineer - Forum Moderator
    If my reply answers your question, please mark this post as answered.

    NOTE: If I ask for code, please provide something that I can drop directly into a project and run (including XAML), or an actual application project. I'm trying to help a lot of people, so I don't have time to figure out weird snippets with undefined objects and unknown namespaces.

    Tuesday, December 23, 2014 1:00 PM
  • how it is possible??? can u please give some light on it .

    Thanks


    rrnjn145

    Wednesday, December 24, 2014 6:48 AM
  • You need to give some ideas of what exactly you want to do.

    Matt Small - Microsoft Escalation Engineer - Forum Moderator
    If my reply answers your question, please mark this post as answered.

    NOTE: If I ask for code, please provide something that I can drop directly into a project and run (including XAML), or an actual application project. I'm trying to help a lot of people, so I don't have time to figure out weird snippets with undefined objects and unknown namespaces.

    Friday, December 26, 2014 3:51 PM
  • say, I have two different runtime component in  window phone project . one component say binds socket and other component send /receive the data through same socket . thus, here I need to share SOCKET object between both runtime components.so how to share this SOCKET object between both runtime component.??

    Thanks,


    rrnjn145

    Saturday, December 27, 2014 5:24 AM
  • You need to give some ideas of what exactly you want to do.

    Matt Small - Microsoft Escalation Engineer - Forum Moderator
    If my reply answers your question, please mark this post as answered.

    NOTE: If I ask for code, please provide something that I can drop directly into a project and run (including XAML), or an actual application project. I'm trying to help a lot of people, so I don't have time to figure out weird snippets with undefined objects and unknown namespaces.

    say, I have two different runtime component in  window phone project . one component say binds socket and other component send /receive the data through same socket . thus, here I need to share SOCKET object between both runtime components.so how to share this SOCKET object between both runtime component.??

    Thanks,


    rrnjn145

    Tuesday, December 30, 2014 7:09 AM
  • I don't know why the socket would be shared between two different components, but wouldn't you just pass the socket into components via standard method calls? What you're asking for doesn't make a lot of sense to me.

    Matt Small - Microsoft Escalation Engineer - Forum Moderator
    If my reply answers your question, please mark this post as answered.

    NOTE: If I ask for code, please provide something that I can drop directly into a project and run (including XAML), or an actual application project. I'm trying to help a lot of people, so I don't have time to figure out weird snippets with undefined objects and unknown namespaces.

    Wednesday, December 31, 2014 8:34 PM
  • Hi, 

    Thanks for reply.

    Sharing a Socket object with standard method call is not that easy between the two different Runtime component . it will be require marshalling and de-marshalling , I think.  What my purpose is to map one runtime component over another runtime component? that's why I was asking for if we could share a object between two runtime  component.

    Thanks,


    rrnjn145

    Friday, January 2, 2015 7:37 AM
  • Is this theoretical, or did you try this?  If you tried it, what error are you getting?

    Matt Small - Microsoft Escalation Engineer - Forum Moderator
    If my reply answers your question, please mark this post as answered.

    NOTE: If I ask for code, please provide something that I can drop directly into a project and run (including XAML), or an actual application project. I'm trying to help a lot of people, so I don't have time to figure out weird snippets with undefined objects and unknown namespaces.

    Friday, January 2, 2015 1:46 PM
  • Hi ,

    Right now I am talking theoretical ,My simple work is to access an object of one runtime component from another runtime component ,what you asked me to have simple standard method call .can you please illustrate what you exactly tried to convey ?. I mean how it is possible to pass an object from one runtime component to another runtime component through standard method call . can you give me any example to explain your idea?

    Thanks,


    rrnjn145


    • Edited by RvRnjn Saturday, January 3, 2015 7:00 PM
    Saturday, January 3, 2015 6:59 PM
  • No... I'm not working on theoretical code for you. Write the code and see if it works. Tell us what problems you encounter.


    Matt Small - Microsoft Escalation Engineer - Forum Moderator
    If my reply answers your question, please mark this post as answered.

    NOTE: If I ask for code, please provide something that I can drop directly into a project and run (including XAML), or an actual application project. I'm trying to help a lot of people, so I don't have time to figure out weird snippets with undefined objects and unknown namespaces.

    Monday, January 5, 2015 1:04 PM
  • Hi Matt,

    I tried to  call  another  function of the Runtime from another runtime


    void WindowsPhoneRuntimeComponent1::callback(){

    WindowsPhoneRuntimeComponent2^ s =ref new WindowsPhoneRuntimeComponent2(); s->SocketBinding(); }


    but it is showing me error as ::

    First-chance exception at 0x76F81EDB in HeadlessHost.exe: Microsoft C++ exception: Platform::ClassNotRegisteredException ^ at memory location 0x0327EA1C. HRESULT:0x80040154

    at 

    WindowsPhoneRuntimeComponent2^ s =ref new WindowsPhoneRuntimeComponent2();

    why such thing is happening ??


    rrnjn145


    • Edited by RvRnjn Tuesday, January 6, 2015 11:51 AM
    Tuesday, January 6, 2015 11:37 AM