GetJPEGCompression Example for C++ 5.0 and later

ILEADRasterTwain_U * pRasterTwain;

HRESULT hr = ::CoCreateInstance(CLSID_LEADRasterTwain_U, NULL, CLSCTX_ALL, IID_ILEADRasterTwain_U, (void **)&pRasterTwain);

pRasterTwain->InitSession((long)GetSafeHwnd()); 
pRasterTwain->SelectSource();

short nRet = pRasterTwain->GetJPEGCompression(L_LTWAIN_GET_JPEG_COMPRESSION); 
if (nRet == 0) 
{
	CString csJpegData; 
	csJpegData.Format(TEXT("Color Space = %d\nQuantMap = %d\nGetHuffmanMap = %d\nGetQuantTable Flags = %d\nGetQuantTable Length = %d\nGetQuantTable Data = %d\nGetHuffmanDC Flags = %d\nGetHuffmanDC Data = %d\nGetHuffmanAC Flags = %d\nGetHuffmanAC Data = %d\n"),
					pRasterTwain->GetJPEGCompressionData ()->ColorSpace, 
					pRasterTwain->GetJPEGCompressionData()->GetQuantMap (0), 
					pRasterTwain->GetJPEGCompressionData()->GetHuffmanMap (0), 
					pRasterTwain->GetJPEGCompressionData()->GetQuantTable (0)->Flags, 
					pRasterTwain->GetJPEGCompressionData()->GetQuantTable(0)->Length, 
					pRasterTwain->GetJPEGCompressionData()->GetQuantTable(0)->Data, 
					pRasterTwain->GetJPEGCompressionData()->GetHuffmanDC(0)->Flags, 
					pRasterTwain->GetJPEGCompressionData()->GetHuffmanDC(0)->Data, 
					pRasterTwain->GetJPEGCompressionData()->GetHuffmanAC(0)->Flags, 
					pRasterTwain->GetJPEGCompressionData()->GetHuffmanAC(0)->Data); 
	MessageBox(csJpegData, TEXT("JPEG Compression Data")); 
}