Lectora Laser

Lectora Laser

Postby diegopolverelli » Fri Jul 02, 2010 3:23 pm

Hola, gente... ya empiezo a molestar. Tengo un Motorola MC1000. Es un aparato que tiene lectora de códigos de barra. Ya pude ejecutar código perfectamente. Pero, por ej, no puedo hacer arrancar la lectora con fivewin. Ni probé, no tengo ni idea de como arrancar. La lectora anda, porque con un programa demo funciona.
Si alguien tiene data, por favor, le agradecerá. Atte.
diegopolverelli
 
Posts: 149
Joined: Thu Jun 21, 2007 3:26 pm

Re: Lectora Laser

Postby Antonio Linares » Fri Jul 02, 2010 5:05 pm

Diego,

Es frecuente que un lector de códigos de barras genere las pulsaciones de teclado equivalentes a los caracteres que lea.

Prueba a poner un GET en la ventana: @ ..., ... GET ... OF oWnd y dale foco y luego mira a ver si el lector escribe en el GET.

Tal vez te refieras a que ni siquiera se activa el lector ?
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 41304
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: Lectora Laser

Postby diegopolverelli » Fri Jul 02, 2010 5:43 pm

Hola, Antonio: en efecto, el lector ni siquiera se activa. Si uso el programita trucho MCL, de prueba, si. Anda, y lee. Evidentemente hay algún código que entiende el lector, para arrancar. ¿tienen idea que puede ser? Gracias...!!!
diegopolverelli
 
Posts: 149
Joined: Thu Jun 21, 2007 3:26 pm

Re: Lectora Laser

Postby Antonio Linares » Fri Jul 02, 2010 7:20 pm

Diego,

Creo que este es el código que necesitas :-)

viewtopic.php?p=88165#p88165

Osvaldo Ramirez ya usó la MC1000 y publicó el código para usarla :-)
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 41304
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: Lectora Laser

Postby diegopolverelli » Fri Jul 02, 2010 7:50 pm

que es #pragma???
no conozco esa instrucción , y me esta dando "Error E0024 error en #pragma" cuando ejecuto el buildce
Gracias...!!!
diegopolverelli
 
Posts: 149
Joined: Thu Jun 21, 2007 3:26 pm

Re: Lectora Laser

Postby Antonio Linares » Sat Jul 03, 2010 8:28 am

Diego,

#pragma BEGINDUMP
y
#pragma ENDDUMP

sirven para incluir código en C directamente dentro de un PRG. El error que comentas posiblemente se deba a que te falta uno de los ficheros de cabecera .h usados en ese código en C.

Escribe aqui los errores que te aparecen
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 41304
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: Lectora Laser

Postby diegopolverelli » Mon Jul 05, 2010 11:15 am

  ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
Compiling...
Harbour 2.0.0 (Rev. 13372)
Copyright (c) 1999-2010, http://www.harbour-project.org/
Compiling 'mc1000.prg' and generating preprocessed output to 'mc1000.ppo'...
1 error

No code generated.
mc1000.prg(9) Error E0024 Error in #pragma
* Compile errors *

C:\fwppc\SAMPLES>

y adento del mc1000.ppo:

#line 221 "c:\harbour_ce\include\hbclass.ch"
DECLARE HBClass New( cName AS STRING, OPTIONAL SuperParams ) AS CLASS HBClas
#line 11 "mc1000.prg"
FUNCTION Main()


PRIVATE oWnd
PRIVATE cLog := ""
PRIVATE nCant := 1 , oCant
PRIVATE nExist := 0
PRIVATE oInvPC , oMsg , oMarca, oPrecio , oDes , oMsg2
PRIVATE cBarCode := space(15) , oBarCode
PRIVATE files_dir := "\\caja1\c\"


PRIVATE nContador := 0 , oContador
PRIVATE cEncargado := space(15) , oEncargado
PRIVATE cCurDir := GetCurDir()
PRIVATE lUsers := .F.

PRIVATE dFecha := date() , oFecha
PRIVATE cHora := time() , oHora
diegopolverelli
 
Posts: 149
Joined: Thu Jun 21, 2007 3:26 pm

Re: Lectora Laser

Postby Antonio Linares » Mon Jul 05, 2010 3:53 pm

Diego,

