Hybrid JavaScript and C++ Sample

This sample illustrates how to build a Metro style app that uses both JavaScript and C++.  The UI for this app is written in JavaScript/HTML which then calls into a C++ component that performs some image manipulationDescriptionThis sample makes use of the Windows Runtime to facil

 
 
 
 
 
(6)
2,936 times
Add to favorites
10/23/2012
E-mail Twitter del.icio.us Digg Facebook
Sign in to ask a question


  • can i write in C# then call java to perform something?
    1 Posts | Last post August 30, 2014
    • in my c# app I want to call the open source mp4parser which is in java
  • Can we have the c# and JavaScript code in the single application
    2 Posts | Last post October 23, 2012
    • Can we have the c# and JavaScript code in the single application ?
    • It would be very similar.  Just use the same JS code but rewrite the imaging WinRT component in C# instead of C++ and use it from JS.
  • does not run
    2 Posts | Last post October 23, 2012
    • Has anyone gotten this to run? Like, DevPrSolT I have run into one issue after another with this solution, it is not working.
      
      I am using Microsoft Visual Studio Express 2012 RC for Windows 8 on the Windows 8 Release Candidate.
      
      Thanks.
    • Using VS 2012 RTM, this should be fixed.
  • Doesnt work with W8 Release preview
    3 Posts | Last post October 23, 2012
    • Error	1	error C4996: '_wfopen': This function or variable may be unsafe. Consider using _wfopen_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.	d:\devel\w8\jscpp\c++,javascript\imaging\cartoonifier.cpp	122	1	imaging
      
      Error	2	Could not find SDK "Microsoft.WinJS, Version=0.6".	C:\Windows\Microsoft.NET\Framework\v4.0.30319\Microsoft.Common.targets	1682	6	HybridNativeJSApp
      
    • * Switch _wfopen...
      
          FILE* fHandle;
      	_wfopen_s(&fHandle, outFile, L"wb");
      
      *Update JS refs...
      
          <!-- OLD WinJS references - Delete these! 
      
          <link href="//Microsoft.WinJS.0.6/css/ui-dark.css" rel="stylesheet">
          <script src="//Microsoft.WinJS.0.6/js/base.js"></script>
          <script src="//Microsoft.WinJS.0.6/js/ui.js"></script>
          -->
          <!-- New WinJS references - Add these! -->
          <link rel="stylesheet" type="text/css" href="//Microsoft.WinJS.1.0.RC/css/ui-dark.css" />
          <script type="text/javascript" src="//Microsoft.WinJS.1.0.RC/js/base.js"></script>
          <script type="text/javascript" src="//Microsoft.WinJS.1.0.RC/js/ui.js"></script>
      
      ---------------------------------------------------------------
      *Change these (there's two calls to createObjectURL() )...
                  var url = URL.createObjectURL(imgFile, false);
      ..to...
                  var url = URL.createObjectURL(imgFile);
      
      ..hope that helps...
      Jeff
    • Should be fixed now.