RightMargin Example for C++ 5.0 and later
ILEADRasterTwain * pltRasTwain;
ItwFrame * ptwFrame = NULL;
float m_RightMargin;
float m_LeftMargin;
float m_BottomMargin;
float m_TopMargin;
ILEADRasterVariant * CapVal = NULL;
CoCreateInstance(CLSID_LEADRasterVariant, NULL, CLSCTX_ALL,
IID_ILEADRasterVariant, (void **)&CapVal);
ICapability * pCapability = NULL;
ICapabilityOneValue * pCapOV = NULL;
::CoCreateInstance (CLSID_twFrame, NULL, CLSCTX_ALL, IID_ItwFrame, (void **)&ptwFrame);
if (ptwFrame)
{
UpdateData (TRUE);
ptwFrame->put_RightMargin(m_RightMargin);
ptwFrame->put_LeftMargin(m_LeftMargin);
ptwFrame->put_TopMargin(m_TopMargin);
ptwFrame->put_BottomMargin(m_BottomMargin);
::CoCreateInstance (CLSID_LEADRasterTwainCapability, NULL, CLSCTX_ALL, IID_ICapability, (void **)&pCapability);
pCapability->QueryInterface (IID_ICapabilityOneValue, (void **)&pCapOV);
pCapability->EnableMethodErrors = FALSE;
pCapability->Capability = L_ICAP_FRAMES;
pCapability->ConType = L_TWON_ONEVALUE;
CapVal->Type = VALUE_DISPATCH;
CapVal->DispatchValue = ptwFrame;
pCapOV->put_OneValItemType (L_TWTY_FRAME);
pCapOV->put_OneValCapValue (CapVal);
pltRasTwain->SetCapability (pCapability, L_LTWAIN_CAPABILITY_SET);
ptwFrame->Release();
pCapOV->Release();
pCapability->Release();
}
CapVal->Release();