【发布时间】:2017-07-06 14:11:12
【问题描述】:
我有一个winform程序,现在我需要增强与UWP应用程序的功能通信,所以我添加了引用Windows.DLL并对winform程序进行了一些更改,现在我可以通过Launcher.LaunchUriAsync方法调用UWP应用程序(),但方法 Launcher.LaunchUriForResultsAsync() 的任何异常,
你能给我一些建议吗?提前致谢。
例外: 操作标识符无效。 (HRESULT 异常:0x800710DD)
一些代码:
// The protocol handled by the launched app
Uri testAppUri = new Uri("etrace.scanner:");
var supportStatus = await Launcher.QueryUriSupportAsync(testAppUri, LaunchQuerySupportType.Uri, "80a2fbc7-843e-46ca-a740-cbb1bc604d33_y890260wv9vv0");
if (supportStatus != LaunchQuerySupportStatus.Available)
{
// Check the app available or not.
}
var inputData = new ValueSet();
inputData["TestData"] = "Test data";
var optionsE = new LauncherOptions { TargetApplicationPackageFamilyName = "80a2fbc7-843e-46ca-a740-cbb1bc604d33_y890260wv9vv0" };
// Call APP successully.
bool success = await Launcher.LaunchUriAsync(testAppUri, optionsE, inputData);
Debug.WriteLine(success);
// Got an exception:
var result = await Launcher.LaunchUriForResultsAsync(testAppUri, optionsE, inputData);
【问题讨论】: