GetOutputDirectory

 

#include “BlackIceDEVMODE.h”

 

LPCTSTR     GetOutputDirectory(BlackIceDEVMODE* pDevMode);

Description

Returns the value of the OutputDirectory member of the BlackIceDEVMODE. Represents the value of the 'Output Directory' edit box.

Parameters

BlackIceDEVMODE* pDevMode               - pointer to the BlackIceDEVMODE structure

Return value

Output Directory (string)

Programming Notes

None

Code Example

C# example

 

Please see the following example for IMPORTING the BlackIceDEVMODE.dll functions in C# code:

                [DllImport("BlackIceDEVMODE.dll"EntryPoint = "LoadBlackIceDEVMODE"CharSet = CharSet.Unicode)]

private static extern IntPtr LoadBlackIceDEVMODE(string Printer);

 

[DllImport("BlackIceDEVMODE.dll", EntryPoint = "GetOutputDirectory", CharSet = CharSet.Unicode)]

private static extern IntPtr GetOutputDirectory(IntPtr lDevmode);

 

                [DllImport("BlackIceDEVMODE.dll"EntryPoint = "ReleaseBlackIceDEVMODE"CharSet = CharSet.Unicode)]

private static extern bool ReleaseBlackIceDEVMODE(IntPtr  Devmode);

 

Once imported, one can use the GetOutputDirectory function in the C# code as in the following example:

 

//Load BlackIceDEVMODE

IntPtr Devmode = LoadBlackIceDEVMODE("Printer Name");

//Pointer to the BlackIceDEVMODE structure or NULL if loading the DEVMODE has failed.

 

//Call the GetOutputDirectory function

IntPtr ipOutputDirectory = GetOutputDirectory(Devmode);

 

//Get the Output directory back from unmanaged memory

string sOutputDirectory = Marshal.PtrToStringUni(ipOutputDirectory);

 

//Release BlackIceDEVMODE

ReleaseBlackIceDEVMODE(Devmode);

 

VB.NET example

 

Please see the following example for IMPORTING the BlackIceDEVMODE.dll functions in VB.NET code:

 

Private Declare Unicode Function LoadBlackIceDEVMODE Lib "BlackIceDEVMODE.dll" (ByVal sPrinter As String) As IntPtr

      

Private Declare Unicode Function GetOutputDirectory Lib "BlackIceDEVMODE.dll" (ByVal pHandle As IntPtr) As IntPtr

      

Private Declare Unicode Function ReleaseBlackIceDEVMODE Lib "BlackIceDEVMODE.dll" (ByVal pHandle As IntPtr) As Boolean

 

Once imported, one can use the GetOutputDirectory function in the VB.NET code as in the following example:

 

//Load BlackIceDEVMODE

Dim Devmode As IntPtr

Devmode = LoadBlackIceDEVMODE("Printer Name")

//Pointer to the BlackIceDEVMODE structure or NULL if loading the DEVMODE has failed.

 

//Call the GetOutputDirectory function

Dim ipOutputDirectory As IntPtr

ipOutputDirectory = GetOutputDirectory(Devmode)

 

//Get the Output directory back from unmanaged memory

Dim sOutputDirectory As String

sOutputDirectory = Marshal.PtrToStringUni(sOutputDirectory)

 

//Release BlackIceDEVMODE

ReleaseBlackIceDEVMODE(Devmode)