locked
How can I use WinRT Component DLL in another DLL project

    Question

  • Dear Sir,
      When I create a new project with type "WinRT Component DLL", I can create the .DLL and .winmd files and use them by "add reference" in javascript project. 
      But if I want to use them in another WinRT Component DLL project, how can I use them?
      Is there any sample code?  Thanks.
    Chik
    Monday, January 9, 2012 5:56 AM

Answers

  • Hi Chik,

    Accessing a WinRT .winmd component from WRL is a known limitation in the Developer Preview. We are investigating ways to provide this functionality. Thanks for letting us know as it's helpful to hear someone has a need for that functionality.

     

    Thanks,

    -David

    • Marked as answer by ChikC Friday, January 13, 2012 1:25 AM
    Thursday, January 12, 2012 10:04 PM
    Moderator

All replies

  • Try using this type of reference to the WinRT component:

    #using "C:\3rdPartyWinrt\CustomWinRTDll.winmd"
    using namespace CustomWinRTDll;
    

    Thanks,

    -David

     

    Wednesday, January 11, 2012 12:41 AM
    Moderator
  • Hi David,
    Thanks for your help. It seems work in some cases, and I found that "WinRT DLL Component" project also have refenence option (right click on the project name in solution explorer).
    But now I have a DLL project which is an MFT DLL using WRL, can I use another DLL generated by default "WinRT DLL Component" project?
    (The Compiler said that "managed targeted code requires a '/clr' option", but WRL can not be used with /clr.)
    BR,
    Chik
    Wednesday, January 11, 2012 3:13 AM
  • Hi Chik,

    Accessing a WinRT .winmd component from WRL is a known limitation in the Developer Preview. We are investigating ways to provide this functionality. Thanks for letting us know as it's helpful to hear someone has a need for that functionality.

     

    Thanks,

    -David

    • Marked as answer by ChikC Friday, January 13, 2012 1:25 AM
    Thursday, January 12, 2012 10:04 PM
    Moderator
  • Hi David,

      Thanks for your replied, and hope the functionality will be supported in future.

    Chik

    Friday, January 13, 2012 1:27 AM
  • Hi ChikC,

    I've been looking all around for a code sample of MFT using WRL but I couldn't find.

    I was thinking if you could provide me with it. Of course it doesn't need to contain your specific code - Only the project structure so I can fill the functions with my own needs (processInput, processOutput, etc.)

    It would be of great help. Could you do that?

    Thanks in advance,

    João Paulo Leite

    Tuesday, January 17, 2012 11:03 AM
  • I noticed this was a highly viewed thread, so here is a recently posted sample WRL component

    http://code.msdn.microsoft.com/windowsapps/Windows-Runtime-Component-e3e1e38d

    -Steve

    Friday, April 6, 2012 1:33 AM
    Moderator