• bcc64 - no DllCall() function in RTL library

    From Piotr@21:1/5 to All on Thu Jan 12 05:15:49 2023
    I try to move my 32bit application to 64bit and first problem I found there is no DllCall() function in rtl.a ? (last binaries from xharbour.org)
    (no problem with other functions in RTL library)
    linker error is:
    Turbo Incremental Link64 6.75 Copyright (c) 1997-2016 Embarcadero Technologies, Inc.
    Error: Unresolved external 'HB_FUN_DLLCALL' referenced from ...

    has anyone had a similar problem ?

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Enrico Maria Giordano@21:1/5 to All on Thu Jan 12 14:43:50 2023
    Il 12/01/2023 14:15, Piotr ha scritto:

    I try to move my 32bit application to 64bit and first problem I found there is no DllCall() function in rtl.a ? (last binaries from xharbour.org)
    (no problem with other functions in RTL library)
    linker error is:
    Turbo Incremental Link64 6.75 Copyright (c) 1997-2016 Embarcadero Technologies, Inc.
    Error: Unresolved external 'HB_FUN_DLLCALL' referenced from ...

    has anyone had a similar problem ?

    Yes, the module dllcall.c is excluded (I don't know why) from 64 bit
    builds due to the NODLL symbol that is defined in common3.mak:

    !if ("$(HB_ARCH)"=="64")
    CC_DEFINES =-DHB_OS_WIN_64 -DNODLL $(CC_DEFINES)
    HARBOURFLAGS =-dNODLL $(HARBOURFLAGS)
    !endif

    I could remove it but I am afraid of the consequences.

    --
    Enrico Maria Giordano

    http://www.emagsoftware.it
    http://www.emagsoftware.it/emgmusic
    http://www.emagsoftware.it/spectrum
    http://www.emagsoftware.it/tbosg

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Piotr@21:1/5 to All on Thu Jan 12 08:01:59 2023
    Thanks for explanation,
    I tried to compile dllcall.c from source but no success, bcc32 compiles it OK but bcc64 not, this file does not want to compile for 64bit - some errors in ASM inserts,
    unfortunately I do not know assembler and C so well to solve these problems, my failure, maybe this file was removed from the RTL library because it is not converted to 64bit, who knows...

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Enrico Maria Giordano@21:1/5 to All on Thu Jan 12 19:07:24 2023
    Il 12/01/2023 17:01, Piotr ha scritto:

    Thanks for explanation,
    I tried to compile dllcall.c from source but no success, bcc32 compiles it OK but bcc64 not, this file does not want to compile for 64bit - some errors in ASM inserts,
    unfortunately I do not know assembler and C so well to solve these problems, my failure, maybe this file was removed from the RTL library because it is not converted to 64bit, who knows...

    You can drop all of this and use Windows API only. This is a sample that
    work with MSC64 and BCC64:

    FUNCTION MAIN()

    SHELLEXECUTE( 0, 0, "calc.exe", 0, 0, 1 )

    RETURN NIL


    #pragma BEGINDUMP

    #include "windows.h"
    #include "hbapi.h"


    HB_FUNC( SHELLEXECUTE )
    {
    HMODULE hDll = LoadLibrary( "shell32.dll" );

    FARPROC pFunc = GetProcAddress( hDll, "ShellExecuteA" );

    hb_retnl( ( LONG ) ( *pFunc ) ( hb_parnl( 1 ), hb_parc( 2 ),
    hb_parc( 3 ), hb_parc( 4 ), hb_parc( 5 ), hb_parnl( 6 ) ) );

    FreeLibrary( hDll );
    }

    #pragma ENDDUMP

    --
    Enrico Maria Giordano

    http://www.emagsoftware.it
    http://www.emagsoftware.it/emgmusic
    http://www.emagsoftware.it/spectrum
    http://www.emagsoftware.it/tbosg

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Piotr@21:1/5 to All on Wed Feb 15 08:51:30 2023
    sorry I didn't reply sooner but I had a lot of other problems related to migrating to 64bit and left it for last, unfortunately your proposal does not replace dllcall() because shellexecute() is more for running EXE than for using functions from DLL.
    Since I couldn't handle the asm inserts in dllcall.c I used the hb_dynCall function from Harbor -> hbdyn.c after adapting the missing functions from strapi.c and eliminating UTF16 support I now have the dllcall() function working
    best regards

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Enrico Maria Giordano@21:1/5 to All on Wed Feb 15 19:39:27 2023
    Il 15/02/2023 17:51, Piotr ha scritto:

    sorry I didn't reply sooner but I had a lot of other problems related to migrating to 64bit and left it for last, unfortunately your proposal does not replace dllcall() because shellexecute() is more for running EXE than for using functions from DLL.
    Since I couldn't handle the asm inserts in dllcall.c I used the hb_dynCall function from Harbor -> hbdyn.c after adapting the missing functions from strapi.c and eliminating UTF16 support I now have the dllcall() function working

    That was only an example. You can write anything you want in the C code
    part.

    --
    Enrico Maria Giordano

    http://www.emagsoftware.it
    http://www.emagsoftware.it/emgmusic
    http://www.emagsoftware.it/spectrum
    http://www.emagsoftware.it/tbosg

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)