从 Metro Style App c# 加载 C 库 (gsdll32.dll)

2024-04-19

我想使用 Metro Style App c# 中的 gsdll32.dll。我加载dll如下:

[DllImport("gsdll32.dll", EntryPoint = "gsapi_delete_instance")]
private static extern void gsapi_delete_instance(IntPtr instance);

[DllImport("gsdll32.dll", EntryPoint = "gsapi_revision")]
private static extern int gsapi_revision(ref GS_Revision pGSRevisionInfo, int intLen);        

[DllImport("gsdll32.dll", EntryPoint = "gsapi_set_stdio")]
private static extern int gsapi_set_stdio(IntPtr lngGSInstance, StdioCallBack gsdll_stdin, StdioCallBack gsdll_stdout, StdioCallBack gsdll_stderr);

但是当我尝试加载 dll 时未找到异常发生。我已经把它放在调试文件中了。但它确实有效。

我参考自这个链接 http://www.codeproject.com/Articles/32274/How-To-Convert-PDF-to-Image-Using-Ghostscript-API.


这是可能的,但是:

  • gsdll32.dll 是针对 WinRT SDK 编译的吗?
  • gsdll32.dll是否通过App认证?
  • 你的包里有dll吗?

如果其中任何一个问题的答案是“否”,那么您的代码将无法工作。

本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

从 Metro Style App c# 加载 C 库 (gsdll32.dll) 的相关文章

随机推荐