SHLoadIndirectString的返回值是一个errorcode
Return value of SHLoadIndirectString is an errorcode
嗨,我一直试图从各自应用程序的AppManifest.xml中获得地铁应用程序的名称。我知道SHLoadIndirectString可用于此目的。在手动检查其功能时,我无法获得结果资源。代码片段如下所示。
#include <iostream>
using namespace std;
#include <Shlwapi.h>
int main(){
LPWSTR output = L"";
LPWSTR input = L"@{Microsoft.BingMaps_2.1.3230.2048_x64__8wekyb3d8bbwe?ms-resource://Microsoft.BingMaps/resources/AppDisplayName}";
int result = SHLoadIndirectString(input, output, sizeof(output), NULL );
cout<<output;
return 0;
}
返回值"result"总是一个负值(如果我改变输入字符串分别到app)。请指点我的错误。谢谢。
答对了。
#include <iostream>
using namespace std;
#include <Shlwapi.h>
int main()
{
PWSTR output = (PWSTR) malloc(sizeof(WCHAR)*256);
PCWSTR input = L"@{C:\Program Files\WindowsApps\Microsoft.BingMaps_2.1.3230.2048_x64__8wekyb3d8bbwe\resources.pri?ms-resource://Microsoft.BingMaps/Resources/AppShortDisplayName}";
int result = SHLoadIndirectString(input, output, 256, NULL );
cout<<output;
return 0;
}
相关文章:
- 如何创建一个CMake变量,除非显式重写,否则使用默认值
- 删除一个线程上有数百万个字符串的大型哈希映射会影响另一个线程的性能
- 为什么两个不同的未命名名称空间可以共存于一个cpp文件中
- 运行同一解决方案的另一个项目的项目
- 挂起和取消挂起一个文件DLL
- 用C++中的一个变量定义一个常量
- 函数向量_指针有不同的原型,我可以构建一个吗
- 在c++中用vector填充一个简单的动态数组
- 如何在选项卡视图Qt中设置一个新项目,并保存以前的项目
- 预处理器:插入结构名称中的前一个行号
- 我在c++代码中生成了一个运行时#3异常
- 我想将一个对T类型的非常量左值引用绑定到一个T类型的临时值
- 从链接列表c++中删除一个项目
- 告诉一个 const char 数组,除了编译时 C 样式的字符串外,它不以 '