function test4()
local cr:=chr(13)
local hItem1 := ItemNew( "The Message is : Test to return a numeric value" )
local hItem2 := ItemNew( "This is the Title for the Harbour DLL" )
?HbDLLstring3( "TEST4", hItem1, hItem2 )
ItemRelease( hItem1 )
ItemRelease( hItem2 )
MsgInfo( "OK! We are back to the EXE." )
return nil
HB_EXPORT char * PASCAL _export HBDLLSTRING3( char * cProcName, LONG pItem1, LONG pItem2 )
{
PHB_ITEM pResult;
pResult = hb_itemDoC( cProcName, 2, ( PHB_ITEM ) pItem1, ( PHB_ITEM ) pItem2, 0 );
return hb_itemGetC( pResult );
}
function Test4( cMsg1, cMsg2 )
local z:=99
MsgInfo( cMsg1, cMsg2 )
return (z)
HB_EXPORT char * PASCAL _export HBDLLSTRING3( char * cProcName, LONG pItem1, LONG pItem2 )
{
PHB_ITEM pResult;
pResult = hb_itemDoC( cProcName, 2, ( PHB_ITEM ) pItem1, ( PHB_ITEM ) pItem2, 0 );
return hb_itemGetC( pResult );
}
HB_EXPORT char * PASCAL _export HBDLLSTRING3( char * cProcName, LONG pItem1, LONG pItem2 )
{
PHB_ITEM pResult;
pResult = hb_itemDoC( cProcName, 2, ( PHB_ITEM ) pItem1, ( PHB_ITEM ) pItem2, 0 );
return hb_itemGetNL( pResult );
}
************************** Test 5 Hello World Back
function test5()
********
local cr:=chr(13)
local hItem1 :="test"
local hItem2 :="test2"
local dllhan:=loadlibrary("dll2test.dll")
local rtnitem:="Return Value not set yet."
local zzz
********
zzz:=getprocaddress(dllhan,"HBDLLSTRING2",.t.,4,4,9,9)
rtnitem=calldll(zzz,1,"testa","testa")
MsgInfo( rtnitem+cr+"OK! We are back to the EXE." )
return nil
#pragma BEGINDUMP
#include <hbapi.h>
#include <hbapiitm.h>
HB_FUNC( ITEMNEW )
{
hb_retnl( ( ULONG ) hb_itemNew( hb_param( 1, HB_IT_ANY ) ) );
}
HB_FUNC( ITEMRELEASE )
{
hb_retl( hb_itemRelease( ( PHB_ITEM ) hb_parnl( 1 ) ) );
}
#pragma ENDDUMP
#include <windows.h>
#include <stdio.h>
int __declspec(dllimport) WINAPI HBDLLSTRING2( char * cProcName, LONG pItem1, LONG pItem2 );
int main()
{
char xdata;
char ydata;
printf("Test2 HBDLLString2\n");
printf("The sum of 4 + 7 is %d\n", HBDLLSTRING2("test4",xdata,ydata));
return 0;
}
#pragma argsused
BOOL WINAPI DllEntryPoint(HINSTANCE h, DWORD d, LPVOID p)
{
return TRUE;
}
int __declspec(dllexport) WINAPI HBDLLSTRING2( char * cProcName, LONG pItem1, LONG pItem2 )
{
char xdata;
return (xdata);
}
.autodepend
testdll.exe : testdll.c
bcc32 -WCR -Ih:\bcc55\include -Lh:\bcc55\lib testdll.c
LONG PASCAL HBDLLENTRY2( char * cProcName, char * cText1, char * cText2 )
{
PHB_ITEM pItem1 = hb_itemPutC( NULL, cText1 );
PHB_ITEM pItem2 = hb_itemPutC( NULL, cText2 );
hb_itemDoC( cProcName, 2, pItem1, pItem2, 0 );
hb_itemRelease( pItem1 );
hb_itemRelease( pItem2 );
return 0;
}
Return to FiveWin for Harbour/xHarbour
Users browsing this forum: No registered users and 77 guests