FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour create a pcode dll
Posts: 1283
Joined: Fri Feb 10, 2006 02:34 PM
Re: create a pcode dll
Posted: Mon Jan 12, 2009 09:03 AM
Antonio,

I'm thinking that's a good sample, and i have curiosity for the correct use and compiling. The sample dll maybe can be:

MyDll.dll

Function OneParam( aData )
*-------------------------
	LOCAL nI
	LOCAL nTotal := Len(aData)

	FOR nI := 1 TO nTotal

		MsgInfo( aData[ nI ][ 1 ]               + CRLF + ;
               aData[ nI ][ 2 ]               + CRLF + ;
               Str( aData[ nI ][ 3 ] )        + CRLF + ;
               cValToChar( aData[ nI ][ 4 ] ) + CRLF + ;
               DToC( aData[ nI ][ 5 ] )   		  

	NEXT

RETU .T.
Salutacions, saludos, regards

"...programar es fácil, hacer programas es difícil..."

UT Page -> https://carles9000.github.io/
Forum UT -> https://discord.gg/bq8a9yGMWh
HIX -> https://github.com/carles9000/hix
Posts: 204
Joined: Mon Oct 17, 2005 09:09 PM
Re: create a pcode dll
Posted: Mon Jan 12, 2009 05:07 PM

Antonio,

I am using the samples testdllp.prg and pcodell.prg
The pcodedll.prg is giving me the following when I try to make with the buildhdp.bat

Turbo Incremental Link 5.00 Copyright (c) 1997, 2000 Borland
Error: Unresolved external '_HB_FUN___CLSINST' referenced from T:\FWH\SAMPLES\PC
ODEDLL.OBJ
Error: Unresolved external '_HB_FUN_PCOUNT' referenced from T:\FWH\SAMPLES\PCODE
DLL.OBJ
Error: Unresolved external '_HB_FUN_HB_APARAMS' referenced from T:\FWH\SAMPLES\P
CODEDLL.OBJ

Any help is greatly appreciated.

Don Lowenstein
www.laapc.com
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: create a pcode dll
Posted: Mon Jan 12, 2009 05:26 PM

Don,

Have you modified buildhdp.bat to call xHarbour instead of Harbour ?

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 204
Joined: Mon Oct 17, 2005 09:09 PM
Re: create a pcode dll
Posted: Mon Jan 12, 2009 05:46 PM

Thank you for your prompt response - can we create a pcode dll in xharbour?

Don Lowenstein
www.laapc.com
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: create a pcode dll
Posted: Mon Jan 12, 2009 09:02 PM

Don,

Yes, they can be created with xharbour too.

But buildhdp.bat has to be modified to call xharbour.exe and use the xharbour libraries.

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 204
Joined: Mon Oct 17, 2005 09:09 PM
Re: create a pcode dll
Posted: Mon Jan 12, 2009 11:05 PM
Antonio,

Thank you for all of your assistance - we have been successful in creating a pcode dll passing parameters as needed. :-)

Here is what we have -

xHarbour calling exe:
function Main()
local dllret, dparm := date(), lparm := .t.
local aparm := {'a', date(), 4321,.t.,{'c'}}
local hDll := LoadLibrary( "mypdll.dll" )
private p1
m->p1 := 'this is a private var'
altd(1)
altd()
//**HB_LibDo( "DLLInit" )
dllret := HB_LibDo( "mydllFunc", {'tstparm1', 'aparm2', 1234, dparm, lparm, aparm } )
? dllret
return .t.



xHarbour pcode dll -
function mydllFunc( aparm )
local i := 0
altd(1)
altd()
? m->p1
for i := 1 to len(aparm)
  ? aparm[i]
next
return i


Once again thank you for your help
Don Lowenstein
www.laapc.com
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: create a pcode dll
Posted: Tue Jan 13, 2009 12:16 AM

Don,

Very good :-)

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 1283
Joined: Fri Feb 10, 2006 02:34 PM
Re: create a pcode dll
Posted: Tue Jan 13, 2009 07:50 AM

Don,

In your example, where is HB_LibDo() ?

Salutacions, saludos, regards

"...programar es fácil, hacer programas es difícil..."

UT Page -> https://carles9000.github.io/
Forum UT -> https://discord.gg/bq8a9yGMWh
HIX -> https://github.com/carles9000/hix
Posts: 6983
Joined: Fri Oct 07, 2005 07:07 PM
Re: create a pcode dll
Posted: Tue Jan 13, 2009 09:41 AM

Hello Antonio,

Could you please instruct me how to set up the debugger.
Thanks in advance
Otto

>Is the debugger fixed in the Latest version of xHarbour1.0?
>We have NOT upgraded do to the lack of a debugger.
>
>The xHarbour debugger is properly working with FWH 8.12 and the xHarbour build that FiveTech provides:

Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: create a pcode dll
Posted: Tue Jan 13, 2009 10:07 AM

Otto,

Please build FWH\samples\altd.prg this way:

buildh.bat altd /b

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 204
Joined: Mon Oct 17, 2005 09:09 PM
Re: create a pcode dll
Posted: Tue Jan 13, 2009 03:16 PM

HB_LibDo() is a Harbour function.

We have also experienced some Debugger issues in xHarbour v1.0

It seems that the f7 - run to cursor, and f9 - set break do not work with the xHarbour v1.0, as in the previous versions.

Don Lowenstein
www.laapc.com

Continue the discussion