26 Jun 2014 15:17
Minduim escreveu:Toledo;
no post anterior, entendo que você implementou a função 'volserial' no 'leto' de sua aplicação;
observe na 'imagem 001' e 'imagem 002' que o retorno da função é sempre em relação ao driver 'C';
você também observa isto ou estou fazendo algo errado?
function UDF_VOLSERIAL( nUserStru, cLabel )
PathServ := "//localhost:2812/"
nSerial := Leto_Udf(PathServ+"UDF_VOLSERIAL","C:\")
26 Jun 2014 16:06
26 Jun 2014 20:17
03 Jul 2014 10:26
LetoDB service has had some problems: 1063
Error BASE/1004 No exported method: HIDE
Called from ->HIDE(0)
Called from letotray_manage.prg->USERSINFO(80)
Called from letotray_manage.prg->(b)MAIN(30)
Called from source\winapi\hwindow.prg->ONCOMMAND(528)
Called from source\winapi\hwindow.prg->(b)HMAINWINDOW(231)
Called from source\winapi\hwindow.prg->HMAINWINDOW:ONEVENT(317)
Called from ->HWG_ACTIVATEMAINWINDOW(0)
Called from source\winapi\hwindow.prg->HMAINWINDOW:ACTIVATE(306)
Called from letotray_manage.prg->MAIN(37)
HWGUI 2.18 Build 1
Date:07/03/14
Time:10:19:39
#include "hwgcompat.ch"
#include "hbclass.ch" // manage.prg
#include "hwgui.ch" // manage.prg
#include "hxml.ch" // manage.prg
#include "rddleto.ch" // manage.prg
Static cPath
Static cIp := '127.0.0.1'
Static nPort := 2812
Function Main
Local oMainWindow, oTrayMenu, oIcon := HIcon():AddResource("ICON_1")
Private oApp // manage.prg
oApp := HApp():New() // manage.prg
cPath := DiskName() + ":\" + CurDir() + "\"
IF ! File( cPath + "letodb.exe" )
MsgInfo("letodb.exe not found")
Return nil
ENDIF
INIT WINDOW oMainWindow MAIN TITLE "LetoDB server"
CONTEXT MENU oTrayMenu
MENUITEM "Start letodb" ACTION StartServer()
MENUITEM "Stop letodb" ACTION StopServer()
MENUITEM "UsersInfo" ACTION UsersInfo( cIp ) // manage.prg
SEPARATOR
MENUITEM "Exit" ACTION EndWindow()
ENDMENU
oMainWindow:InitTray( oIcon,, oTrayMenu, "LetoDB server" )
ACTIVATE WINDOW oMainWindow NOSHOW
oTrayMenu:End()
Return Nil
Function StartServer
ShellExecute( cPath + "letodb.exe",,, cPath )
Return nil
Function StopServer
ShellExecute( cPath + "letodb.exe",, "stop", cPath )
Return nil
Static func Connect
Return Leto_Connect("//" + cIp + ":" + LTrim(Str(nPort)) + "/") != -1
Static Function UsersInfo( cAddress ) // manage.prg
oApp:nItemCurr := 0
IF cAddress != Nil
IF ( arr := GetIpFromPath( "//" + cAddress + "/" ) ) != Nil
cIp := arr[1]
nPort := arr[2]
oApp:nItemCurr := Ascan( oApp:aServers, cIp )
ENDIF
ENDIF
INIT WINDOW oApp:oMainWnd MAIN TITLE "Server management utility" ;
AT 200,0 SIZE 600,400 FONT HFont():Add( "Georgia",0,-15,,204 )
InfoUsers()
oApp:oBtnKill:Hide()
IF oApp:nItemCurr > 0
oApp:oCombo:SetItem( oApp:nItemCurr )
ENDIF
ACTIVATE WINDOW oApp:oMainWnd
Return Nil
Static Function InfoUsers() // manage.prg
Local aInfo, i, nUsers
IF oApp:lSend
oApp:nRequest = 2
Return .T.
ENDIF
oApp:lSend := .T.
IF ( aInfo := leto_MgGetUsers() ) == Nil
oApp:lSend := .F.
Return .F.
ENDIF
oApp:lSend := .F.
oApp:oBtnLock:Hide()
oApp:oBtnKill:Show()
nUsers := Len( aInfo )
oApp:oBrw1:aArray := Array( nUsers, 5 )
FOR i := 1 TO nUsers
oApp:oBrw1:aArray[i,4] := aInfo[i,1]
oApp:oBrw1:aArray[i,1] := aInfo[i,2]
oApp:oBrw1:aArray[i,2] := aInfo[i,3]
oApp:oBrw1:aArray[i,3] := aInfo[i,4]
oApp:oBrw1:aArray[i,5] := Padl(Ltrim(Str(Int((Val(aInfo[i,5])%86400)/3600))),2,'0') ;
+":"+ Padl(Ltrim(Str(Int((Val(aInfo[i,5])%3600)/60))),2,'0') +":"+ ;
Padl(Ltrim(Str(Int(Val(aInfo[i,5])%60))),2,'0')
NEXT
IF oApp:nInfoType != 2
oApp:nInfoType := 2
oApp:oBrw1:aColumns := {}
oApp:oBrw1:AddColumn( HColumn():New( "Ip",{|v,o|o:aArray[o:nCurrent,1]},"C",16,0 ) )
oApp:oBrw1:AddColumn( HColumn():New( "Host",{|v,o|o:aArray[o:nCurrent,2]},"C",18,0 ) )
oApp:oBrw1:AddColumn( HColumn():New( "Module",{|v,o|o:aArray[o:nCurrent,3]},"C",18,0 ) )
oApp:oBrw1:AddColumn( HColumn():New( "Timeout",{|v,o|o:aArray[o:nCurrent,5]},"C",15,0 ) )
oApp:oBrw1:bPosChanged := Nil
oApp:oBrw1:bPosChanged := {||Tables4User()}
oApp:oBrw1:lChanged := .T.
oApp:oBrw1:nCurrent := oApp:oBrw1:rowPos := 1
ENDIF
oApp:oBrw1:Refresh()
Tables4User()
Return .T.
Static Function Tables4User() // manage.prg
Local aInfo, i, nTables
IF !Empty( oApp:oBrw1:aArray ) .AND. ;
Len( oApp:oBrw1:aArray ) >= oApp:oBrw1:nCurrent .AND. ;
Valtype( oApp:oBrw1:aArray[oApp:oBrw1:nCurrent] ) == "A" .AND. ;
Len( oApp:oBrw1:aArray[oApp:oBrw1:nCurrent] ) >= 4
oApp:lSend := .T.
IF ( aInfo := leto_MgGetTables( oApp:oBrw1:aArray[oApp:oBrw1:nCurrent,4] ) ) == Nil
oApp:lSend := .F.
oApp:oBrw2:aArray := {}
ELSE
oApp:lSend := .F.
nTables := Len( aInfo )
oApp:oBrw2:aArray := Array( nTables,2 )
FOR i := 1 TO nTables
oApp:oBrw2:aArray[i,2] := aInfo[i,1]
oApp:oBrw2:aArray[i,1] := aInfo[i,2]
NEXT
ENDIF
ELSE
oApp:oBrw2:aArray := {}
ENDIF
IF oApp:oBrw2:aColumns == Nil .OR. Len(oApp:oBrw2:aColumns) == 3
oApp:oBrw2:aColumns := {}
oApp:oBrw2:AddColumn( HColumn():New( "Name",{|v,o|o:aArray[o:nCurrent,1]},"C",24,0 ) )
oApp:oBrw2:lChanged := .T.
ENDIF
oApp:oBrw2:Refresh()
Return Nil
Static Function GetIpFromPath( cPath ) // manage.prg
Local nPos1, nPos2, nPos3, cSub
IF Left( cPath,2 ) != "//" .OR. ( nPos1 := At( ":",cPath ) ) == 0
Return Nil
ENDIF
cSub := Substr( cPath, nPos1 + 1 )
nPos2 := At( "/",cSub )
nPos3 := At( "\",cSub )
IF nPos2 == 0 .AND. nPos3 == 0
Return Nil
ENDIF
IF nPos2 == 0 .OR. ( nPos3 != 0 .AND. nPos3 < nPos2 )
nPos2 := nPos3
ENDIF
nPos3 := Max( RAt( "/",cSub ), RAt( "\",cSub ) )
Return { Substr(cPath,3,nPos1-3), Val(Left(cSub,nPos2-1)), Iif(nPos3==0,"",Substr(cSub,nPos2,nPos3-nPos2+1)) }
Static Function ReadOptions( oApp ) // manage.prg
Local oOptions := HXMLDoc():Read( "manage.xml" )
Local oNode, i1, cIp, cPort, cUser, cPass
IF !Empty( oOptions ) .AND. !Empty( oOptions:aItems ) .AND. oOptions:aItems[1]:title == "init"
FOR i1 := 1 TO Len( oOptions:aItems[1]:aItems )
oNode := oOptions:aItems[1]:aItems[i1]
IF oNode:title == "server"
cIp := oNode:GetAttribute("ip")
cPort := oNode:GetAttribute("port")
cUser := oNode:GetAttribute("user")
Aadd( oApp:aServers, cIp )
Aadd( oApp:aParams, { Iif(cPort==Nil,"2812",cPort), cUser } )
ENDIF
NEXT
ENDIF
IF Empty( oApp:aServers )
Aadd( oApp:aServers, "127.0.0.1" )
Aadd( oApp:aParams, { "2812", Nil } )
ENDIF
Return Nil
CLASS HApp // manage.prg
DATA oMainWnd
DATA oTool
DATA oCombo
DATA oGetPort
DATA oGetRefr
DATA oSayServer
DATA oBtnGo
DATA oBtnKill
DATA oBtnLock
DATA oBrw1
DATA oBrw2
DATA oSplit
DATA aServers
DATA aParams
DATA nItemCurr INIT 0
DATA lUpdList INIT .F.
DATA oTimer
DATA lSend INIT .F.
DATA nInfoType INIT 0
DATA nRequest INIT 0
DATA lLocked INIT .F.
METHOD New
ENDCLASS
METHOD New CLASS HApp // manage.prg
::aServers := {}
::aParams := {}
ReadOptions( Self )
Return Self
03 Jul 2014 10:55
05 Jul 2014 10:28
12 Jul 2014 11:26
LetoDB service has had some problems: 1063
********************************
function UDF_SETPRINTER( nUserStru, cArq )
if !Empty( cArq )
Set Printer to ( cArq )
else
Set Printer to
endif
return Nil
14 Jul 2014 16:46
24 Jul 2014 18:21
24 Jul 2014 19:09
24 Jul 2014 20:33
24 Jul 2014 20:55
25 Jul 2014 07:56
25 Jul 2014 09:24
25 Jul 2014 09:31