PXV_Inst ActiveX Object

From PDF XChange PDF SDK
Jump to: navigation, search
(How to Instantiate)
 
(27 intermediate revisions by 2 users not shown)
Line 1: Line 1:
 
__NOTOC__
 
__NOTOC__
 
[[Category:Editor]]
 
[[Category:Editor]]
{{#customTitle:PXV_Inst CoClass}}
+
{{#customTitle:PXV_Inst ActiveX Object}}
{{#parentPage:PXV:PXV_CoClasses|PXV_Inst}}
+
{{#parentPage:PXV:CoClasses|PXV_Inst|interface}}
{{ToReview}}
+
 
  
 
== Overview ==
 
== Overview ==
  
The main ActiveX-object of PDF-XChange Editor SDK that provides part of general functionality and gives access to additional extensions of SDK.  
+
The main ActiveX Object of the PDF-XChange Editor SDK which provides general functionality and provides access to additional extensions within the SDK.  
  
The '''GUID''' of object is:
+
The objects '''GUID''' is:
  
::<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 ActiveX-objects in your programming language.
+
You standard means to instantiate the object is provided for by using the '''CoCreateInstance''' function or by any other method that is appropriate for the instantiation of regular ActiveX-objects using your preferred programming language/tool.
  
 
For example, in C#:
 
For example, in C#:
Line 25: Line 25:
 
AxPDFXEdit.AxPXV_Inst pdfInst = new AxPDFXEdit.AxPXV_Inst();
 
AxPDFXEdit.AxPXV_Inst pdfInst = new AxPDFXEdit.AxPXV_Inst();
 
</pre>
 
</pre>
 
  
 
In VB6:
 
In VB6:
Line 33: Line 32:
 
Set pdfInst = New PDFXEdit.PXV_Inst
 
Set pdfInst = New PDFXEdit.PXV_Inst
 
</pre>
 
</pre>
 
  
 
In C++:
 
In C++:
Line 41: Line 39:
 
</pre>
 
</pre>
  
 
+
Or you may get a pointer to the interface by using [[PXV:IPXV_Inst|IPXV_Inst]]. For example, in C++:
Also, exists other special 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 59: Line 55:
 
</pre>
 
</pre>
  
- with this special method you will be able to use SDK ''without'' regular installation of ActiveX objects from SDK on the client machines. In other words - without standard registering of all ActiveX-objects from the SDK. And it will work for you, excepting one moment - without registration you will be unable to instantiate the simple ActiveX Control ([[PXV:PXV_Control|PXV_Control]]).
+
- using this method it is possible 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 ==
 
+
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]] called.
There is required to first call of [[PXV:IPXV_Inst_Init|IPXV_Inst::Init]] before any using of SDK
+
 
+
Firstly is recommended to specify your developer's license key for PDF-XChange Editor SDK to prevent the showing the DEMO labels across the pages. For it you should use the [[PXV:IPXV_Control_SetLicKey|IPXV_Control:SetLicKey]] method. After that you will be able to use whole API without any showing and placing of DEMO-labels. The most popular features you may use on beginning:
+
 
+
* [[PXV:IPXV_Control_OpenDocFromPath|IPXV_Control::OpenDocFromPath]]/[[PXV:IPXV_Control_Src|IPXV_Control::Src]] to open document from specified source file name.
+
 
+
* [[PXV:IPXV_Control_PrintPages|IPXV_Control::PrintPages]] to print document pages.
+
 
+
* [[PXV:IPXV_Control_EnableEventListening|IPXV_Control::EnableEventListening]] - to enable listening of necessary Editor's events.
+
 
+
* [[PXV:IPXV_Control_CurrentPage|IPXV_Control::CurrentPage]]/[[PXV:IPXV_Control_GoToNextPage|IPXV_Control::GoToNextPage]]/[[PXV:IPXV_Control_GoToDestination|IPXV_Control::GoToDestination]] - to navigate on pages.
+
 
+
* [[PXV:IPXV_Control_Inst|IPXV_Control::Inst]] - to get access to the main object of SDK to get whole functionality.
+

Latest revision as of 09:46, 8 June 2015


Overview

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

The objects GUID is:

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

The interface control is:

IPXV_Inst

How to Instantiate

You standard means to instantiate the object is provided for by using the CoCreateInstance function or by any other method that is appropriate for the instantiation of regular ActiveX-objects using your preferred programming language/tool.

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);

Or you may get a pointer to the interface by using IPXV_Inst. 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);

- using this method it is possible 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 called.