FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin para Pocket PC Problems con una funcion en C
Posts: 101
Joined: Mon Oct 10, 2005 06:48 PM
Problems con una funcion en C
Posted: Fri Dec 09, 2005 12:28 AM

Hola Colegas

Este es el codigo :

include "FWCE.ch"

function Main()
* begin
local oWnd

DEFINE WINDOW oWnd TITLE "Active Scan"

@ 2, 2 BUTTON "Scan_Open" ACTION SCAN_OPEN() SIZE 80, 20
ACTIVATE WINDOW oWnd

return nil

  • Funciones que no corren en Symbol MC3000
    function cesetmenu() ; return nil
    function getmenu() ; return nil
    function readbitmap() ; return nil
    function palbmpread() ; return nil

pragma BEGINDUMP

include <hbapi.h>

include <windows.h>

include <ScanCAPI.h>

HANDLE hScanner = NULL;
TCHAR szScannerName[MAX_PATH] = L"SCN1:";

HB_FUNC( SCAN_OPEN )
{
DWORD dwResult = SCAN_Open( szScannerName, &hScanner );

if ( dwResult != E_SCN_SUCCESS ) 
   MessageBox( GetActiveWindow(), L"Fallo en Scan_Open", L"Ok", 0 );

}

pragma ENDDUMP

Y este es el mensaje :

bitest1.c
Creating library jobitest1.lib and object jobitest1.exp
bitest1.obj : error LNK2019: unresolved external symbol SCAN_Open referenced i
function "void __cdecl HB_FUN_SCAN_OPEN(void)" (?HB_FUN_SCAN_OPEN@@YAXXZ)
bitest1.exe : fatal error LNK1120: 1 unresolved externals

Espero no importunar mucho.

Saludos
Osvaldo Ramirez

Posts: 44162
Joined: Thu Oct 06, 2005 05:47 PM
Problems con una funcion en C
Posted: Fri Dec 09, 2005 12:39 AM

Osvaldo,

Tienes que enlazar un fichero LIB para las funciones de la DLL.

La forma de construir ese fichero LIB es:

implib.exe nombre_dll.lib nombre_dll.dll

Y enlazar el fichero LIB resultante como una lib más en buildce.bat.

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 101
Joined: Mon Oct 10, 2005 06:48 PM
Problems con una funcion en C
Posted: Fri Dec 09, 2005 01:36 AM

Estimado antonio, voy a intentarlo ....

Estoy haciendo esto, pero se tarda mucho y no se si estoy bien.
Si no habro el indice es rapido, pero si lo abro el indice, se tarda siglos

USE (ventas_dir+"05051207.DBF") ALIAS DIARIO NEW
if ! NETERR()
GO TOP
USE ( files_dir+"ARTICUL.DBF") ALIAS ARTICUL NEW
if ! neterr()
SET INDEX TO ( files_dir+"ARTICUL3.NTX" )

  GO TOP

  DEFINE WINDOW oWnd TITLE "TomaInv"

  @ 1, 2 SAY "Cantidad:" SIZE 70, 20
  @ 1,11 GET nCant picture "9999" SIZE 35, 20
  @ 3.0, 2 SAY "Bar-Code:" SIZE 70, 20
  @ 3.0,11 GET cBarCode picture "@!" SIZE 110, 20


  @ 12, 2 BUTTON "Revisar" SIZE 80, 30 ACTION revisar(cBarCode,nCant)
  @ 12,15 BUTTON "Terminar" SIZE 80, 30 ACTION oWnd:End()

  ACTIVATE WINDOW oWnd 
else
   msginfo("Error en apertura de articulos")
endif

ELSE
msginfo("Error en apertura del diario")
ENDIF

return nil

Saludos
Osvaldo Ramirez

Posts: 101
Joined: Mon Oct 10, 2005 06:48 PM
Problems con una funcion en C
Posted: Fri Dec 09, 2005 01:45 AM

Estimados Colegas ...

ya encontre un implib.exe dentro de un directorio de borland, e hice lo un scnapi32.lib

A este lo puse q lo agregara en buildce.bat
y listo : Pero creo que no se creo bien el scnapi32.lib , pues dice que esta corrupto.

alguien tiene por ahi un implib.exe para Pockemones ...

Saludos
Osvaldo Ramirez

Posts: 44162
Joined: Thu Oct 06, 2005 05:47 PM
Problems con una funcion en C
Posted: Fri Dec 09, 2005 10:22 PM

Osvaldo,

Prueba a NO llamar a NetErr(). No te hace falta, ya que si no se abriese la base de datos, Harbour generaría un error. Y tal vez ahí esté la pérdida de tiempo.

Me equivoqué al indicarte implib.exe, ya que se generaría una LIB en formato OMF y Microsoft usa formato COFF.

EnvĂ­ame la DLL como ZIP y te generamos la LIB aquĂ­.

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 44162
Joined: Thu Oct 06, 2005 05:47 PM
Problems con una funcion en C
Posted: Fri Dec 09, 2005 10:43 PM

Osvaldo,

La forma correcta de generar el fichero LIB es:

  1. Crear el fichero DEF a partir desde la DLL:

impdef.exe scnapi32.def scnapi32.dll

  1. Crear la LIB a partir del fichero DEF:

lib.exe /def:scnapi32.def /machine:arm /out:scnapi32.lib

regards, saludos

Antonio Linares
www.fivetechsoft.com

Continue the discussion