Comenta esta línea en el PRG:

// #pragma comment (lib,"scnapi32")
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 41304
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: Lectora Laser

Postby diegopolverelli » Mon Jul 05, 2010 7:52 pm

no hay caso...

Compiling...
Harbour 2.0.0 (Rev. 13372)
Copyright (c) 1999-2010, http://www.harbour-project.org/
Compiling 'mc1000.prg' and generating preprocessed output to 'mc1000.ppo'...
Lines 2886, Functions/Procedures 11
Generating C source output to 'mc1000.c'... Done.
Microsoft (R) C/C++ Optimizing Compiler Version 12.20.9615 for ARM
Copyright (C) Microsoft Corp 1984-2002. All rights reserved.

mc1000.c
c:\harbour_ce\include\scandef.h(28) : fatal error C1083: Cannot open include fil
e: 'StrucInf.h': No such file or directory
LINK : fatal error LNK1181: cannot open input file 'mc1000.obj'
* Linking errors *

c:\fwppc\SAMPLES>


alguna idea???
diegopolverelli
 
Posts: 149
Joined: Thu Jun 21, 2007 3:26 pm

Re: Lectora Laser

Postby Antonio Linares » Tue Jul 06, 2010 2:43 am

Diego,

Ahora lo que te falta es el fichero strucinf.h propio del MC1000.

Aqui se explica en donde conseguirlo :-)
viewtopic.php?p=88361#p88361
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 41304
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: Lectora Laser

Postby Antonio Linares » Tue Jul 06, 2010 2:45 am

Lo copio aqui para que no se pierda :-)

StrucInf.h
Code: Select all  Expand view

//--------------------------------------------------------------------
// FILENAME:            StrucInf.h
//
// Copyright(c) 1999,2000 Symbol Technologies Inc. All rights reserved.
//
// DESCRIPTION:         Constants and types used for structure information
//
// NOTES:               Public
//
//
//--------------------------------------------------------------------


#ifndef STRUCINF_H_
#define STRUCINF_H_

