locked
updating UI from a Win32 component

    Question

  • Assuming there is some data being returned back to WinRT from a Win32 component. Is there a way to use that data in a WinRT control ?
    Tuesday, March 25, 2014 1:32 AM

All replies

  • If the Win32 component is WinRT compatible, you can use it in your project.

    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, March 25, 2014 12:19 PM
    Moderator
  • Thank you..How would i able to use an object  of a page class that i've declared elsewhere in a different class especially in WinRT world ?
    Tuesday, March 25, 2014 12:43 PM
  • Reference the DLL, declare the object, use it.  You'll have to be more specific if you want a better answer.

    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, March 25, 2014 12:47 PM
    Moderator
  • Okay, lets say my app has got couple of pages, mainpage.xaml and scenariopage.xaml.

    auto mainpageobj = ref new class mainpage();

    now, if i want to reuse the same object (mainpageobj) in a different class or in a different page, how would i be able to do that ?

    Tuesday, March 25, 2014 12:50 PM
  • One of two ways:
    1) Create it as a static object in App.Xaml.cs, then refer to it as App.mainpageobj:

    public static mainpage mainpageobj = new mainpage();

    2) Create it in one page, then pass it into another page as a parameter.  The only thing about that is that it must be serializable to do this.


    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, March 25, 2014 5:45 PM
    Moderator
  • Would you please let me know how to make it serializable to achieve this ? I'm a beginner here.
    Tuesday, March 25, 2014 6:02 PM
  • Also I'm unable to use this in C++

    public static mainpage^ mainpageobj; (in header) -- throws an error

    I declared it as static mainpage^ mainpageobj;

    and then called it in the cpp file. But i believe its not allowing me to declare my object in that format


    Tuesday, March 25, 2014 6:17 PM
  • If you're calling it from a C# app, declare the object as static in the C# app, not the C++ component.

    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, March 26, 2014 2:19 AM
    Moderator
  • My App is written in C++.Can you please help me with that ?
    Wednesday, March 26, 2014 8:51 AM
  • Do you realize you wrote this in the C# forum?

    Windows Store apps forums                               >             


    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, March 26, 2014 12:34 PM
    Moderator
  • Sorry missed that..I'll move it over..Thanks for the help.
    Wednesday, March 26, 2014 12:51 PM