Home › Forums › TWAIN Classic › how to delete all images from digital camera with twain?
- This topic has 3 replies, 2 voices, and was last updated 13 years, 6 months ago by carekee.
- AuthorPosts
i want to delete all images from camera with twain,how to do it?
Is this question related to existing TWAIN drivers or a TWAIN driver you are going to develop?
Best regards,
Kaijthank 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?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();
}- AuthorPosts