namespaces - C++ example for using WIndows::System::Launcher class member functions in a console C++ app -


i want make use of member functions of "launcher class" launcher class console c++ application, not windows store app ( instead in console application exe).

unlike general windows api includes dll, header file minimum requirement, includes namespace windows::system , meta data "windows.winmd".

so means uses .net framework (common language runtime) launcher class in thenamesapce windows.system.

i changed vs settings in properties -> configuration -> common language runtime suspport include clr.

and i'm using :

using namespace system; 

but see launcher class isn't present here. tried

using namespace windows.system; 

as launcher class in windows.system namespace couldn't find launcher class here too.

can please ask code snippet using launcher class member functions.

i didn't think done initially, appear possible.

sridhar poduri put visual studio extension creates c++/cx console application project template. https://visualstudiogallery.msdn.microsoft.com/e9210454-c1b5-4d89-b8ca-92a64dfb8d28 project built template capable of calling c++/cx apis such windows::system::launcher::launchuriasync(). i'm not sure if particular api can used command line application, when tried it raised exception.

if want know how change normal win32 console application template use c++/cx change following in project settings. under c/c++->general

  1. set "consume windows runtime extension" "yes /zw"
  2. add these paths "additional #using directories": "c:\program files (x86)\microsoft sdks\windows\v8.1\extensionsdks\microsoft.vclibs\12.0\references\commonconfiguration\neutral\;c:\program files (x86)\windows kits\8.1\references\commonconfiguration\neutral;%(additionalusingdirectories)"

under c/c++->code generation

  1. set "enable minimal rebuild" "no /gm-"

making these changes should allow compile code uses c++/cx apis. here sample code:

#include <iostream> using namespace std; using namespace platform;  int main(platform::array<platform::string^>^ args) {     platform::details::console::writeline("hello world");      return 0; } 

also, wanted point out launcher api referencing not c++\cli. c++\cx shares similar syntax c++\cli.


Comments

Popular posts from this blog

cakephp - simple blog with croogo -

How to group boxplot outliers in gnuplot -

bash - Performing variable substitution in a string -