#ifdef __cplusplus
extern "C"
{
#endif


#ifdef _X86_
#ifndef _x86_
#define _x86_
#endif
#endif


// Structure information structure

typedef struct tagSTRUCT_INFO
{
    DWORD   dwAllocated;                // Size of allocated structure in bytes
    DWORD   dwUsed;                     // Amount of structure actually used

} STRUCT_INFO;

typedef STRUCT_INFO * LPSTRUCT_INFO;


// Struct Info Macros

#define SI_FIELD_OFFSET(ptr,fld) \
    ( (UINT) ((((LPBYTE)(&((ptr)->fld))) - (LPBYTE)ptr)) )

#define SI_FIELD_SIZE(ptr,fld) \
    ( sizeof((ptr)->fld) )

#define SI_FIELD_EXTENT(ptr,fld) \
    ( SI_FIELD_OFFSET(ptr,fld) + SI_FIELD_SIZE(ptr,fld) )

#define SI_FIELD_VALID(ptr,fld) \
  ( (ptr)->StructInfo.dwUsed >= SI_FIELD_EXTENT(ptr,fld) )

#define SI_FIELD_EXISTS(ptr,fld) \
  ( (ptr)->StructInfo.dwAllocated >= SI_FIELD_EXTENT(ptr,fld) )

#define SI_ALLOC_ALL(ptr) \
    { (ptr)->StructInfo.dwAllocated = sizeof(*(ptr)); }

#define SI_USED_NONE(ptr) \
    { (ptr)->StructInfo.dwUsed = sizeof(STRUCT_INFO); }

#define SI_INIT(ptr) \
    { SI_ALLOC_ALL(ptr); SI_USED_NONE(ptr); }

#define SI_INVALID(ptr) \
    ( \
        ((ptr)->StructInfo.dwAllocated < sizeof(STRUCT_INFO)) \
        || ((ptr)->StructInfo.dwAllocated < (ptr)->StructInfo.dwUsed) \
    ) \

#define SI_VALID(ptr) \
    ( ! SI_INVALID(ptr) )

#define SI_GET_POINTER(ptr,fld,type)\
    (SI_FIELD_VALID(ptr,fld) && (0 != ptr->fld)) ? (type)((LPBYTE)ptr + ptr->fld) : NULL

#define SI_SET_USED(ptr,fld) \
    { if ( ! SI_FIELD_VALID(ptr,fld) ) (ptr)->StructInfo.dwUsed = SI_FIELD_EXTENT(ptr,fld); }

#define SI_SET_FIELD(ptr,fld,src) \
    { if ( SI_FIELD_EXISTS(ptr,fld) ) { (ptr)->fld = src; SI_SET_USED(ptr,fld); } }

#define SI_GET_FIELD(ptr,fld,dst) \
    { if ( SI_FIELD_VALID(ptr,fld) ) dst = (ptr)->fld; }

#define SI_SET_IF_CHANGED(ptr,fld,src) \
    { if ( src != PARAMETER_NO_CHANGE ) SI_SET_FIELD((ptr),fld,src); }
 
#define SI_SET_STRING_W(ptr,fld,src) \
    { if ( SI_FIELD_EXISTS(ptr,fld) ) \
        { \
            int size = sizeof((ptr)->fld)/sizeof(WCHAR); \
            wcsncpy((ptr)->fld,src,size); \
            (ptr)->fld[size-1] = L'\0'; \
            SI_SET_USED(ptr,fld); \
        } \
    }

#define SI_GET_STRING_W(ptr,fld,dst) \
    { \
        if ( SI_FIELD_VALID(ptr,fld) ) \
            wcscpy(dst,(ptr)->fld); \
    }

#define SI_SET_STRING_A(ptr,fld,src) \
    { if ( SI_FIELD_EXISTS(ptr,fld) ) \
        { \
            int size = sizeof((ptr)->fld); \
            strncpy((ptr)->fld,src,size); \
            (ptr)->fld[size-1] = ('\0'); \
            SI_SET_USED(ptr,fld); \
        } \
    }

#define SI_GET_STRING_A(ptr,fld,dst) \
    { \
        if ( SI_FIELD_VALID(ptr,fld) ) \
            strcpy(dst,(ptr)->fld); \
    }

#ifdef UNICODE

#define SI_SET_STRING SI_SET_STRING_W

#define SI_GET_STRING SI_GET_STRING_W

#else

#define SI_SET_STRING SI_SET_STRING_A

#define SI_GET_STRING SI_GET_STRING_A

#endif

// Macro to copy wide character string to ANSI structure member
#define SI_SET_STRING_WA(ptr,fld,src) \
    { if ( SI_FIELD_EXISTS(ptr,fld) ) \
        { \
            int srclen = sizeof(src)/sizeof(src[0]); \
            int dstlen = sizeof((ptr)->fld); \
            WideCharToMultiByte(CP_OEMCP, 0, src, srclen, (ptr)->fld, dstlen, NULL, NULL); \
            (ptr)->fld[dstlen-1] = '\0'; \
            SI_SET_USED(ptr,fld); \
        }\
    }

// Macro to copy ANSI string to wide character structure member
#define SI_SET_STRING_AW(ptr,fld,src) \
    { if ( SI_FIELD_EXISTS(ptr,fld) ) \
        { \
            int srclen = sizeof(src); \
            int dstlen = sizeof((ptr)->fld)/sizeof((ptr)->fld[0]); \
            MultiByteToWideChar(CP_OEMCP, MB_PRECOMPOSED, (LPSTR) src, srclen, (LPWSTR)(ptr)->fld, dstlen); \
            (ptr)->fld[dstlen-1] = L'\0'; \
            SI_SET_USED(ptr,fld); \
        }\
    }


//-----------------------------------------------------------------------------
// Helper function prototypes
//-----------------------------------------------------------------------------

BOOL CopyStructInfo(LPSTRUCT_INFO lpDest, LPSTRUCT_INFO lpSource);


#ifdef __cplusplus
}
#endif

#endif  // #ifndef STRUCINF_H_
 
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 41304
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: Lectora Laser

Postby diegopolverelli » Tue Jul 06, 2010 12:42 pm

