Muy buenas foro, tengo un programa que me muestra un dialogo, pero le he añadido una funcion que se tiene que conectar por socket, entonces tuve que crear una windows para los sockets, cuando tengo el valor necesario, cierro la window y los sockets, y cuando voy a cargar el dialogo no se carga, se que es por la window, pero no se como solucionarlo, aqui teneis mas o menos el código:
SI COMENTO LA LINEA cIP:=GetPublicIP() me carga el dialogo.
function main()
local cIP
cIP:=GetPublicIP()
define dialog oDlg resource "CDILAUNCHER"
...
...
activate dialog oDlg center
return
function GetPublicIP(cServer,cWeb)
local oWnd,cIP:="",nI:=0,nF:=0
public cTextWeb:=""
default cServer:="xxx",cWeb:="xxx"
define window oWnd title "GetPublicIP" from -100, -100 to -100, -100
activate window oWnd on init (GetIPWeb(cServer,cWeb,@oWnd))
cIP:=cTextWeb
release cTextWeb
if !empty(cIP)
nI:=at('<b>',cIP)
nF:=at('</b>',cIP)
if nI<>0 .and. nF<>0
cIP:=substr(cIP,nI+3,nF-nI-3)
end if
end if
return cIP
static function GetIPWeb(cServer,cWeb,oWnd)
local oWebClient
oWebClient:=TWebClient():New()
oWebClient:Connect(cServer)
oWebClient:bOnRead = { |cData| (cTextWeb+=cData,oWnd:end()) }
oWebClient:oSocket:SendData( "GET "+cWeb+" HTTP/1.0" + CRLF +"Host: "+cServer+ CRLF +CRLF )
return
Un Saludo.