J2KSetDefaults example for C++ 5.0 and later
ILEADRasterIO *pIO=NULL;
::CoCreateInstance(CLSID_LEADRasterIO, NULL, CLSCTX_ALL,
IID_ILEADRasterIO, (void**)&pIO);
CString csmsg;
CString cstemp;
m_LEADRasterView1.GetRaster().UnlockSupport(L_SUPPORT_J2K, L_KEY_J2K);
// Display all the default JPEG2000 advanced options
pIO->J2KSetDefaults ();
cstemp.Format(TEXT("J2KUseColorTransform = %d\n"), pIO->J2KUseColorTransform);
csmsg = csmsg + cstemp;
cstemp.Format(TEXT("J2KDerivedQuantization = %d\n"), pIO->J2KDerivedQuantization);
csmsg = csmsg + cstemp;
cstemp.Format(TEXT("J2KXOsiz = %d\n"), pIO->J2KXOsiz);
csmsg = csmsg + cstemp;
cstemp.Format(TEXT("J2KYOsiz = %d\n"), pIO->J2KYOsiz);
csmsg = csmsg + cstemp;
cstemp.Format(TEXT("J2KXTsiz = %d\n"), pIO->J2KXTsiz);
csmsg = csmsg + cstemp;
cstemp.Format(TEXT("J2KYTsiz = %d\n"), pIO->J2KYTsiz);
csmsg = csmsg + cstemp;
cstemp.Format(TEXT("J2KXTOsiz = %d\n"), pIO->J2KXTOsiz);
csmsg = csmsg + cstemp;
cstemp.Format(TEXT("J2KYTOsiz = %d\n"), pIO->J2KYTOsiz);
csmsg = csmsg + cstemp;
cstemp.Format(TEXT("J2KDecompLevel = %d\n"), pIO->J2KDecompLevel);
csmsg = csmsg + cstemp;
cstemp.Format(TEXT("J2KProgressOrder = %d\n"), pIO->J2KProgressOrder);
csmsg = csmsg + cstemp;
cstemp.Format(TEXT("J2KCodBlockWidth = %d\n"), pIO->J2KCodBlockWidth);
csmsg = csmsg + cstemp;
cstemp.Format(TEXT("J2KCodBlockHeight = %d\n"), pIO->J2KCodBlockHeight);
csmsg = csmsg + cstemp;
cstemp.Format(TEXT("J2KCBS_SelectiveACBypass = %d\n"), pIO->J2KCBS_SelectiveACBypass);
csmsg = csmsg + cstemp;
cstemp.Format(TEXT("J2KCBS_ResetContextOnBoundaries = %d\n"), pIO->J2KCBS_ResetContextOnBoundaries);
csmsg = csmsg + cstemp;
cstemp.Format(TEXT("J2KCBS_TerminationOnEachPass = %d\n"), pIO->J2KCBS_TerminationOnEachPass);
csmsg = csmsg + cstemp;
cstemp.Format(TEXT("J2KCBS_VerticallyCausalContext = %d\n"), pIO->J2KCBS_VerticallyCausalContext);
csmsg = csmsg + cstemp;
cstemp.Format(TEXT("J2KCBS_PredictableTermination = %d\n"), pIO->J2KCBS_PredictableTermination);
csmsg = csmsg + cstemp;
cstemp.Format(TEXT("J2KCBS_ErrorResilienceSymbol = %d\n"), pIO->J2KCBS_ErrorResilienceSymbol);
csmsg = csmsg + cstemp;
cstemp.Format(TEXT("J2KGuardBits = %d\n"), pIO->J2KGuardBits);
csmsg = csmsg + cstemp;
cstemp.Format(TEXT("J2KDerivedBaseMantissa = %d\n"), pIO->J2KDerivedBaseMantissa);
csmsg = csmsg + cstemp;
cstemp.Format(TEXT("J2KDerivedBaseExponent = %d\n"), pIO->J2KDerivedBaseExponent);
csmsg = csmsg + cstemp;
cstemp.Format(TEXT("J2KUseSOPMarker = %d\n"), pIO->J2KUseSOPMarker);
csmsg = csmsg + cstemp;
cstemp.Format(TEXT("J2KUseEPHMarker = %d\n"), pIO->J2KUseEPHMarker);
csmsg = csmsg + cstemp;
AfxMessageBox(csmsg);