Hi Antonio Linares
Thank you.
I will make 'Process bar' from (FWH + Harbour).
Then, I execute 'MMP_INIT()' and after that 'g_num' changes have to come over untill
I close the Program 'MMP_INIT()' that I can make 'Process bar'
This is (FWH + Harbour) code.
Code: Select all
//--FWH + Harbour code --------------------------
//--FWH + Harbour code --------------------------
//--FWH + Harbour code --------------------------
#include "fivewin.ch"
//--------------------------------------------------------------------------------
FUNC Main()
publ oDlg, oProg, nValue := 0, oTimer, oMeter, line_count
oText := TTxtFile():New( "test.txt" )
oText:GoBottom()
line_count := oText:nLine
oText:End()
oMeter:nTotal := line_count
DEFINE DIALOG oDlg TITLE "TEST"
@ 2, 2 METER oMeter VAR nValue TOTAL line_count OF oDlg SIZE 135, 12
@ 3, 9 BUTTON "Exit" ACTION oDlg:End()
ACTIVATE DIALOG oDlg CENTER ;
ON INIT ( timer(), mmp_start("test.txt") )
RETU NIL
//--------------------------------------------------------------------------------
FUNC timer()
DEFINE TIMER oTimer ACTION progress_bar()
ACTIVATE TIMER oTimer
RETU nil
//--------------------------------------------------------------------------------
FUNC progress_bar()
// Hear is point
// g_Num = C ++ DLL RETURN VALUE
nValue := g_Num // ?????????????????????????????? How ?
oMeter:Set( nValue )
RETU NIL
/*--------------------------------------------------------------------------*/
#pragma BEGINDUMP
#include "windows.h"
#include "hbapi.h"
#include "hbvm.h"
HB_FUNC( MMP_START )
{
mmp_init(hb_parc(1))
hb_retni(0);
}
#pragma ENDDUMP
//--FWH + Harbour code END--------------------------
//--FWH + Harbour code END--------------------------
//--FWH + Harbour code END--------------------------
//--FWH + Harbour code END--------------------------
This is c ++ DLL code
'g_Num' Variable declaration method ????????
And the method which owns jointly the 'g_Num' with the FWH code.
Code: Select all
/* C++ test.dll position source code------------- */
/* C++ test.dll position source code------------- */
/* C++ test.dll position source code------------- */
/* C++ test.dll position source code------------- */
extern "C" __declspec(dllexport) int mmp_init(char* file_list)
{
ifstream ifs_filelist(file_list);
while(1){
string line;
stringstream line_stream(line);
getline(line_stream, id);
g_Num ++
//g_Num ++; /* (FWH + Hobour) code Change Return */
if (g_Num > 200000) {
break;
}
/*
string line;
string path;
string id;
string::size_type idx;
if(getline(ifs_filelist, line)==NULL)
{
path.erase();
id.erase();
line.erase();
break;
}
stringstream line_stream(line);
getline(line_stream, id);
getline(line_stream, path, '\t');
idx = path.find('.');
path.replace(idx+1, string::npos, suffix);
filename_to_extract_feature=path.c_str();
*/
}
ifs_filelist.close();
return 0;
}
/* C++ test.dll position source code end------------- */
/* C++ test.dll position source code end------------- */
This is test.txt sample code
Code: Select all
/* test.txt sample code ABOUT : 200000 Line -------------------------------- */
/* test.txt sample code ABOUT : 200000 Line -------------------------------- */
/* test.txt sample code ABOUT : 200000 Line -------------------------------- */
\\C-net\c\000019\CCCH00001911.MMP EINE KLEINE NACHTMUSIK
\\C-net\c\000208\CCCH00020801.MMP SCHBERT;STRING QUINTET
\\C-net\c\000219\CCCH00021901.MMP BEETHOVEN:STRING QUARTETS
\\C-net\c\000287\CCCH00028706.MMP EXTRA TIME AMSTERDAM
............
............
............
............
............
\\C-net\c\000969\CCCO00096901.MMP PATRICK GALLOIS/POPULAR CLASSICS
\\C-net\c\000969\CCCO00096903.MMP PATRICK GALLOIS/POPULAR CLASSICS
/* test.txt sample code End-------------------------------- */