Forum Replies Created
- AuthorPosts
I set CAP_XFERCOUNT as -1. my code is below
TW_CAPABILITY twCapability;
pTW_ONEVALUE pval;twCapability.Cap = CAP_XFERCOUNT;
twCapability.ConType = TWON_ONEVALUE;
twCapability.hContainer = GlobalAlloc (GHND, sizeof (TW_ONEVALUE));
pval = (pTW_ONEVALUE) GlobalLock (twCapability.hContainer);
pval->ItemType = TWTY_INT16;
pval->Item = -1;
GlobalUnlock(twCapability.hContainer);
g_rc = (*DSM_ENTRY) (&g_AppID, &g_SrcID, DG_CONTROL, DAT_CAPABILITY, MSG_SET, ( TW_MEMREF)&twCapability);
if(g_rc == TWRC_SUCCESS)
printf(“CAP_XFERCOUNT Succ n”);
else
printf(“CAP_XFERCOUNT failed n”);/*
*/TW_USERINTERFACE ui;
ui.ShowUI = TRUE;
ui.ModalUI = TRUE;
ui.hParent = 0;g_rc = (*DSM_ENTRY) (&g_AppID,&g_SrcID,DG_CONTROL,DAT_USERINTERFACE,MSG_ENABLEDS,&ui);
if (g_rc != TWRC_SUCCESS)
{
JNU_Throwexception(env,”scanner/TwainException”,”Unable to enableDS”);
}bool nonTWAINProblem = FALSE;
MSG msg;
TW_EVENT event;
TW_PENDINGXFERS pxfers;do
{
event.pEvent = (TW_MEMREF) &msg;
event.TWMessage = MSG_NULL;g_rc = (*DSM_ENTRY) (&g_AppID,&g_SrcID,DG_CONTROL,DAT_EVENT,MSG_PROCESSEVENT,(TW_MEMREF) &event);
if (g_rc == TWRC_NOTDSEVENT)
{
TranslateMessage ((LPMSG) &msg);
DispatchMessage ((LPMSG) &msg);
continue;
}if (event.TWMessage == MSG_XFERREADY)
{
nextImage:
TW_IMAGEINFO ii;
g_rc = (*DSM_ENTRY) (&g_AppID,&g_SrcID,DG_IMAGE,DAT_IMAGEINFO,MSG_GET,(TW_MEMREF) &ii);if (g_rc == TWRC_FAILURE)
{
(*DSM_ENTRY) (&g_AppID,&g_SrcID,DG_CONTROL,DAT_PENDINGXFERS,MSG_RESET,(TW_MEMREF) &pxfers);
JNU_Throwexception(env,”TwainException”,”Unable to obtain image Info”);
break;
}HGLOBAL handle;
g_rc = (*DSM_ENTRY) (&g_AppID,&g_SrcID,DG_IMAGE,DAT_IMAGENATIVEXFER,MSG_GET,(TW_MEMREF) &handle);
if (g_rc == TWRC_XFERDONE)
{
BITMAPINFOHEADER* lpbmih=(BITMAPINFOHEADER*)GlobalLock(handle);
jboolean no=JNI_FALSE;
image = BMP_transferImage(env,clazz,&no,(HGLOBAL)handle);GlobalUnlock ((HANDLE) handle);
GlobalFree ((HANDLE) handle);g_rc = (*DSM_ENTRY) (&g_AppID,&g_SrcID,DG_CONTROL,DAT_PENDINGXFERS,MSG_ENDXFER,(TW_MEMREF) &pxfers);
}
(*DSM_ENTRY) (&g_AppID,&g_SrcID,DG_CONTROL,DAT_PENDINGXFERS,MSG_RESET,(TW_MEMREF) &pxfers);
}
}while (GetMessage ((LPMSG) &msg, 0, 0, 0) && pxfers.Count != 0);It just scan one page..what can be the problem ?
Regards
AmilaHi…
thnk u very much for the reply…
In build settings I have selected Standard (32 bit Universal).It compiled and run well in PPC machine , but still not working that same application in Intel MAC book.It doesn’t show any datasources.its still empty.
Can u plz give any ideaa…
Thnx
AmilaThnx for the reply dpenney…
Have some problems to get clear.
I compiled the code in a PPC set project settings-Architecture as 32/64-bit Universal. enable “Open using Rosetta” and run..its not working in Intel mac book.
Did i do correct way to build the universal binary…?
can u plz give any idea,will i sent the sample code to check it out…I have stucked with this for about several weeks….Thnx
AmilaHi..
Thnx again for the reply..
I have a java application in front end and have to do scanning using TWAIN.so i have to create a wrapper that can call by java.i have successfully implanted that part in Windows side.i want to implement that same thing in the MAC side.so I have already created a C++ project using XCODE and imlemented OPEN_DSM,OPEN_DS..I have included TwainFramework as well.
but when we run called the C++ library and run the native method OPEN_DSM it gives a error like
“autoreleased with no pool in place – just leaking”Can u give me a idea to solve this
Regards
AmilaThnx for the reply.
can u plz sample source code for mac ..jst for load the library and open datasource..it’ll be a great help to me to continue my development
Regards
Amila- AuthorPosts