General Help regarding HMG, Compilation, Linking, Samples
Moderator: Rathinagiri
danielmaximiliano
Posts: 2612 Joined: Fri Apr 09, 2010 4:53 pm
Location: Argentina
Contact:
Post
by danielmaximiliano » Wed Sep 09, 2020 7:06 am
Hi Jimmy
download the version HBFM from Github to see where the FTP connection error is generated but when trying to compile it does not find os.ch in
Code: Select all
*+--------------------------------------------------------------------
*+
*+ Source Module => c:\hmg.3.4.4\0\HBFM\\HBEJECT.PRG
*+
*+ Copyright(C) 1983-2020 by Auge & Ohr
*+
*+ Functions: Procedure HBEJECT()
*+ Function EjectMedia()
*+ Static Function CreateVolHandle()
*+ Static Function LockVolume()
*+ Static Function DismountVolume()
*+ Static Function AutoEjectVolume()
*+ Static Function UnlockVolume()
*+ Static Function CloseVolume()
*+ Static Function PreventRemovalOfVolume()
*+ Static Function USB_DeviceColor()
*+ Static Function DO_DeviceImage()
*+ Static Function Do_DeviceAction()
*+ Static Function FillDeviceGrid()
*+ Static Procedure SayInfo()
*+
*+ Reformatted by Click! 2.05.30 on Aug-28-2020 at 1:52 am
*+
*+--------------------------------------------------------------------
#include "HMG.ch"
#include "common.ch"
#include "os.ch"
#include "dll.ch"
#include "EJECTDLL.CH"
#include "HBFM.CH"
2020-09-09 04_02_19-Window.png (30.18 KiB) Viewed 2575 times
*´¨)
¸.·´¸.·*´¨) ¸.·*¨)
(¸.·´. (¸.·` *
.·`. Harbour/HMG : It's magic !
(¸.·``··*
Saludos / Regards
DaNiElMaXiMiLiAnO
Whatsapp. := +54901169026142
Telegram Name := DaNiElMaXiMiLiAnO
AUGE_OHR
Posts: 2065 Joined: Sun Aug 25, 2019 3:12 pm
DBs Used: DBF, PostgreSQL, MySQL, SQLite
Location: Hamburg, Germany
Post
by AUGE_OHR » Wed Sep 09, 2020 8:00 am
danielmaximiliano wrote: ↑ Wed Sep 09, 2020 5:02 am
with HBFM64 the application hangs entering 192.168.1.2:8556 without username and password or with username: anonimous, password: anoimous
I must use the windows Task Kill to kill the HBFM64 process
ooooooh ...
i must say that i have take Code from c:\MiniGUI\SAMPLES\Advanced\FtpClient\
Code: Select all
cUrl := cProtocol + Alltrim( cUser )+":"+ Alltrim( cPassWord ) +"@"+ alltrim( cServer)
oUrl := tURL():New( cUrl )
IF Empty( oUrl )
return nil
endif
oClient := TIpClientFtp():new( oUrl, Sites->Log ) && PARAM .T. TO LOG
IF Empty( oClient )
return nil
endif
oClient:nConnTimeout := 20000
oClient:bUsePasv := .T.
// Comprobamos si el usuario contiene una @ para forzar el userid
IF At( "@", cUser ) > 0
oClient:oUrl:cServer := cServer
oClient:oUrl:cUserID := cUser
oClient:oUrl:cPassword := cPassword
ENDIF
have to look deeper for tURL()
have fun
Jimmy
AUGE_OHR
Posts: 2065 Joined: Sun Aug 25, 2019 3:12 pm
DBs Used: DBF, PostgreSQL, MySQL, SQLite
Location: Hamburg, Germany
Post
by AUGE_OHR » Wed Sep 09, 2020 8:13 am
hi,
aaaaaaaaaaaaarrrrrrrrrg ... it is a Xbase++ Constant
Code: Select all
LOCAL nVersion := VAL( OS( OS_VERSION ) )
harbour does not have Constant as Parameter so i have to re-write that part.
THX that you found that Problem
have fun
Jimmy
danielmaximiliano
Posts: 2612 Joined: Fri Apr 09, 2010 4:53 pm
Location: Argentina
Contact:
Post
by danielmaximiliano » Wed Sep 09, 2020 1:25 pm
I had found information about OS () but did not find information about the content of os.ch
https://doc.alaska-software.com/content ... ef_os.html
without this file I can't compile the sources
TIP: when creating a new site it should contain an Anonimous checkbox or fill in the following fields
Checkbox Anonimous.png (12.17 KiB) Viewed 2545 times
Code: Select all
IF xParam = NIL
newRecord := .f.
sites->( DBGOTO( sitemanager.browse_1.value ) )
editsitemanager.text_1.value := sites->name
editsitemanager.text_2.value := sites->address
editsitemanager.text_3.value := sites->user
editsitemanager.text_4.value := desencri( sites->password ) // decript
editsitemanager.text_5.value := Sites->SPath
editsitemanager.Check_2.value := Sites->Log
ELSE
newRecord := .t.
editsitemanager.text_3.value := "anonimous"
editsitemanager.text_4.value := "anonimous"
ENDIF
*´¨)
¸.·´¸.·*´¨) ¸.·*¨)
(¸.·´. (¸.·` *
.·`. Harbour/HMG : It's magic !
(¸.·``··*
Saludos / Regards
DaNiElMaXiMiLiAnO
Whatsapp. := +54901169026142
Telegram Name := DaNiElMaXiMiLiAnO
AUGE_OHR
Posts: 2065 Joined: Sun Aug 25, 2019 3:12 pm
DBs Used: DBF, PostgreSQL, MySQL, SQLite
Location: Hamburg, Germany
Post
by AUGE_OHR » Wed Sep 09, 2020 9:50 pm
hi
i have not upload OS.CH while it make no Sense ... OS() give me a String under harbour
Windows NT 10.0.19041
but i can´t find out Rest how to identify OS() ... just want to know if it is > Windows XP
---
about FTP Port
oUrl := TUrl():New( Server + ":" + hb_ntos( Port ) )
is that right
what is the default Port for FTP
have fun
Jimmy
danielmaximiliano
Posts: 2612 Joined: Fri Apr 09, 2010 4:53 pm
Location: Argentina
Contact:
Post
by danielmaximiliano » Wed Sep 09, 2020 10:48 pm
Hi Jimmy : from windows xp there is SystemInfo, its syntax is
systeminfo[.exe] [/s Computer [/u Domain\User [/p Password]]] [/fo {TABLE|LIST|CSV}] [/nh]
from CMD
systeminfo /fo list >SystemInfolist.log
You can also adapt to your convenience
https://github.com/breezechen/systeminf ... systeminfo
Note : ftp port is normally 21.
*´¨)
¸.·´¸.·*´¨) ¸.·*¨)
(¸.·´. (¸.·` *
.·`. Harbour/HMG : It's magic !
(¸.·``··*
Saludos / Regards
DaNiElMaXiMiLiAnO
Whatsapp. := +54901169026142
Telegram Name := DaNiElMaXiMiLiAnO
srvet_claudio
Posts: 2193 Joined: Thu Feb 25, 2010 8:43 pm
Location: Uruguay
Contact:
Post
by srvet_claudio » Wed Sep 09, 2020 11:09 pm
I don't remember now the name, but hmg has a function to get the os version. Search in the c source files for "osversion" or "version"
AUGE_OHR
Posts: 2065 Joined: Sun Aug 25, 2019 3:12 pm
DBs Used: DBF, PostgreSQL, MySQL, SQLite
Location: Hamburg, Germany
Post
by AUGE_OHR » Wed Sep 09, 2020 11:40 pm
! WARNING !
when play with sites.dbf i found a BIG BUG using Modi Stru.
it will DELETE new DBF when Name was in lower Letter
have fun
Jimmy
AUGE_OHR
Posts: 2065 Joined: Sun Aug 25, 2019 3:12 pm
DBs Used: DBF, PostgreSQL, MySQL, SQLite
Location: Hamburg, Germany
Post
by AUGE_OHR » Wed Sep 09, 2020 11:43 pm
hi,
i´m not sure how Syntax with Port work.
i saw this in c:\harbour\contrib\hbtip\tests\email.prg
Code: Select all
CASE ":" $ cHost
IF TUrl():New( cHost ):nPort != -1
nPort := TUrl():New( cHost ):nPort
ENDIF
lSTARTTLS := ( nPort == 587 )
cHost := TUrl():New( cHost ):cServer
so i change HbFTP to
Code: Select all
cUrl := cProtocol + ALLTRIM( cUser ) + ":" + ALLTRIM( cPassWord ) + "@" + ALLTRIM( cServer )
IF EMPTY(nPort)
oUrl := tURL() :New( cUrl )
ELSE
oUrl := tURL() :New( cUrl )+":"+hb_NTOS(nPort)
ENDIF
my Problem : don´t know how to test Port ...
have fun
Jimmy
AUGE_OHR
Posts: 2065 Joined: Sun Aug 25, 2019 3:12 pm
DBs Used: DBF, PostgreSQL, MySQL, SQLite
Location: Hamburg, Germany
Post
by AUGE_OHR » Wed Sep 09, 2020 11:52 pm
hi,
srvet_claudio wrote: ↑ Wed Sep 09, 2020 11:09 pm
I don't remember now the name, but hmg has a function to get the os version. Search in the c source files for "osversion" or "version"
THX, have found
HMG_IsWinVistaOrLater()
HB_FUNC( WINVERSION )
HB_FUNC( WINMAJORVERSIONNUMBER )
HB_FUNC( WINMINORVERSIONNUMBER )
now i use these define in EJECTDLL.CH
Code: Select all
#define VERSION_XP 5.0
#define VERSION_VISTA 6.0
#define VERSION_WIN7 6.01
#define VERSION_WIN8 6.02
#define VERSION_WIN81 6.03
#define VERSION_WIN10 10.0
#define VERSION_WIN10OLD 6.04
so i have to figure out how to re-write my Xbase++ Code.
have fun
Jimmy