Forum Replies Created
- AuthorPosts
- September 15, 2010 at 2:05 am in reply to: how to delete all images from digital camera with twain? #25333
This is my code, i am sure you can add some code to achieve my function of delete images from camera.
////////////////////////////////
inline static TW_UINT16 DsmEntry(pTW_IDENTITY ptwidDest,
TW_UINT32 twuGroup, TW_UINT16 twuData, TW_UINT16 twuMsg, TW_MEMREF ptwmData)
{return m_dpDsmEntry(&m_twidOrigin, ptwidDest, twuGroup, twuData, twuMsg, ptwmData);
}
////////////////////////////////
m_dpDsmEntry = (DSMENTRYPROC) GetProcAddress(m_hTwain, “DSM_Entry”);
if (m_dpDsmEntry)
{
// open source manager
twuResult = DsmEntry(NULL, DG_CONTROL, DAT_PARENT, MSG_OPENDSM, &m_hParent);
if (twuResult == TWRC_SUCCESS)
{
// select source
twuResult = DsmEntry(NULL, DG_CONTROL, DAT_IDENTITY, MSG_GETDEFAULT, &m_twidSource);
if (twuResult == TWRC_SUCCESS)
{
// open source
twuResult = DsmEntry(NULL, DG_CONTROL, DAT_IDENTITY, MSG_OPENDS, &m_twidSource);
if (twuResult == TWRC_SUCCESS)
{
//////////////////////////there i want to delete all images from camera,you can add code
////////////there i want copy images from camera to disk(e.g D:\TT)
////////////then delete images from camera// set capability
TW_ONEVALUE twovValue;
TW_CAPABILITY twcCap;
twcCap.Cap = ICAP_FILTER;
twcCap.ConType = TWON_ONEVALUE;
twcCap.hContainer = &twovValue;
twovValue.Item = TWSX_FILE;
twovValue.ItemType = TWTY_INT16;
twuResult = DsmEntry(&m_twidSource, DG_CONTROL, DAT_CAPABILITY, MSG_SET, &twcCap);////////////////////////////////////////////there i want to delete images from camera,you can add code
////////////there i want copy images from camera to disk(e.g D:\TT)
////////////then delete images from camera}
// show ui
twuResult = ShowUI();
}
}
}
if (twuResult != TWRC_SUCCESS)
{
Close();
}September 15, 2010 at 1:29 am in reply to: how to delete all images from digital camera with twain? #25332thank for Kaij!
I want to use “DG_CONTROL / DAT_FILESYSTEM / MSG_DELETE” to delete images from camera, and i have connected to camera,but i cannot use ” DAT_FILESYSTEM ” triplets.Can you help me and give me same code to achieve it? - AuthorPosts