Tag: 共享

在C#和C ++之间共享变量

我正在用c#编写一个软件,它需要多次调用,并且需要多个线程调用c ++非托管dll中的函数。 我有一个这样的C ++文件: // “variables” which consist in some simple variables (int, double) // and in some complex variables (structs containing arrays of structs) extern “C” { __declspec(dllexport) int function1() { // some work depending on random and on the “variables” } } 和那样的C#类 public class class1 { // “variables” <— the "same" as […]

从Windows Phone 8共享

我正在开发Windows Phone 8应用程序,并尝试通过DataTransferManager共享内容。 Windows API文档说Windows Phone支持它,但是当调用DataTransferManager.GetForCurrentView()函数时,我得到一个例外 System.NotSupportedException was unhandled by user code HResult=-2146233067 Message=Specified method is not supported. Source=Windows InnerException: 我一直在寻找答案,找不到其他人有同样的问题,任何帮助将不胜感激。 关于此主题的所有示例似乎都是Windows 8特定的,但Phone 8确实包含这些function。 这是我的应用程序中的示例代码。 protected override void OnNavigatedTo(System.Windows.Navigation.NavigationEventArgs e) { DataTransferManager dataTransferManager = DataTransferManager.GetForCurrentView(); dataTransferManager.DataRequested += new TypedEventHandler(dataTransferManager_DataRequested); } private void dataTransferManager_DataRequested(DataTransferManager sender, DataRequestedEventArgs e) { DataPackage requestData = e.Request.Data; requestData.Properties.Title = “Share Text […]