Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Declare dll call caused an exception
Message
De
28/01/2005 17:58:55
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Visual FoxPro:
VFP 6 SP5
OS:
Windows 2000 SP2
Network:
Windows 2000 Pro
Database:
Visual FoxPro
Divers
Thread ID:
00979001
Message ID:
00981926
Vues:
55
>but they are over 130KB.
>Here is the particular code call from the C source:
>
>         ret = BUICScan(iFormat,OutputFileNameFront, FrontSize,
>              OutputFileNameBack, BackSize, MCode, MCodeSize);
>
>and here is the 'definition' from the .H file
>
>/*-----------------02-18-97 12:18pm-----------------
>  BUICScan - Scan one check and place the image
>      in the files named by the passed parameters.
>      iJobType specifies which images (information)
>      is captured and stored.
>
>  PARAMETERS:
>      iJobType    -
>                     1 - Front
>                     2 - Back
>                     3 - Front and Back
>                     4 - MICR
>                     5 - Front and MICR
>                     6 - Back and MICR
>                     7 - Front, Back and Micr
>      lpFront     -  File name for front of the check image.
>      lpLenFront  -  Length of the file (ASCII) for the front of the check image.
>      lpBack      -  File name for back of the check image.
>      lpLenBack   -  Length of the file (ASCII) for the back of the check image.
>      lpCode      -  File name for MICR of the check.
>      lpLenCode   -  Length of the file (ASCII) containing the MICR.
>
>  RETURN:
>      TRUE                    - Everything okay.
>      BUIC_ERROR_NOINIT       - Have not initialized the scanner
>                                before starting this scan.
>      BUIC_ERROR_BADJOB       - Job type not within range of known types.
>
>--------------------------------------------------*/
>CFUNCTIONSDLLCALLS int FAR PASCAL BUICScan(int iJobType,
>                            LPSTR lpFront, LPSTR lpLenFront,
>                            LPSTR lpBack, LPSTR lpLenBack,
>                            LPSTR lpCode, LPSTR lpLenCode);
>
>
>

Sorry for the late reply :-)

You didn't post the initialization part and the typedef for each variable ( iFormat, OutputFileNameFront, etc... )

I see Borislav has given you a reply, does it works or not ?
Here is another workaround. Run the code exactly like it, see whether it blows up your apps or not
Declare Long RtlMoveMemory in Kernel32 as Copy2Mem ;
   Long pDest, String @cSource, Long nLength

Declare Long LocalAlloc in Kernel32 Long uFlags, Long dwBytes
Declare Long LocalFree in Kernel32 Long hMem

Declare Integer BUICScan in BUICAP32.DLL ;
   Integer iJobType, ;
   Long lpFront, Long lpLenFront, ;
   Long lpBack, Long lpLenBack, ;
   Long lpCode, Long lpLenCode

iFormat        = 1   && get FrontFilename only
pFrontFileName = LocalAlloc( 64, 256 )
pFrontSize     = LocalAlloc( 64, 256)
pBackFileName  = LocalAlloc( 64, 256 )
pBackSize      = LocalAlloc( 64, 256 )
pCode          = LocalAlloc( 64, 256 )
pCodeSize      = LocalAlloc( 64, 256 )

cFrontFileName = 'FrontOut.TIF'
Copy2Mem( pFrontFileName, cFrontFileName, len( cFrontFileName ))
Copy2Mem( pFrontSize, Num2DWord(len( cFrontFileName )), 4 )

? BUICScan( iFormat, pFrontFileName, pFrontSize, ;
   pBackFileName, pBackSize, pCode, pCodeSize )

LocalFree( pFrontFileName )
LocalFree( pFrontSize )
LocalFree( pBackFileName )
LocalFree( pBackSize )
LocalFree( pCode )
LocalFree( pCodeSize )


Function Num2DWord( tn_Num )
   Local lc_0, lc_1, lc_2, lc_3

   If (tn_Num < 0)
      ** Transform SDWord into DWord
      ** Works for VFP6 and later
      tn_Num = val(transform( 0x100000000 + tn_Num, '@0' ))
   endif

   lc_3 = chr(int( tn_Num / 0x1000000 ))
   tn_Num = mod( tn_Num, 0x1000000 )

   lc_2 = chr(int( tn_Num / 0x10000 ))
   tn_Num = mod( tn_Num, 0x10000 )

   lc_1 = chr(int( tn_Num / 0x100 ))
   lc_0 = chr(mod( tn_Num, 0x100 ))
   endif

   Return lc_0 + lc_1 + lc_2 + lc_3
EndFunc
Herman
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform