Download the C library (gsdll32.dll) from Metro Style C # application

I want to use gsdll32.dll from a Metro Style C # application. I load the dll as follows:

[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); 

But when I try to load the DLL, no exception was found. I already put it in a Debug file. But it works.

I refer to this link .

+4
source share
2 answers

Perhaps, but:

  • Has gsdll32.dll been compiled against the WinRT SDK?
  • Does gsdll32.dll host an application certificate?
  • Have you included the DLL in your package?

If the answer to any of these questions is no, your code will not work.

+2
source

Build Ghostscript from source (PC version)
Microsoft Environment for WinRT

Ghostscript can be built as a win32 library for use in a Windows Runtime application or Windows Runtime component. WinRT requires Microsoft Visual Studio 2012 to build. There is a solution file that can be downloaded in VS 2012 to the winrt directory

The WinRT application or component should include iapi.h from gs / psi and a link with gsdll32metro.lib from gs / debugbin or gs / releasebin. Also, any application that uses ghostscript either directly or through a component should add gsdll32metro.dll as its β€œcontent”. This inclusion dll is necessary for it to be packaged with the application. If you want to run the debugger in ghostscript, then gsdll32metro.pdb should also be added as content.

From GhostScript 9.21 Documentation

Yes, I understand that this issue is half a decade.

0
source

Source: https://habr.com/ru/post/1437330/


All Articles