Imprimir

Postby pymsoft » Mon Nov 13, 2006 9:59 am

Antonio: puedo enviarte los .lib a ver si tu los puedes hacer funcionar? porque de repente soy yo que no logra hacerlo funcionar, capaz que me falta hacer algo, no lo se.
User avatar
pymsoft
 
Posts: 383
Joined: Tue Oct 11, 2005 1:01 pm
Location: Savona - Italia

Postby Antonio Linares » Mon Nov 13, 2006 5:49 pm

Pedro,

Envíamelos en un ZIP, gracias
regards, saludos

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

Postby pymsoft » Tue Nov 14, 2006 8:49 am

enviado a tu privado.


gracias.
Pedro Gonzalez
User avatar
pymsoft
 
Posts: 383
Joined: Tue Oct 11, 2005 1:01 pm
Location: Savona - Italia

Postby pymsoft » Wed Nov 15, 2006 8:43 am

Antonio: me han enviado las nuevas librerias creadas para ARMV4, pero me sigue dando errores.

Code: Select all  Expand view
teve.c
   Creating library teve.lib and object teve.exp
teve.obj : error LNK2019: unresolved external symbol "int __cdecl Prt_TestPrint(
void)" (?Prt_TestPrint@@YAHXZ) referenced in function "void __cdecl HB_FUN_PRT_T
ESTPRINT(void)" (?HB_FUN_PRT_TESTPRINT@@YAXXZ)
teve.exe : fatal error LNK1120: 1 unresolved externals




Mi funcion:

Code: Select all  Expand view
#pragma BEGINDUMP

#include <hbapi.h>
#include <windows.h>
//#include <c:\lavwin\teve\mobitron\inc\printer.h>
#include <c:\lavwin\teve\mobitron\inc\printerNET.h>

int Prt_TestPrint( void );

HB_FUNC( PRT_TESTPRINT )
{
   hb_retnl( Prt_TestPrint() );
}

#pragma ENDDUMP


y esto lo agregué en buildce.bat


Code: Select all  Expand view
echo \lavwin\teve\mobitron\lib\printerNET.lib >> msvc.tmp
echo \lavwin\teve\mobitron\lib\printerAPI.lib >> msvc.tmp
Pedro Gonzalez
User avatar
pymsoft
 
Posts: 383
Joined: Tue Oct 11, 2005 1:01 pm
Location: Savona - Italia

Postby Antonio Linares » Wed Nov 15, 2006 8:59 am

Pedro,

Haz este cambio:

extern "C" {
int Prt_TestPrint( void );
}

En la nueva versión de FWPPC ya no es preciso, ya que no se compila en modo C++ (flag -TP).
regards, saludos

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

Postby pymsoft » Wed Nov 15, 2006 10:11 am

Antonio: supongo que tenia que dejarlo asi:
Pero sigue sin funcionar


Code: Select all  Expand view
#pragma BEGINDUMP

#include <hbapi.h>
#include <windows.h>
#include <c:\lavwin\teve\mobitron\inc\printer.h>

extern "C" {
int Prt_TestPrint( void );
}

HB_FUNC( PRT_TESTPRINT )
{
   hb_retnl( Prt_TestPrint() );
}

#pragma ENDDUMP



El error:

Code: Select all  Expand view

teve.obj : error LNK2019: unresolved external symbol Prt_TestPrint referenced in
function "void __cdecl HB_FUN_PRT_TESTPRINT(void)" (?HB_FUN_PRT_TESTPRINT@@YAXX
Z)

Pedro Gonzalez
User avatar
pymsoft
 
Posts: 383
Joined: Tue Oct 11, 2005 1:01 pm
Location: Savona - Italia

Postby Antonio Linares » Wed Nov 15, 2006 11:56 am

Pedro,

Si revisas la LIB por dentro, con un editor binario, verás que el nombre de la función es distinto:
Code: Select all  Expand view
#pragma BEGINDUMP

#include <hbapi.h>
#include <windows.h>
#include <c:\lavwin\teve\mobitron\inc\printer.h>

extern "C" {
int PRT_TestPrint( void );
}

HB_FUNC( PRT_TESTPRINT )
{
   hb_retnl( PRT_TestPrint() );
}

#pragma ENDDUMP
regards, saludos

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

Postby pymsoft » Wed Nov 15, 2006 1:06 pm

Antonio, (parece una pesadilla)

Revisé la lib por dentro (printerApi.lib) y lo veo escrito asi:

Prt_TestPrint



por lo cual escribí el codigo asi:

Code: Select all  Expand view
#pragma BEGINDUMP

#include <hbapi.h>
#include <windows.h>
#include <c:\lavwin\teve\mobitron\inc\printer.h>

extern "C" {
int Prt_TestPrint( void );
}

HB_FUNC( PRT_TESTPRINT )
{
   hb_retnl( Prt_TestPrint() );
}

#pragma ENDDUMP



agregada la libreria en buildce.bat


al compilar me da este error:

teve.c
Creating library teve.lib and object teve.exp
teve.obj : error LNK2019: unresolved external symbol Prt_TestPrint referenced in
function "void __cdecl HB_FUN_PRT_TESTPRINT(void)" (?HB_FUN_PRT_TESTPRINT@@YAXX
Z)
teve.exe : fatal error LNK1120: 1 unresolved externals






