DLL

DLL

Postby Maurizio » Fri Nov 17, 2006 3:27 pm

Hello Antonio

I have a cash register with Windows CE.NET 4.20
The program works very well.

Now I have to link with a DLL , I need only 3 functions
1) DLL FUNCTION RCHOpen() AS LONG PASCAL FROM "RCHOpen" LIB "RCHGlobe.dll"
2) DLL FUNCTION RCHClose() AS LONG PASCAL FROM "RCHClose" LIB "RCHGlobe.dll"

This 2 functions works and return correctly 0

3) DLL FUNCTION RCHSendData(sIn AS STRING ,sOut AS STRING) AS LONG PASCAL FROM "RCHSendData" LIB "RCHGlobe.dll"

VB.NET Code is = Public Shared Function RCHSendData(ByVal a As String, ByVal b As String) As Int32 )

I call the function

sIn := AnsiToWide("=K")
sOut := AnsiToWide(space(40))
nRet := RchSendData(sIn,sOut)


But return always an error
(I try without AnsiToWide)


Antonio , are you able to give me some clue as to solve this problem ?

Regards MAurizio





















I know that this problem could be due to the cash.
Antonio , are you able to give me some clue as to solve this problem ?
User avatar
Maurizio
 
Posts: 593
Joined: Mon Oct 10, 2005 1:29 pm

Re: DLL

Postby Enrico Maria Giordano » Fri Nov 17, 2006 4:27 pm

Maurizio wrote:3) DLL FUNCTION RCHSendData(sIn AS STRING ,sOut AS STRING) AS LONG PASCAL FROM "RCHSendData" LIB "RCHGlobe.dll"


Try AS LPSTR instead of the two AS STRING.

EMG
User avatar
Enrico Maria Giordano
 
Posts: 6655
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Postby Maurizio » Fri Nov 17, 2006 5:21 pm

Ciao Enrico

unfortunately I have already tryed .

Thank Maurizio
User avatar
Maurizio
 
Posts: 593
Joined: Mon Oct 10, 2005 1:29 pm

Postby Enrico Maria Giordano » Fri Nov 17, 2006 5:29 pm

It may be that the DLL command is not fully implemented in FWPPC yet.

Antonio?

EMG
User avatar
Enrico Maria Giordano
 
Posts: 6655
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Postby Antonio Linares » Fri Nov 17, 2006 10:29 pm

Enrico,

The DLL command is fully working.

Maurizio, what error code do you get ?
regards, saludos

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

Postby Maurizio » Sat Nov 18, 2006 8:34 am

The Function RCHSendData return -104 , parameters non correctly.

Maurizio
User avatar
Maurizio
 
Posts: 593
Joined: Mon Oct 10, 2005 1:29 pm

Postby Antonio Linares » Sat Nov 18, 2006 9:05 am

Maurizio,

Have you tried to supply the parameters without calling AnsiToWide() ?

Please use LPSTR as Enrico has pointed,
regards, saludos

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

Postby Maurizio » Sat Nov 18, 2006 12:14 pm

Yes I tryed without AnsiToWide() and with LPSTR
but without success

Maurizio
User avatar
Maurizio
 
Posts: 593
Joined: Mon Oct 10, 2005 1:29 pm

Postby Antonio Linares » Sat Nov 18, 2006 12:49 pm

Maurizio,

I suggest you that you try a C wrapper, without using DLL FUNCTION to see if that makes a difference.
regards, saludos

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

Postby Antonio Linares » Sat Nov 18, 2006 12:52 pm

Code: Select all  Expand view
#pragma BEGINDUMP

#include <hbapi.h>

HB_FUNC( RCHSENDDATA )
{
   hb_retnl( RCHSendData( hb_parc( 1 ), hb_parc( 2 ) ) );
}

#pragma ENDDUMP

You need to link RCHGlobe.lib.
regards, saludos

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

Postby Maurizio » Sat Nov 18, 2006 1:20 pm

Antonio

I Try

implib.exe RCHGlobe.lib RCHGlobe.DLL
and I have the LIB

but when I link RCHGlobe.lib i had
c:\harbour_ce\lib\RCHglobe.lib : fatal error LNK1136: invalid or corrupt file

Maurizio
User avatar
Maurizio
 
Posts: 593
Joined: Mon Oct 10, 2005 1:29 pm


Postby Maurizio » Sat Nov 18, 2006 1:32 pm

Enrico

nella cartella VCE non trovo implib.exe
ho usato quella di Borland
dove posso trovarla quella per MSVCE ?
MAurizio
User avatar
Maurizio
 
Posts: 593
Joined: Mon Oct 10, 2005 1:29 pm

Postby Enrico Maria Giordano » Sat Nov 18, 2006 1:37 pm

Usa LINK.EXE con lo switch /IMPLIB (link /? per le varie opzioni).

EMG
User avatar
Enrico Maria Giordano
 
Posts: 6655
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Postby Maurizio » Mon Nov 20, 2006 7:19 am

Antonio
cann you help me with a problem . I am not able to transform the DLL in the LIB .
Thank to Enrico's help I use this command , but it dosnt work.

c:\vce\bin\link corelibc.lib /LIBPATH:c:\vce\lib\arm /NOLOGO /SUBSYSTEM:WINDOWSCE,4.20 /MACHINE:ARM /DLL /IMPLIB:rchglobe.dll /OUT:rchglobe.lib

Regards MAurizio
User avatar
Maurizio
 
Posts: 593
Joined: Mon Oct 10, 2005 1:29 pm

Next

Return to FiveWin for Pocket PC

Who is online

Users browsing this forum: No registered users and 2 guests