VpeGetDevEntry

<< Click to Display Table of Contents >>

Navigation:  Device Control Properties >

VpeGetDevEntry

Previous pageReturn to chapter overviewNext page

[Windows platform only; not supported by the Community Edition]

After calling VpeDevEnum(), you are able to retrieve the names of all printing devices installed on the system with this method. With each call you retrieve one entry.

void VpeGetDevEntry(

VpeHandle hDoc,

int index,

LPSTR device,

int size

)

VpeHandle hDoc

Document Handle

int index

must be in the range between 0 and the value returned by VpeDevEnum() - 1

LPSTR device

receive string for the device name

int size

maximum size of the receive string in characters

Returns:

The name of the device specified by "index".  If index is out of range, an empty string ("") will be returned.

Remarks:

This method works only correctly, if you called VpeDevEnum() before.

Example:

long i, count

char s[256]

count = VpeDevEnum(hDoc) - 1        // initialize enumeration

for i = 0 to count

 VpeGetDevEntry(hDoc, i, s, sizeof(s))

 MessageBox(s) // show each available device in a separate message box

next i

 

Note:

Do not call VpeDevEnum() repeatedly, because each time VPE will query all printers from the system.

Wrong Example:

char s[256];

for i = 0 to VpeDevEnum(hDoc) - 1

 VpeGetDevEntry(hDoc, i, s, sizeof(s))

 MessageBox(s) // show each available device in a separate message box

Next i