Dear Antonio,
i have tried with fivehc32.lib and fiveh32.lib but doesn't works.
i have posted below fwfuncs.prg corrected from some oversights (I left the wrong lines as comments)
pay attention to the updated version of MS VC22 is now numbered: \14.43.34808\
i have tried to change bin\Hostx64\x86\ with bin\Hostx86\x86\
i have tried also from from the command prompt with libs copied in the same directory bin but i have this result:
Microsoft (R) Library Manager Version 14.43.34809.0
Copyright (C) Microsoft Corporation. All rights reserved.
LINK : fatal error LNK1181: cannot open input file 'fiveh32.lib,'
now i use the LST files that you have posted, when you have time you try to see what is not working.
thanks for attention,
Marzio
#include "fivewin.ch"
#define EM_LINESCROLL 182
#define EM_GETFIRSTVISIBLELINE 0x00CE
//----------------------------------------------------------------------------//
static cBccFolder := "c:\bcc77\" // your bcc folder here
static cMSVCFolder := "c:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.43.34808\bin\Hostx64\x86\" // your msvc folder here
//----------------------------------------------------------------------------//
function Main()
local aFunc
local oDlg, nWd, oFont, oFixed, oBrw, oSay, oGet
local cModule, cFile, cText, cUpper
local aTemp := {}
local cSymbols := ""
SetMGetColorFocus()
aFunc := ReadFuncs()
if Empty( aFunc )
return nil
endif
AEval( aFunc, { | a | AAdd( aTemp, a[ 2 ] ) } )
ASort( aTemp )
// XBrowse( aTemp )
AEval( aTemp, { | cName | cSymbols += "extern " + cName + CRLF } )
hb_memoWrit( "symbols.txt", cSymbols )
// fw_memoEdit( cSymbols )
cModule := aFunc[ 1, 1 ]
cFile := ModuleToFile( cModule )
cText := If( Empty( cFile ), "", MemoRead( cFile ) )
DEFINE FONT oFont NAME "TAHOMA" SIZE 0,-13
DEFINE FONT oFixed NAME "LUCIDA CONSOLE" SIZE 0,-14
nWd := Int( ScreenWidth() * 0.9 )
DEFINE DIALOG oDlg SIZE nWd,600 PIXEL TRUEPIXEL FONT oFont ;
TITLE FWVERSION + ": Functions and Classes"
@ 20,20 XBROWSE oBrw SIZE 400,-20 PIXEL OF oDlg ;
DATASOURCE aFunc COLUMNS 1,2 ;
HEADERS "MODULE", "FUNCTION" ;
COLSIZES "BBBBBBBBBB" ;
CELL LINES NOBORDER FOOTERS AUTOSORT
WITH OBJECT oBrw
:bRecSelData := { || oBrw:KeyNo }
:nRecSelWidth := "9999"
:bRecSelHeader := { || "SlNo" }
:bRecSelFooter := { || oBrw:nLen }
:lHScroll := .f.
:lSeekBar := .t.
:bClrEdits := { || { CLR_HRED, CLR_YELLOW } }
:lSeekWild := .t.
:nStretchCol := 2
:bChange := <||
if !( cModule == oBrw:aRow[ 1 ] )
cModule := oBrw:aRow[ 1 ]
cFile := ModuleToFile( cModule )
if Empty( cFile )
cText := ""
else
cText := MemoRead( cFile )
endif
cUpper := Upper( cText )
oSay:Refresh()
oGet:Refresh()
endif
LocateFunction( oBrw:aRow[ 2 ], cText, cUpper, oGet )
return nil
>
:CreateFromCode()
END
@ 20,420 SAY oSay PROMPT { || cFile } SIZE nWd - 440, 26 PIXEL CENTER OF oDlg ;
COLOR CLR_BLACK, oBrw:nRecSelColor
@ 50,420 GET oGet VAR cText MEMO SIZE nWd - 440, 530 PIXEL OF oDlg FONT oFixed
ACTIVATE DIALOG oDlg CENTERED ;
ON INIT LocateFunction( aFunc[ 1, 2 ], cText, cUpper, oGet )
RELEASE FONT oFont, oFixed
return nil
//----------------------------------------------------------------------------//
function ReadFuncs()
local cText, aLines, cLine, cFunc, cFunc1, cFunc2, n, i
local cModule := ""
local aFunc := {}
if "Borland" $ HB_Compiler() .and. ! lIsDir( cBccFolder )
MsgStop( cBccFolder + " not found" )
return nil
endif
if "Microsoft" $ HB_Compiler() .and. ! lIsDir( cMSVCFolder )
MsgStop( cMSVCFolder + " not found" )
return nil
endif
if ! File( "fiveh.lst" )
if File( cBccFolder + "bin\tlib.exe" )
WaitRun( cBccFolder + "bin\tlib.exe ..\lib\fiveh.lib, fiveh.lst" )
else
WaitRun( cMSVCFolder + "bin\lib.exe ..\lib\fiveh32.lib, fiveh32.lst" ) // MsgStop( cMSVCFolder + "bin\lib.exe ..\lib\fiveh32.lib, fiveh.lst" )
endif
SysWait( .2 )
endif
if File( "fiveh.lst" )
cText := MemoRead( "fiveh.lst" )
elseif File( "fiveh32.lst" )
cText := MemoRead( "fiveh32.lst" )
endif
aLines := AMERGE( aLines, HB_ATokens( cText, CRLF ) ) // aLines := HB_ATokens( cText, CRLF )
if ! File( "fivehc.lst" )
if File( cBccFolder + "bin\tlib.exe" )
WaitRun( cBccFolder + "bin\tlib.exe ..\lib\fivehc.lib, fivehc.lst" )
else
WaitRun( cMSVCFolder + "bin\lib.exe ..\lib\fivehc32.lib, fivehc32.lst" ) // MsgStop( cMSVCFolder + "bin\lib.exe ..\lib\fiveh32c.lib, fivehc.lst" )
endif
SysWait( .2 )
endif
if File( "fivehc.lst" )
cText := MemoRead( "fivehc.lst" )
elseif File( "fivehc32.lst" ) // elseif File( "fiveh32c.lst" )
cText := MemoRead( "fivehc32.lst" ) // cText := MemoRead( "fiveh32c.lst" )
endif
aLines := AMERGE( aLines, HB_ATokens( cText, CRLF ) )
for n := 2 to Len( aLines )
cLine := aLines[ n ]
if Empty( cLine )
LOOP
endif
if Left( cLine, 1 ) == Chr( 9 )
for i := 1 to 2
cFunc := TOKEN( cLine, , i )
if cFunc = "_HB_FUN_"
AAdd( aFunc, { cModule, AFTERATNUM( "_HB_FUN_", cFunc ) } )
else
EXIT
endif
next
else
cModule := AllTrim( TOKEN( cLine,,1 ) )
endif
next
ASort( aFunc, , , { |x,y| If( x[ 1 ] == y[ 1 ], x[ 2 ] < y[ 2 ], x[ 1 ] < y[ 1 ] ) } )
return aFunc
//----------------------------------------------------------------------------//
static function ModuleToFile( cModule )
local cSpec := "..\source\" + cModule + ".*"
local cFile := ""
local aDir
aDir := DirectoryRecurse( TrueName( cSpec ) )
if !Empty( aDir )
cFile := aDir[ 1, 1 ]
endif
return cFile
//----------------------------------------------------------------------------//
static function LocateFunction( cFunc, cText, cUpper, oGet )
local nRow := 1
local aSeek := {}
local nPos
if !Empty( cText )
DEFAULT cUpper := Upper( cText )
aSeek := { "FUNCTION " + cFunc + "(", ;
"FUNCTION " + cFunc + " ", ;
"CLASS " + cFunc, ;
"HB_FUNC( " + cFunc + " )", ;
"HB_FUNC (" + cFunc + ")" }
nPos := AAT( aSeek, cUpper )
if nPos > 0
nRow := OCCURS( CRLF, LEFT( cText, nPos ) )
endif
GetSetTopRow( oGet, nRow )
endif
return nRow
//----------------------------------------------------------------------------//
static function GetSetTopRow( oGet, nRow )
local nTopRow := oGet:SendMsg( EM_GETFIRSTVISIBLELINE )
oGet:SendMsg( EM_LINESCROLL, 0, nRow - nTopRow )
return nil
//----------------------------------------------------------------------------//