How to get selected pages in the Thumbnail control?
The only available function is get_SelectedPages(). The function get_SelectedPages returns a VARIANT. How to convert the variant to selected pages in C++?
Mutiple selections in Thumbnail Control
Re: Mutiple selections in Thumbnail Control
Hello
The property get_SelectedPages() returns a COM array which is inside the VARIANT variable. This is a code snippet that demonstrates how to read a COM array in C++ :
Hope that helps?
David
The property get_SelectedPages() returns a COM array which is inside the VARIANT variable. This is a code snippet that demonstrates how to read a COM array in C++ :
Code: Select all
{
long n, len;
HRESULT hr;
VARIANT value;
hr = m_pdf->get_SelectedPages( &value );
if ( value.vt == (VT_VARIANT | VT_BYREF) )
{
value = *value.pvarVal;
}
ASSERT( value.vt == (VT_ARRAY | VT_I4) || value.vt == (VT_ARRAY | VT_UI4) );
SAFEARRAY * psa = value.parray;
hr = SafeArrayLock( psa );
hr = SafeArrayGetUBound( psa, 1, &len );
len++;
DWORD *values = (DWORD *) malloc( len * sizeof(DWORD) );
// read data here
for ( n = 0; n < len; n++ )
values[n] = ((LPDWORD)psa->pvData)[n];
SafeArrayUnlock( psa );
}
David
Amyuni Custom Development
Do you need a specific PDF solution? Are you looking for expertise that will enable you to start or complete a PDF integration project?
http://www.amyuni.com/en/company/services.php
Do you need a specific PDF solution? Are you looking for expertise that will enable you to start or complete a PDF integration project?
http://www.amyuni.com/en/company/services.php