Type a page name and press Enter. You'll jump to the page if it exists, or you can create it if it doesn't.
To create a page in a module other than Structures, prefix the name with the module name and a period.
GSVersion (Structures)
.
C# Definition:
[StructLayout(LayoutKind.Sequential)]
public struct GSVersion
{
public IntPtr product;
public IntPtr copyright;
public int revision;
public int revisionDate;
}
VB Definition:
<StructLayout(LayoutKind.Sequential)> _
Public Structure GSVersion
Public product As IntPtr
Public copyright As IntPtr
Public revision As Integer
Public revisionDate As Integer
End Structure
User-Defined Field Types:
None.
Notes:
When starting to work with the Ghostscript Interpreter API (gsapi.dll), it is helpful to start by getting the gsapi_revision function to work.
Here is a sample of how the GSVersion structure is filled in by the gsapi_revision function.
GPL Ghostscript
Copyright Some Company
815
20040922
Tips & Tricks:
Originally this article showed the 'product' and 'copyright' fields as type 'string', but this causes a program crash when calling the gsapi_revision function (tested under VS2013 and 32-bit GPL Ghostscript v9.15).
Using IntPtr instead allows the struct to be passed correctly but requires a manual conversion. One way to accomplish this transparently is by making those two fields private and adding the following properties to the struct:
public String Product
{
get { return Marshal.PtrToStringAnsi(product); }
set { product = Marshal.StringToHGlobalAnsi(value); }
}
public String Copyright
{
get { return Marshal.PtrToStringAnsi(copyright); }
set { copyright = Marshal.StringToHGlobalAnsi(value); }
}
This structure is filled in by the gsapi_revision function.
3/4/2015 3:47:59 PM - jmbpiano-216.21.193.15
An IntPtr is a pointer to a memory location (unmanaged) that adapts to the platform it is running on (64-bit, etc.) UNLIKE a standard int/Integer. You should always use this type for unmanaged calls that require it, even though an int will appear to work on your development machine.
1/13/2008 4:00:13 AM - Damon Carr-72.43.165.29
Please edit this page!
Do you have...
helpful tips?
corrections to the existing content?
alternate definitions?
additional languages you want to include?
Select "Edit This Page" on the right hand toolbar and edit it! Or add new pages containing any supporting types needed.