Gracias...!!! y perdon, maestro... pero a mi me sacas de los IF / Case, Do While, y soy boleta... ¿alguna idea de que es esto que pego abajo? (lo que hice fue pegar el código que pusiste arriba en un notepado, guardarlo como strucinf.h, ponerlo en INCLUDE y tratar de compilar nuevamente. Gracias...!!!

Compiling...
Harbour 2.0.0 (Rev. 13372)
Copyright (c) 1999-2010, http://www.harbour-project.org/
Compiling 'mc1000.prg' and generating preprocessed output to 'mc1000.ppo'...
Lines 2886, Functions/Procedures 11
Generating C source output to 'mc1000.c'... Done.
Microsoft (R) C/C++ Optimizing Compiler Version 12.20.9615 for ARM
Copyright (C) Microsoft Corp 1984-2002. All rights reserved.

mc1000.c
mc1000.prg(401) : warning C4090: 'function' : different 'const' qualifiers
mc1000.prg(401) : warning C4024: 'AnsiToWide' : different types for formal and
ctual parameter 1
mc1000.prg(429) : warning C4020: 'hb_stornl' : too many actual parameters
mc1000.prg(430) : warning C4020: 'hb_stornl' : too many actual parameters
mc1000.prg(431) : warning C4020: 'hb_stornl' : too many actual parameters
mc1000.prg(432) : warning C4020: 'hb_stornl' : too many actual parameters
mc1000.prg(433) : warning C4020: 'hb_stornl' : too many actual parameters
mc1000.prg(434) : warning C4020: 'hb_stornl' : too many actual parameters
mc1000.prg(435) : warning C4020: 'hb_stornl' : too many actual parameters
mc1000.prg(436) : warning C4020: 'hb_stornl' : too many actual parameters
mc1000.prg(437) : warning C4020: 'hb_stornl' : too many actual parameters
mc1000.obj : error LNK2019: unresolved external symbol SCAN_DeallocateBuffer_W
eferenced in function HB_FUN_SCAN_OPEN
mc1000.obj : error LNK2019: unresolved external symbol SCAN_ReadLabelWait_W ref
renced in function HB_FUN_SCAN_OPEN
mc1000.obj : error LNK2019: unresolved external symbol SCAN_AllocateBuffer_W re
erenced in function HB_FUN_SCAN_OPEN
mc1000.obj : error LNK2019: unresolved external symbol SCAN_SetSoftTrigger refe
enced in function HB_FUN_SCAN_OPEN
mc1000.obj : error LNK2019: unresolved external symbol SCAN_Enable referenced i
function HB_FUN_SCAN_OPEN
mc1000.obj : error LNK2019: unresolved external symbol SCAN_Open referenced in
unction HB_FUN_SCAN_OPEN
mc1000.exe : fatal error LNK1120: 6 unresolved externals
* Linking errors *

C:\fwppc\SAMPLES>
diegopolverelli
 
Posts: 149
Joined: Thu Jun 21, 2007 3:26 pm

Re: Lectora Laser

Postby diegopolverelli » Tue Jul 06, 2010 4:42 pm

Lo logre...!!! Me baje algo que se llama EMDK for C v2.2 del siguiente link:

http://support.symbol.com/support/searc ... 2025289929

adentro tenía muchas cosas, inclusive un monton de librerias. Enlacé la SCNAPI32.DLL en el buidce y listo... me tira los warning, pero igual compila, y lee en el MC1000.

GRACIAS, TOTALES...!!!.
Ahora por esto, por la ayuda, y por la paliza que nos dieron el sábado los alemanes, voy a alentar por España... CHAU...!!! y gracias de nuevo. Atte.
diegopolverelli
 
Posts: 149
Joined: Thu Jun 21, 2007 3:26 pm

Re: Lectora Laser

Postby Antonio Linares » Tue Jul 06, 2010 5:26 pm

Diego,

Muy bien! :-)
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 41304
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: Lectora Laser

Postby ramirezosvaldo2 » Sun Jul 11, 2010 12:01 am

Estimados. ...

Me da gusto que el codigo que una vez pusimos, lo esten usando.

Aun asi, les comento que el programa que hize para las MC3000 y MC1000 lo sigo usando

He puesto algunas cositas, pero no muchas como otros lo han echo.

Si alguien quiere mis nuevos cambios, ( no son muchos ), con toda confianza

Saludos
Osvaldo Ramirez
ramirezosvaldo2
 
Posts: 58
Joined: Mon Jan 19, 2009 4:40 pm

Next

Return to FiveWin para Pocket PC

Who is online

Users browsing this forum: No registered users and 2 guests