...

Chasys Draw IES Help:

SDK - Callback Suites - pi_BasicQuery


SDK - Callback Suites - pi_BasicQuery
 

Callback Overview

This callback suite provides the plug-in with a means for querying the host for other callback suites and data as and when it requires them. All of the currently implemented suites are exposed by the various interfaces, so you may not need to use this interface.

 

Callback Interface Description

This interface is used for querying interfaces and data from the host.

//pi_BasicQuery

//-----------------------------------------------------------------------------

#define PI_BASICQUERY_VERSION                         0x00010002

 

struct pi_BASICQUERY

{

      unsigned long   version;

      unsigned long   unused_1;

      void* (__cdecl* get_PI)(wchar_t* name);

      int   (__cdecl* get_data)(wchar_t* name,void* data,int size);

      int   (__cdecl* set_data)(wchar_t* name,void* data,int size);

//20

      unsigned char   reserved_x[1024-20];//do not touch

};

 

get_PI() returns the requested interface. The name parameter is a string containing the name of any recognized PI interface, including the default interfaces. The return value is a pointer to the interface, or zero if the query failed.

get_data() returns the requested data/variable. The name parameter is a string containing the name of the host variable being queried. The data parameter is a pointer to a variable that will receive the requested value. The size parameter is the data buffer size in bytes. The return value is the number of bytes copied into data if the query succeeds. If the query fails because the buffer is too small, the return value is a negative number whose absolute value is the minimum expected buffer size. If the function fails for any other reason, the return value is zero.

The following variables are currently supported:

Variable Details
host.name

Name of the host as a unicode string.
e.g. “Chasys Draw IES”

host.version Version of the host as a unicode string.
e.g. “4.62.01”
host.temp_path The TEMP path in use by the host as a unicode string. Depending on the user's configuration, this can either be the TEMP folder of the Operating System or a user-defined “scratch-disc” location.
e.g. “C:\Windows\TEMP”
   

set_data() modifies the specified data/variable. The name parameter is a string containing the name of the host variable being modified. The data parameter is a pointer to a variable that contains the new value. The size parameter is the size of the data in bytes. The return value will be greater than zero if the set operation succeeds. If the host rejects the new value due to data errors or permissions, the return value is a negative number. If the variable being set is known or unavailable, or if the function fails for any other reason, the return value is zero.

The following variables are currently supported (but not implemented):

Variable Details
host.progress.string

Progress bar text (shown in the progress bar or window title).
Data type: Pointer to a null-terminated unicode string

host.progress.value Progress bar percentage in hundredths of a percent.
Data Type: Pointer to a 32-bit signed integer, value 0..10000
   

The internal implementation of pi_BasicQuery is neither defined nor fixed, and are purely host dependent. Do not attempt to access the reserved portion of the object.

 

 

Copyright © John Paul Chacha, 2001-2019

The information herein is subject to change without any notice. The author makes no guarantees as to the completeness of this documentation.