title: WinRT app calling win32 c++ dll sending parameters
body: <p>Hey all this is the first time working with C++ so be kind :)</p>
  
  <p>I have made a WinRT app that, since of some type of "sandbox" it does for those apps I am unable to access anything outside of that (like what I want to access - my desktop app.</p>
  
  <p>So reading here and there I found out that if you make a C++ Dll and call it from the WinRT app then that would allow you to make calls outside of the "sandbox". But there's a little problem there.</p>
  
  <p>I am currently getting an error of:</p>
  
  <blockquote>
    <p>Error CS1660  Cannot convert lambda expression to type 'string' because it is not a delegate type.</p>
  </blockquote>
  
  <p>Using this code here:</p>
  
  <pre><code>void Header_Click(object sender, RoutedEventArgs e)
  {
      DisplayFromDLL("tester", s =&gt;
      {
          // response is returned in s - do what you want with it
      });
  }
  </code></pre>
  
  <p>The DisplayFromDLL is where its tossing that error from. More so the "s".</p>
  
  <p>So the C# code I have to call the dll with looks like this:</p>
  
  <pre><code>public sealed partial class GroupedItemsPage : Page
  {
      [DllImport("Win32Project1.dll", EntryPoint = "DisplayFromDLL", CallingConvention = CallingConvention.StdCall)]
      public static extern void DisplayFromDLL(string name, String response);
  
      void Header_Click(object sender, RoutedEventArgs e)
      {
          DisplayFromDLL("tester", s =&gt;
          {
              // response is returned in s
          });
      }
  </code></pre>
  
  <p>And the C++ dll code:</p>
  
  <pre><code>extern "C"
  {
      __declspec(dllexport) void DisplayFromDLL(const char name)
      {
          MessageBox("name is: " + name, "Msg title", MB_OK | MB_ICONQUESTION);
      }
  }
  </code></pre>
  
  <p>So some help would be great to see what side is causing the error and what the situation fixing it might be.</p>