PXV_Inst ActiveX Object

From PDF XChange PDF SDK
Jump to: navigation, search
Line 7: Line 7:
 
== Overview ==
 
== Overview ==
  
The main ActiveX Object of PDF-XChange Editor SDK that provides part of general functionality and gives access to an additional extensions of SDK.  
+
The main ActiveX Object of PDF-XChange Editor SDK that provides general functionality and gives access to additional extensions within the SDK.  
  
 
The '''GUID''' of object is:
 
The '''GUID''' of object is:
Line 13: Line 13:
 
::<tt>'''{973BF60B-4CC6-4be0-B408-3D80E07FC2E6}'''</tt>
 
::<tt>'''{973BF60B-4CC6-4be0-B408-3D80E07FC2E6}'''</tt>
  
The '''interface''' of control is:
+
The '''interface''' control is:
  
 
::[[PXV:IPXV_Inst|IPXV_Inst]]
 
::[[PXV:IPXV_Inst|IPXV_Inst]]
Line 19: Line 19:
 
== How to Instantiate ==
 
== How to Instantiate ==
  
You may instantiate the object in standard way by using the '''CoCreateInstance''' function or by any other method that is appropriate for instantiating of regular ActiveX-objects in your programming language.
+
You may instantiate the object in the standard manner by using the '''CoCreateInstance''' function or by any other method that is appropriate for instantiating of regular ActiveX-objects in your preferred programming language.
  
 
For example, in C#:
 
For example, in C#:
Line 39: Line 39:
 
</pre>
 
</pre>
  
Also, exists other special way to get pointer to [[PXV:IPXV_Inst|IPXV_Inst]] interface. For example, in C++:
+
There also exists another way to get pointer to [[PXV:IPXV_Inst|IPXV_Inst]] interface. For example, in C++:
 
<pre class="brush:cpp;gutter:false">
 
<pre class="brush:cpp;gutter:false">
 
typedef HRESULT (__cdecl *t_pPXV_GetInstance)(IPXV_Inst** ppInst);
 
typedef HRESULT (__cdecl *t_pPXV_GetInstance)(IPXV_Inst** ppInst);
Line 55: Line 55:
 
</pre>
 
</pre>
  
- with this special method you will be able to use SDK ''without'' regular installation as COM-server on client machine. And it will work for you, excepting one moment - in this case you will be unable to instantiate the simple ActiveX Control ([[PXV:PXV_Control|PXV_Control]]).
+
- with this special method you will be able to use the SDK ''without'' regular installation as a COM-server on a client machine and this will function in most circumstances as required, However one important exception is that you may not instantiate the simple ActiveX Control using the described method ([[PXV:PXV_Control|PXV_Control]]).
  
 
== How to Use ==
 
== How to Use ==
Firstly you need call [[PXV:IPXV_Inst_Init|IPXV_Inst::Init]] function before any use of the SDK. But, if you've created a [[PXV:PXV_Control|PXV_Control]] object before, you may not call this function, because it has already been done through the creating of PXV_Control-object. Another important point: when you finishing work with the SDK, you should call [[PXV:IPXV_Inst_Shutdown|IPXV_Inst::Shutdown]] method to release all used resources, to stop correctly all working threads, etc. But, if [[PXV:IPXV_Inst_Init|IPXV_Inst::Init]] method had not been called directly and only simple PXV_Control was used, then you may not call it. Also, in conclusion, the [[PXV:IPXV_Inst_Shutdown|IPXV_Inst::Shutdown]] method should be called the same number of times as [[PXV:IPXV_Inst_Init|IPXV_Inst::Init]] was called.
+
To instantiate the Simple ActiveX you must first call the [[PXV:IPXV_Inst_Init|IPXV_Inst::Init]] function before any use of the SDK. This is required only once and if you have already previously created a [[PXV:PXV_Control|PXV_Control]] object this does not have to be repeated again. It is also essential when all tasks are completed and use of the SDK is no longer required that you call [[PXV:IPXV_Inst_Shutdown|IPXV_Inst::Shutdown]] to release all used resource and correctly close all working threads, etc. However, if the [[PXV:IPXV_Inst_Init|IPXV_Inst::Init]] method has not been called directly and only the simple PXV_Control is used, no such call is required. In conclusion, the [[PXV:IPXV_Inst_Shutdown|IPXV_Inst::Shutdown]] method should be called for each and every instance [[PXV:IPXV_Inst_Init|IPXV_Inst::Init]] was called.

Revision as of 10:55, 5 June 2015


Overview

The main ActiveX Object of PDF-XChange Editor SDK that provides general functionality and gives access to additional extensions within the SDK.

The GUID of object is:

{973BF60B-4CC6-4be0-B408-3D80E07FC2E6}

The interface control is:

IPXV_Inst

How to Instantiate

You may instantiate the object in the standard manner by using the CoCreateInstance function or by any other method that is appropriate for instantiating of regular ActiveX-objects in your preferred programming language.

For example, in C#:

AxPDFXEdit.AxPXV_Inst pdfInst = new AxPDFXEdit.AxPXV_Inst();

In VB6:

Dim pdfInst As PDFXEdit.PXV_Inst
...    
Set pdfInst = New PDFXEdit.PXV_Inst

In C++:

CComPtr<IPXV_Inst> spPDFInst;
HRESULT hr = CoCreateInstance(__uuidof(PXV_Inst), nullptr, CLSCTX_INPROC_SERVER, __uuidof(IPXV_Inst), (void**)&spPDFInst);

There also exists another way to get pointer to IPXV_Inst interface. For example, in C++:

typedef HRESULT (__cdecl *t_pPXV_GetInstance)(IPXV_Inst** ppInst);

#if defined _M_IX86
#define SDK_LIB_NAME	L"PDFXEditCore.x86.DLL"
#else
#define SDK_LIB_NAME	L"PDFXEditCore.x64.DLL"
#endif

CComPtr<IPXV_Inst> spPDFInst;
HMODULE hSDKLib = LoadLibrary(SDK_LIB_NAME);
t_pPXV_GetInstance pfn = (t_pPXV_GetInstance)GetProcAddress(hSDKLib, "PXV_GetInstance");
HRESULT hr = pfn(&spPDFInst);

- with this special method you will be able to use the SDK without regular installation as a COM-server on a client machine and this will function in most circumstances as required, However one important exception is that you may not instantiate the simple ActiveX Control using the described method (PXV_Control).

How to Use

To instantiate the Simple ActiveX you must first call the IPXV_Inst::Init function before any use of the SDK. This is required only once and if you have already previously created a PXV_Control object this does not have to be repeated again. It is also essential when all tasks are completed and use of the SDK is no longer required that you call IPXV_Inst::Shutdown to release all used resource and correctly close all working threads, etc. However, if the IPXV_Inst::Init method has not been called directly and only the simple PXV_Control is used, no such call is required. In conclusion, the IPXV_Inst::Shutdown method should be called for each and every instance IPXV_Inst::Init was called.