This is a guide to build a FWH DLL (with the Harbour's hvm inside the DLL)
go64.bat
@setlocal
call "%ProgramFiles%\Microsoft Visual Studio\2022\Community\VC\Auxiliary\Build\vcvarsall.bat" amd64
c:\harbour\bin\win\msvc64\hbmk2 fwh64.hbp -comp=msvc64
dumpbin /exports fwh64.dll
@endlocalfwh64.prg
#include "FiveWin.ch"
function Main()
MsgInfo( "dentro DLL" )
return nil
#pragma BEGINDUMP
#include <windows.h>
#include <hbapi.h>
#include <hbvm.h>
__declspec(dllexport) void TEST( void )
{
hb_vmInit( HB_TRUE );
hb_vmQuit();
}
#pragma ENDDUMPfwh64.hbp
-gui
-hbdynvm
-ofwh64
-Ic:\fwh64\include
fwh64.prg
-Lc:\fwh64\lib
-lFiveH64
-lFiveHC64
-lgdiplus
-lole32
-lOleDlg
-lversion
-luxtheme
-cflag=-MD
-ldflag+=/NODEFAULTLIB:LIBCMT
xhb.hbc
hbct.hbc
hbwin.hbc
hbmzip.hbc
hbziparc.hbc
hbfoxpro.hbcfwh.prg (run this from HIX. Remember to have hbdyn.ch at HIX folder)
#include "hbdyn.ch"
function Main()
local hDLL := hb_libLoad( "fwh64.dll" )
hb_dynCall( { "TEST", hDLL, hb_bitOr( HB_DYN_CALLCONV_STDCALL, HB_DYN_CTYPE_VOID ) } )
hb_libFree( hDLL )
return nil