IPXV_Inst::APIVersion Property

From PDF XChange PDF SDK
Jump to: navigation, search
m (Automatic page editing by robot)
m (Automatic page editing by robot)
 
(One intermediate revision by one other user not shown)
Line 5: Line 5:
 
{{ToReview}}
 
{{ToReview}}
  
Returns the number of the actual version of SDK.
+
Returns the actual version of SDK. Application should check the SDK version if it needs to use functionality that was introduced in specific version of the SDK.
  
 
== Syntax ==
 
== Syntax ==
 
<pre class="brush:cpp;gutter:false">HRESULT get_APIVersion([out, retval]  ULONG*  nVersion);
 
<pre class="brush:cpp;gutter:false">HRESULT get_APIVersion([out, retval]  ULONG*  nVersion);
 +
</pre>
 +
 +
== Remarks ==
 +
Version represented by 32-bit number consists of four components (bytes) in the following order from high to low: ''major version'', ''minor version'', ''build'', ''sub-build''.
 +
 +
The following macro can be used to define the version number:
 +
<pre class="brush:cpp">
 +
#define MAKE_API_VERSION(majver, minver, build, subbuild) ((majver) << 24) | ((minver) << 16) | ((build) << 8) | (subbuild)
 +
</pre>
 +
 +
As a result, for example, current version (1.2.0.0) of the SDK will have a value: <tt>0x01020000</tt>
 +
 +
== Sample ==
 +
<pre class="brush:cpp">#define MAKE_API_VERSION(majver, minver, build, subbuild) ((majver) << 24) | ((minver) << 16) | ((build) << 8) | (subbuild)
 +
#define REQ_VER    MAKE_API_VER(1, 2, 0, 0)
 +
 +
bool IsValidSDK(PXV_Inst* pInst)
 +
{
 +
    ULONG nVer;
 +
    pInst->get_APIVersion(&nVer);
 +
    return (nVer >= REQ_VER);
 +
}
 
</pre>
 
</pre>
  
 
== See Also ==
 
== See Also ==
[[PXV:IPXV_Inst|IPXV_Inst]]
+
[[PXV:IPXV_Inst|IPXV_Inst]], [[PXV:IPXC_Inst_APIVersion|IPXC_Inst::get_APIVersion]]

Latest revision as of 02:21, 20 October 2015


Returns the actual version of SDK. Application should check the SDK version if it needs to use functionality that was introduced in specific version of the SDK.

Syntax

HRESULT get_APIVersion([out, retval]  ULONG*  nVersion);

Remarks

Version represented by 32-bit number consists of four components (bytes) in the following order from high to low: major version, minor version, build, sub-build.

The following macro can be used to define the version number:

#define MAKE_API_VERSION(majver, minver, build, subbuild)		((majver) << 24) | ((minver) << 16) | ((build) << 8) | (subbuild)

As a result, for example, current version (1.2.0.0) of the SDK will have a value: 0x01020000

Sample

#define MAKE_API_VERSION(majver, minver, build, subbuild)		((majver) << 24) | ((minver) << 16) | ((build) << 8) | (subbuild)
#define REQ_VER    MAKE_API_VER(1, 2, 0, 0)

bool IsValidSDK(PXV_Inst* pInst)
{
    ULONG nVer;
    pInst->get_APIVersion(&nVer);
    return (nVer >= REQ_VER);
}

See Also

IPXV_Inst, IPXC_Inst::get_APIVersion