P.D. Tu pudiste compilarlo y no te da errores?
Pedro Gonzalez
User avatar
pymsoft
 
Posts: 383
Joined: Tue Oct 11, 2005 1:01 pm
Location: Savona - Italia

Postby Antonio Linares » Wed Nov 15, 2006 5:54 pm

Pedro,

Tienes clases en C++ dentro de la libreria!:
Code: Select all  Expand view
class __declspec(dllexport) CPrinter 
{
public:
//   INT Prt_CheckCover(BOOL *blCover);
   INT Prt_CheckHeadTemper(BOOL *blTemper);
   INT Prt_CheckPaper(BOOL *blPaper);
   INT WriteBitmap_BelowStandard(LPCTSTR bmFile);
   INT Prt_BackFeed(int n);
   INT getSerialProperty(DCB *lpDcb);
   INT PrinterDeSelect(HANDLE prt_pHandle);
   INT Prt_PortOpen();
   INT Prt_PortRelease();
   INT Prt_PrintBarcode(char *barData, int height, int width, int barcodeSystem, int codeHRI);
   INT Prt_CheckStatus(PRT_STATUS * status);
   INT Prt_TestPrint();
                ...

Vas a tener que instanciar un objeto en C++ y usarlo desde tu aplicación.

Prueba esto:
Code: Select all  Expand view
#pragma BEGINDUMP

#include "hbapi.h"
#include "Printer.h"  // de los ficheros que te han enviado

HB_FUNC( PRT_TESTPRINT )
{
   CPrinter * printer = new CPrinter;

   printer->Prt_TestPrint();
}

#pragma ENDDUMP
regards, saludos

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

Postby pymsoft » Wed Nov 15, 2006 6:15 pm

Antonio: ahora compila sin errores.

hago la prueba de imprimir y no imprime, supongo que porque tengo que abrir la impresora luego hacer el test y luego cerrarla, lo hago de este modo, pero tampoco funciona, alguna idea?

Code: Select all  Expand view
#pragma BEGINDUMP

#include "hbapi.h"
#include "windows.h"
#include "c:\lavwin\teve\mobitron\inc\Printer.h"

HB_FUNC( PRT_TESTPRINT )
{
   CPrinter * printer = new CPrinter;

   printer->Prt_Open();
   printer->Prt_TestPrint();
   printer->Prt_Close();
}

#pragma ENDDUMP


Que estoy haciendo mal?

Gracias
Pedro Gonzalez
User avatar
pymsoft
 
Posts: 383
Joined: Tue Oct 11, 2005 1:01 pm
Location: Savona - Italia

Postby Antonio Linares » Wed Nov 15, 2006 6:38 pm

Pedro,

Tendrás que revisar la documentación de ese producto y los ejemplos que proporcionan para ver como es la secuencia correcta de llamadas.
regards, saludos

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

Postby pymsoft » Thu Nov 16, 2006 8:27 am

Antonio,

la secuencia sería como està escrito en el codigo que te enviè antes. La pregunta es: esta bien escrito lo que puse?, porque por lo que entiendo, las llamadas a open, printest y close son metodos de la clase print, es asi?

gracias
Pedro Gonzalez
User avatar
pymsoft
 
Posts: 383
Joined: Tue Oct 11, 2005 1:01 pm
Location: Savona - Italia

Postby Antonio Linares » Thu Nov 16, 2006 9:29 am

Pedro,

Sí, tu código es correcto.
regards, saludos

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

Postby pymsoft » Thu Nov 16, 2006 9:40 am

Antonio,


Gracias


Voy a tratar de entender entonces por cual motivo no funciona, voy a usar el beep que es mas simple para hacer las pruebas.
Pedro Gonzalez
User avatar
pymsoft
 
Posts: 383
Joined: Tue Oct 11, 2005 1:01 pm
Location: Savona - Italia

Postby pymsoft » Thu Nov 16, 2006 10:34 am

Antonio,


La clase Beep funciona :D

Code: Select all  Expand view

***************
STATIC FUNCTION ProvaStampa()
***************
LOCAL i

FOR i := 1 TO 100
  Beep_on( 200 + i * 100, 100 )
NEXT

RETURN NIL
*
** eof ProvaStampa


#pragma BEGINDUMP

#include "hbapi.h"
#include "windows.h"
#include "c:\lavwin\teve\mobitron\inc\Printer.h" 
#include "c:\lavwin\teve\mobitron\inc\Beep.h" 

HB_FUNC( PRT_TESTPRINT )
{
   CPrinter * printer = new CPrinter;

   printer->Prt_Open();
   printer->Prt_TestPrint();
   //printer->Prt_Close();
}


HB_FUNC( BEEP_ON )
{
   CBeep * Beep = new CBeep;

   Beep->Beep_On( hb_parni(1), hb_parni(2));

}

#pragma ENDDUMP





Ahora voy a tratar de entender por que no funciona la impresora.
Te agradezco muchisimo tu ayuda para resolver mi problema.
Ahora, a aprender un poco de C++....
Pedro Gonzalez
User avatar
pymsoft
 
Posts: 383
Joined: Tue Oct 11, 2005 1:01 pm
Location: Savona - Italia

PreviousNext

Return to FiveWin para Pocket PC

Who is online

Users browsing this forum: No registered users and 2 guests