从Windows Phone 8 Metro Style应用程序的C#代码调用C/C ++静态库函数: [英] Calling C/C++ static library functions from C# code of Windows Phone 8 Metro Style app:

查看:49
本文介绍了从Windows Phone 8 Metro Style应用程序的C#代码调用C/C ++静态库函数:的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有C&基于C ++的媒体框架静态库.我想使用C#代码在Windows Phone 8 Metro风格应用程序中使用该库.我是C#的新手,

I have a C & C++ based media framework static libraries. I want to use the library in my Windows Phone 8 metro style app from C# code. I'm a newbie to C#,

1.是否可以从Windows Phone 8 Metro风格应用的C#代码调用C/C ++静态库函数?如果是,请提供一些示例代码链接,这对我来说是一个很好的起点吗?

1. Is it possible to call C/C++ static library functions from C# code of a Windows Phone 8 Metro style app? If yes, Could you please provide some sample code links, that would be a good pointer for me to start?

谢谢

Prem

推荐答案

您可以使用WinRT组件包装C ++库,并从托管项目中调用这些API.在您的解决方案文件中,添加一个新项目,然后在Visual C ++中选择"Windows运行时组件"项目模板-> Windows Phone.别 忘记在C#项目中添加对WinRT组件的引用(添加引用->解决方案-> WinRT组件).
You can wrap your C++ libraries with a WinRT component and call those APIs from your managed project.  In your solution file, add a new project and select the Windows Runtime Component project template under Visual C++ -> Windows Phone.  Don't forget to add a reference to your WinRT component in your C# project (Add Reference -> Solution -> Your WinRT component).


这篇关于从Windows Phone 8 Metro Style应用程序的C#代码调用C/C ++静态库函数:的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