topic
stringlengths
1
63
text
stringlengths
1
577k
Capturar Error.
en fivewin como podría ser el CATCH? El error ocurre en la siguiente linea USE ( cDatabase ) NEW SHARED como se podría capturar el error ahí?
Capturar Error.
Hola [code=fw:3hwb7nqc]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #00C800;">try</span><br />  USE <span style="color: #000000;">&#40;</span> cDatabase <span style="color: #000000;">&#41;</span> <span style="color: #00C800;">NEW</span> SHARED <br />catch oError<br />   MsgAlert<span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"error abriendo la tabla"</span> <span style="color: #000000;">&#41;</span><br />end</div>[/code:3hwb7nqc]
Capturar Error.
Gracias Daniel, pero no he podido hacerlo de la manera que me indicas, logré solucionarlo de otra manera, utilizando el prg errsysw.prg incluyendolo dentro de mis prgs ErrorBlock( {|e| MsgStop( ErrorMessage(e) + " from Errorsys, line:" + ; Str( ProcLine( 1 ), 3 ) ), __quit() } ) IF UPPER(e:Description)="CORRUPTION DETECTED" DBCLOSEALL() If LEFT(RIGHT(e:FileName,12),8)$"tablaaindizar" indizartabla() Endif Endif Daniel, del otro modo que me indicas me sale error al compilar try USE ( cDatabase ) NEW SHARED catch oError MsgAlert( "error abriendo la tabla" ) end Harbour Compiler Alpha build 46.2 (Flex) Copyright 1999-2006, <!-- m --><a class="postlink" href="http://www.harbour-project.org/">http://www.harbour-project.org/</a><!-- m --> Compiling 'wsicnet.prg' and generating preprocessed output to 'wsicnet.ppo'... wsicnet.prg(92) Error E0030 Syntax error: "parse error at '<eol>'" wsicnet.prg(94) Error E0030 Syntax error: "parse error at 'OERROR'" wsicnet.prg(97) Error E0030 Syntax error: "parse error at '<eol>'" wsicnet.prg(105) Error E0030 Syntax error: "parse error at 'ENDIF'" wsicnet.prg(123) Error E0030 Syntax error: "parse error at 'ENDDO'" wsicnet.prg(126) Error E0030 Syntax error: "parse error at 'ELSE'" wsicnet.prg(129) Error E0030 Syntax error: "parse error at 'ENDIF'"
Capturar Error.
Omar, En vez de tu solución usa BEGIN SEQUENCE: [url:2oywippp]http&#58;//www&#46;ousob&#46;com/ng/53guide/ngfc7b7&#46;php[/url:2oywippp]
Capturar Ventana otro programa
Amigos del foro tengan buen dia.... De antemano muchas gracias al que pueda ayudarme... he estado buscando en el foro la forma de capturar la ventana de un programa y ejecutar una funcion de ese programa que se encuentra en el menu..... pero no se si estoy preguntando mal o es que no han propuesto el tema... Les cuento lo q tengo q hacer para saber si me pueden ayudar.... En la empresa compramos un aparato que captura la huella digital de cada uno de los empleados y hace el registro de la hora de entrada y salida de cada uno de los empleados.... Este aparatico trae un software que saca la información del aparato y lo guarda en un archivo .txt... lo que necesito es ejecutar ese proceso en ese programa para hacerlo automaticamente sin necesidad de intervencion del usuario y posteriormente sacar la informacion del txt. Ya del resto me encargo yo..... Alguien puede ayudarme con eso?
Capturar Ventana otro programa
Leandro El captador tiene alguna DLL o lib que se puede usar para que controles tu mismo el captador? verifica cual el es el modelo y marca, puede que alguien tenga una experiencia?
Capturar Ventana otro programa
Leandro, Puedes usar la función FindWindow() para localizar la ventana sabiendo el título de la misma: hWnd = FindWindow( , "titulo de esa ventana" ) MsgInfo( hWnd ) una vez tengas el handle de la ventana, podemos capturar su imagen ó lanzar una opción de su menú <!-- s:-) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":-)" title="Smile" /><!-- s:-) -->
Capturar Ventana otro programa
Yo tengo una pequeña utilidad que la llamo "EL PULPO" que la uso para mandar el mismo comando a varias ventanas. Prioritariamente lo uso con ventanas de MS-DOS cuanto las tengo conectadas con TFP o TELNET y deseo mandar el mismo comando a todas ellas (cd, ls, mget, etc...) La parte en la que detecto los handles de los programas con ventanas "visibles" la hago así: [code=fw:2aunoa56]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #00C800;">local</span> aTitles:=<span style="color: #000000;">&#123;</span><span style="color: #000000;">&#125;</span>,aHandles:=<span style="color: #000000;">&#123;</span><span style="color: #000000;">&#125;</span>,hWnd:=GETWINDOW<span style="color: #000000;">&#40;</span>GETDESKTOPWINDOW<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>,GW_CHILD<span style="color: #000000;">&#41;</span><br /><span style="color: #00C800;">WHILE</span> hWnd != <span style="color: #000000;">0</span> <br />   cTitle:=alltrim<span style="color: #000000;">&#40;</span>GETWINDOWTEXT<span style="color: #000000;">&#40;</span>hWnd<span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span><br />   <span style="color: #00C800;">if</span> cTitle<><span style="color: #ff0000;">""</span><br />      <span style="color: #00C800;">if</span> IsWindowVisible<span style="color: #000000;">&#40;</span>hWnd<span style="color: #000000;">&#41;</span> .and. GETWINDOW<span style="color: #000000;">&#40;</span>hWnd,GW_OWNER<span style="color: #000000;">&#41;</span>==<span style="color: #000000;">0</span> <span style="color: #B900B9;">// Solo las ventanas visibles</span><br />         aadd<span style="color: #000000;">&#40;</span>aTitles,cTitle<span style="color: #000000;">&#41;</span><br />         aadd<span style="color: #000000;">&#40;</span>aHandles,hWnd<span style="color: #000000;">&#41;</span><br />      <span style="color: #00C800;">endif</span><br />   <span style="color: #00C800;">endif</span><br />   hWnd:=GETWINDOW<span style="color: #000000;">&#40;</span>hWnd,GW_HWNDNEXT<span style="color: #000000;">&#41;</span> <br /><span style="color: #00C800;">ENDDO</span></div>[/code:2aunoa56] El envio de comandos lo hago así (se han de enviar caracter a caracter): [code=fw:2aunoa56]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #00C800;">local</span> i,j,cComando:=<span style="color: #ff0000;">"dir"</span><br />cComando:=cComando+chr<span style="color: #000000;">&#40;</span><span style="color: #000000;">13</span><span style="color: #000000;">&#41;</span><br /><span style="color: #00C800;">for</span> i=<span style="color: #000000;">1</span> <span style="color: #0000ff;">to</span> len<span style="color: #000000;">&#40;</span>aHandles<span style="color: #000000;">&#41;</span><br />   <span style="color: #00C800;">for</span> j=<span style="color: #000000;">1</span> <span style="color: #0000ff;">to</span> Len<span style="color: #000000;">&#40;</span>cComando<span style="color: #000000;">&#41;</span><br />      SendMessage<span style="color: #000000;">&#40;</span>aHandles<span style="color: #000000;">&#91;</span>i<span style="color: #000000;">&#93;</span>,WM_CHAR,<span style="color: #0000ff;">Asc</span><span style="color: #000000;">&#40;</span><span style="color: #0000ff;">SubStr</span><span style="color: #000000;">&#40;</span>cComando,j,<span style="color: #000000;">1</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span><br />   <span style="color: #00C800;">next</span> j<br /><span style="color: #00C800;">next</span> i</div>[/code:2aunoa56] Pero ejecutar una opción de un menú de otro programa no se como hacerlo.
Capturar Ventana otro programa
Amigos del foro tengan buena tarde: Inicialmente me gustaria desarrollar la solución como dice Daniel... el modelo del captador es: PROWARE - ISET F203 Encontre cuatro librerias en la carpeta del programa que son las siguientes, si es necesario que las envie me avisan, de todas formas me gustaria saber como puedo hacer para abrirlas y al menos para pegarle una ojeadita... usb.dll oa280.dll oa280_wrap.dll rsidll32.dll De todas formas voy a hacer lo que me dice Antonio y jmgarcia a ver hasta donde puedo llegar y ya en un rato les digo como me fue, muchas gracias por las respuestas y la buena voluntad.
Capturar contenido de una ventan externa
Hola a tod@s. Voy a plantearles un problema que tengo a ver si me pueden echar una mano( ... o dos). Estoy probando la clase AppBox (*) y encajo (embedd) en el diálogo una aplicación externa (para hacer telnet a un servidor). Hasta ahí todo bien. Lo que pretendo es capturar el contenido de los datos de dicha ventana 'embebida' pulsando sólo un botón y utilizando la Clase TClipBoard (**). Actualmente lo que hago es seleccionar todo el texto, luego botón derecho->copiar y pulsar un botón para poder rescatarlo del clipboard utilizando la clase TClipBoard y tratar dentro del programa dichos datos. He estado probando la clase TWCapture (***) y he visto que se puede manipular una ventana, pero no veo cómo puedo capturar el contenido de dicha ventana pulsando un botón para llevarlo al clipboard, pues si fuera así, creo que podría resolver mi problema y ahorrarle pasos al usuario. Las pruebas se pueden hacer también con el notepad como aplicación externa 'embebida' No se si me he explicado, si no es así me lo dicen. Si me puede decir cómo se lo agradezco. Un saludo. Antonio Aguilar (*) ------------------------------------------------------------------------------ CLASS tAppbox César E. Lozada <!-- e --><a href="mailto:cesarlozada@hotmail.com">cesarlozada@hotmail.com</a><!-- e --> Valencia - Venezuela March 2, 2002 With this class you can embedd an external application window into a control of your window or dialog application ------------------------------------------------------------------------------ (**) ------------------------------------------------------------------------------ CLASS TClipBoard Windows clipboard as an Object. FiveWin <!-- w --><a class="postlink" href="http://www.fivetechsoft.com">www.fivetechsoft.com</a><!-- w --> The clipboard provides a mechanism that makes it possible for applications to pass data handles to other applications. Clipboard functions carry out data interchange between Windows applications. ------------------------------------------------------------------------------- (***) ------------------------------------------------------------------------------ AUTOR.....: Manuel Exp¢sito Su rez Soft 4U '2001 e-Mail....: <!-- e --><a href="mailto:maex14@dipusevilla.es">maex14@dipusevilla.es</a><!-- e --> CLASE.....: TWCapture FECHA MOD.: 18/08/2001 VERSION...: 1.00 PROPOSITO.: Captura una ventana abierta por nuestro programa o por otra aplicacion para poder enviarle mensajes como si fuera una ventana mas de nuestro programa. ------------------------------------------------------------------------------
Capturar contenido de una ventan externa
Antonio, Puedes enviarme por email la clase TAppBox ? Gracias,
Capturar contenido de una ventan externa
Antonio: Te he enviado a tu email las dos clases (TWAppbox y TWCapture). La TClipboard es propia del FW. A ver si hay alguna solución para realizar lo que pretendo: que pulsando un botón se pueda seleccionar el texto de lo hay en la pantalla 'embebida', llevarmelo al clipboard y a partir de aquí ya puedo cogerlo y tratar dicha información. La clase TWCapture 'juega' con la ventana y hasta hace una raya en ella pero no tengo ni remota idea de como seleccionar el texto y llevarmelo al clipboard. Gracias por anticipado si ven alguna forma de hacerlo. Un saludo.
Capturar dados de um GPS
Alguem saberia como capturar dados de um GPS, ou seja, como poderia ser esta integração entre o GPS e o sistema, gostaria de desenvolver um sistema de monitoramento usando o GOOGLE MAPS. Grato
Capturar dados de um GPS
En estos temas se hable de ello; [b:2m8l5nu7]capturar dados do GPS com FIVEWIN é possível?[/b:2m8l5nu7] <!-- m --><a class="postlink" href="http://fivetechsoft.com/forums/viewtopic.php?t=9623&highlight=gps">http://fivetechsoft.com/forums/viewtopi ... hlight=gps</a><!-- m --> [b:2m8l5nu7]GPS[/b:2m8l5nu7] <!-- m --><a class="postlink" href="http://fivetechsoft.com/forums/viewtopic.php?t=7301&highlight=gps">http://fivetechsoft.com/forums/viewtopi ... hlight=gps</a><!-- m --> [b:2m8l5nu7]Leer Gps[/b:2m8l5nu7] <!-- m --><a class="postlink" href="http://fivetechsoft.com/forums/viewtopic.php?t=8612">http://fivetechsoft.com/forums/viewtopic.php?t=8612</a><!-- m -->
Capturar dados de um GPS
Grato Jm Garcia
Capturar datos desde un puerto serial
Hola a todosNecesito capturar datos desde un puerto serial y guardarlo en un archivode texto. Alguien me puede ayudar pasandome un proceso. o indicarme como hacerlo.le agradezco muchisimoSaludos desde Bolivia
Capturar datos desde un puerto serial
Hola a todos Necesito capturar datos desde un puerto serial y guardarlo en un archivo de texto. Alguien me puede ayudar pasandome un proceso. o indicarme como hacerlo. le agradezco muchisimo Saludos desde BoliviaAdhemar
Capturar datos desde un puerto serial
Adhemar,Revisa FWH/samples/TestComm.prg
Capturar datos desde un puerto serial
Please review FWH/samples/TestComm.prg
Capturar datos desde un puerto serial
Gracias distinguidoLo que necesito es algo como el HiperTerminal pero que me permita guardar los datos en un achivo y poder ir leyendolo necesito mas ayudaSaludosAdhemar
Capturar datos desde un puerto serial
Revisa FWH\samples\Terminal.prg Es un terminal de comunicaciones hecho con FWH <!-- s:-) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":-)" title="Smile" /><!-- s:-) -->
Capturar datos desde un puerto serial
ó<!-- m --><a class="postlink" href="http://www.fivewin.com.br/exibedicas.asp?id=846">http://www.fivewin.com.br/exibedicas.asp?id=846</a><!-- m --><!-- m --><a class="postlink" href="http://www.fivewin.com.br/exibedicas.asp?id=606">http://www.fivewin.com.br/exibedicas.asp?id=606</a><!-- m -->Saludos.
Capturar datos desde un puerto serial
Gracias Antonio y karinhaEl Terminal.prg me funcionó, los otros LeeCOM y Porta no puede.Luego le comento como me va.SaludosAdhemar
Capturar datos desde un puerto serial
Antoniodel programa TERMINAL.PRGComo hago para que @ 0, 0 GET oGet VAR cTxt MEMO READONLY oGet:bKeyDown = { | nKey | Tasti( nCom, nKey ) } tenga un tamaño especifico, ya que lo he colocado en la ventana principaly se expande en toda, y yo quiero solo la mitad de la ventana, Ya que en la otra mitad tengo que mostrar la cadena depurada.Gracias por tu ayudaSaludosAdhemar
Capturar datos desde un puerto serial
Adhemar,Quita esta línea:oGet:AdjClient()y dale al GET ... MEMO el tamaño que desees: @ 0, 0 GET oGet VAR cTxt MEMO READONLY SIZE ..., ...
Capturar datos desde un puerto serial
Gracias Distinguido por su tiempo y ayuda.Me funcionó.Una mas. Con el mismo programa TERMINAL.PRG cuando pulso las teclas numericas de la derecha del teclado me salen letras y con los signos cualquier caracater. Esto porque? ó que hay que cambiarle?SaludosAdhemar
Capturar datos en un browse asi como en excel
Amigo del foro, buen dia para todos. Necesito lo siguiente: Como hago para capturar datos en un brose algo similar a lo que hace excel, pero que al mismo tiempo pueda validar lo que he digitado, osea que si capturo un articulo y este existe que me actualice los precios dentro del mismo registro. Uso fwh 2.7 browse nativo, xharbour
Capturar dirección de correo de quien ejecuta el programa
Buenos días, necesito capturar la dirección de coreo electónico (Outlool) de la persona que ejecute el programa, para así poder enviar mensaje de correo con su cuenta. Alguna idea ? Muchas gracias. Saludos
Capturar dirección de correo de quien ejecuta el programa
Talvez: [url:8hqwj9mp]http&#58;//forums&#46;fivetechsupport&#46;com/viewtopic&#46;php?f=6&t=19977[/url:8hqwj9mp] salu2
Capturar dirección de correo de quien ejecuta el programa
Buenas La unica manera q se me ocurre es solo valida si el usuario es el q esta autenticado . Con wnetuser () o una d estas te da el login. A partir d aqui via ldap puedes acceder a los datos del user entre ellos el mail.
Capturar e Imagen el PREVIEW de TPRINTER
Hola: como puedo guardar la imagen al momento de hacer un PREVIEW con TPRINTER, deja una copia de la imagen que muestra en la pantalla pero sin la intervencion del usuario saludos, mauricio
Capturar e Imagen el PREVIEW de TPRINTER
Mauricio, Debes modificar la clase RPREVIEW.PRG para guardar los archivos en otra carpeta diferente a la carpeta temporal de windows. La variables a tratar e ::oDevice:aMeta ahi se encuentra el path y nombre del archivo de cada pagina generada en el preview. Espero te ayude la informaicón
Capturar e Imagen el PREVIEW de TPRINTER
Mauricio, talvez este post te pueda servir de ayuda. <!-- l --><a class="postlink-local" href="http://forums.fivetechsupport.com/viewtopic.php?f=6&t=13291&start=0&hilit=guardar+y+abrir">viewtopic.php?f=6&t=13291&start=0&hilit=guardar+y+abrir</a><!-- l --> Saludos.
Capturar e Imagen el PREVIEW de TPRINTER
Gracias Willy & Francisco <!-- s:mrgreen: --><img src="{SMILIES_PATH}/icon_mrgreen.gif" alt=":mrgreen:" title="Mr. Green" /><!-- s:mrgreen: -->
Capturar e Imagen el PREVIEW de TPRINTER
Yo lo hago sin tener que modificar en nada la clase, mira como lo resuelvo en el post : [url:1efgrsct]http&#58;//forums&#46;fivetechsupport&#46;com/viewtopic&#46;php?f=6&t=20328[/url:1efgrsct] Además me dedico a convertir el meta, en un pdf, para almacenarlo en otra carpeta del PC. Un saludo José Luis
Capturar e Imagen el PREVIEW de TPRINTER
Jose Luis: Ya tengo el Metafile con excelente calidad, pero al convertirlo a PDF pierde mucha resolucion. que Conversor a PDF estan usando? probe con nConvert.exe saludos, Mauricio
Capturar e Imagen el PREVIEW de TPRINTER
Mauricio, yo uso nconvert, y va bastante bien. Un saludo y felices fiestas José Luis
Capturar e Imagen el PREVIEW de TPRINTER
Jose Luis: que parametros utilizas en la conversion? saludos, Mauricio
Capturar e Imagen el PREVIEW de TPRINTER
Mauricio, a mi me queda así: [code=fw:2g4z1txw]<div class="fw" id="{CB}" style="font-family: monospace;"><br />nconvert -o c:\temp\nombrearchivosalida -quiet -out pdf -c <span style="color: #000000;">5</span> nombrearchivoentrada<br />&nbsp;</div>[/code:2g4z1txw] Un saludo José Luis
Capturar el motivo del error petición web (curl)
Hola buenas tardes, En algunas ocasiones y dependiendo de la maquina desde donde se lance la petición, la aplicación no logra enviar la solicitud ohttp:Send, nosotros colocamos un mensaje personalizado que indica que no se pudo enviar; existe alguna forma de capturar el motivo especifico por el cual no se pudo enviar la petición. Cabe aclarar que hay conexión a internet y la url a la cual estamos consultando tambien existe, como digo funciona correctamente en otros computares que están conectados a la misma LAN. [code=fw:262wxkue]<div class="fw" id="{CB}" style="font-family: monospace;"><br />            cBas64 := hb_base64encode<span style="color: #000000;">&#40;</span>::<span style="color: #000000;">user</span>+<span style="color: #ff0000;">":"</span>+::<span style="color: #000000;">pass</span>,len<span style="color: #000000;">&#40;</span>::<span style="color: #000000;">user</span>+<span style="color: #ff0000;">":"</span>+::<span style="color: #000000;">pass</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span> <br />            ohttp := CreateObject<span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"MSXML2.XMLHTTP"</span> <span style="color: #000000;">&#41;</span><br />            ohttp:<span style="color: #000000;">Open</span><span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"POST"</span> , ::<span style="color: #000000;">urlenvio</span> ,.F.<span style="color: #000000;">&#41;</span><br />            oHttp:<span style="color: #000000;">SetRequestHeader</span><span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"cache-control"</span>, <span style="color: #ff0000;">"no-cache"</span><span style="color: #000000;">&#41;</span><br />            ohttp:<span style="color: #000000;">SetRequestHeader</span><span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"content-type"</span>, <span style="color: #ff0000;">"application/json"</span> <span style="color: #000000;">&#41;</span><br />            ohttp:<span style="color: #000000;">SetRequestHeader</span><span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"authorization"</span>, <span style="color: #ff0000;">"Basic "</span>+cBas64 <span style="color: #000000;">&#41;</span><br />            <span style="color: #00C800;">TRY</span><br />                ohttp:<span style="color: #000000;">Send</span><span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">cdnaJson</span> <span style="color: #000000;">&#41;</span><br />            CATCH<br />                                <span style="color: #B900B9;">//NOS GUSTARIA PODER CAPTURAR EL ERROR Y SABER EL MOTIVO POR EL QUE NO SE PUDO ENVIAR</span><br />                <span style="color: #0000ff;">msginfo</span><span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"No Se Pudo Enviar Documento JSON - Error URL"</span>,<span style="color: #ff0000;">"error url"</span><span style="color: #000000;">&#41;</span><br />            END <br /> </div>[/code:262wxkue]
Capturar el motivo del error petición web (curl)
[quote="leandro":2nvylbdl]Hola buenas tardes, En algunas ocasiones y dependiendo de la maquina desde donde se lance la petición, la aplicación no logra enviar la solicitud ohttp:Send, nosotros colocamos un mensaje personalizado que indica que no se pudo enviar; existe alguna forma de capturar el motivo especifico por el cual no se pudo enviar la petición. Cabe aclarar que hay conexión a internet y la url a la cual estamos consultando tambien existe, como digo funciona correctamente en otros computares que están conectados a la misma LAN. [code=fw:2nvylbdl]<div class="fw" id="{CB}" style="font-family: monospace;"><br />            cBas64 := hb_base64encode<span style="color: #000000;">&#40;</span>::<span style="color: #000000;">user</span>+<span style="color: #ff0000;">":"</span>+::<span style="color: #000000;">pass</span>,len<span style="color: #000000;">&#40;</span>::<span style="color: #000000;">user</span>+<span style="color: #ff0000;">":"</span>+::<span style="color: #000000;">pass</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span> <br />            ohttp := CreateObject<span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"MSXML2.XMLHTTP"</span> <span style="color: #000000;">&#41;</span><br />            ohttp:<span style="color: #000000;">Open</span><span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"POST"</span> , ::<span style="color: #000000;">urlenvio</span> ,.F.<span style="color: #000000;">&#41;</span><br />            oHttp:<span style="color: #000000;">SetRequestHeader</span><span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"cache-control"</span>, <span style="color: #ff0000;">"no-cache"</span><span style="color: #000000;">&#41;</span><br />            ohttp:<span style="color: #000000;">SetRequestHeader</span><span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"content-type"</span>, <span style="color: #ff0000;">"application/json"</span> <span style="color: #000000;">&#41;</span><br />            ohttp:<span style="color: #000000;">SetRequestHeader</span><span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"authorization"</span>, <span style="color: #ff0000;">"Basic "</span>+cBas64 <span style="color: #000000;">&#41;</span><br />            <span style="color: #00C800;">TRY</span><br />                ohttp:<span style="color: #000000;">Send</span><span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">cdnaJson</span> <span style="color: #000000;">&#41;</span><br />            CATCH<br />                                <span style="color: #B900B9;">//NOS GUSTARIA PODER CAPTURAR EL ERROR Y SABER EL MOTIVO POR EL QUE NO SE PUDO ENVIAR</span><br />                <span style="color: #0000ff;">msginfo</span><span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"No Se Pudo Enviar Documento JSON - Error URL"</span>,<span style="color: #ff0000;">"error url"</span><span style="color: #000000;">&#41;</span><br />            END <br /> </div>[/code:2nvylbdl][/quote:2nvylbdl] Leandro [code=fw:2nvylbdl]<div class="fw" id="{CB}" style="font-family: monospace;"><br />            <span style="color: #00C800;">TRY</span><br />                ohttp:<span style="color: #000000;">Send</span><span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">cdnaJson</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; cRet := ohttp:<span style="color: #000000;">ResponseText</span><br />            CATCH<br />                                <span style="color: #B900B9;">//NOS GUSTARIA PODER CAPTURAR EL ERROR Y SABER EL MOTIVO POR EL QUE NO SE PUDO ENVIAR</span><br />                <span style="color: #0000ff;">msginfo</span><span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"No Se Pudo Enviar Documento JSON - Error URL"</span>,<span style="color: #ff0000;">"error url"</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ? cRet<br />            END <br />&nbsp;</div>[/code:2nvylbdl] También has de valorar usar la libreria CURL
Capturar el motivo del error petición web (curl)
Leandro, aparte de lo que te envió Cristobal, tal vez te sirva esto: [code=fw:2crzqc9r]<div class="fw" id="{CB}" style="font-family: monospace;">     <br />             <span style="color: #00C800;">TRY</span><br />                ohttp:<span style="color: #000000;">Send</span><span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">cdnaJson</span> <span style="color: #000000;">&#41;</span><br />                cRet := ohttp:<span style="color: #000000;">ResponseText</span><br />            CATCH oError<br /><br />                    <span style="color: #0000ff;">MsgInfo</span><span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"Error"</span> + CRLF  + <span style="color: #ff0000;">"Error: "</span> + cValToChar<span style="color: #000000;">&#40;</span> oError:<span style="color: #000000;">GenCode</span><span style="color: #000000;">&#41;</span> + CRLF + ;<br />                   <span style="color: #ff0000;">"SubC: "</span> + cValToChar<span style="color: #000000;">&#40;</span> oError:<span style="color: #000000;">GenCode</span><span style="color: #000000;">&#41;</span> + CRLF + <span style="color: #ff0000;">"OSCode: "</span> + cValToChar<span style="color: #000000;">&#40;</span> oError:<span style="color: #000000;">GenCode</span><span style="color: #000000;">&#41;</span> + CRLF + ;<br />                   <span style="color: #ff0000;">"SubSystem: "</span> + cValToChar<span style="color: #000000;">&#40;</span> oError:<span style="color: #000000;">SubSystem</span> <span style="color: #000000;">&#41;</span> + CRLF + <span style="color: #ff0000;">"Envio de CURL: "</span> + oError:<span style="color: #000000;">Description</span> <span style="color: #000000;">&#41;</span><br /><br />                                <span style="color: #B900B9;">//NOS GUSTARIA PODER CAPTURAR EL ERROR Y SABER EL MOTIVO POR EL QUE NO SE PUDO ENVIAR</span><br />                <span style="color: #0000ff;">msginfo</span><span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"No Se Pudo Enviar Documento JSON - Error URL"</span>,<span style="color: #ff0000;">"error url"</span><span style="color: #000000;">&#41;</span><br />                ? cRet<br />            END<br /> </div>[/code:2crzqc9r] Saludos Carlos.
Capturar el motivo del error petición web (curl)
Muchas gracias por las respuestas, creo que la de Carlos es la que mas se ajusta a nuestra necesidad. El motivo del error: [code=fw:2dz1q51i]<div class="fw" id="{CB}" style="font-family: monospace;"><br />Error: <span style="color: #000000;">1001</span> SubC: <span style="color: #000000;">1001</span><br />OSCode: <span style="color: #000000;">1001</span><br />SubSystem: <span style="color: #000000;">MSXML2</span>.XMLHTTP<br />Envio de CURL: <span style="color: #000000;">DISP_E_MEMBERNOTFOUND</span><br /> </div>[/code:2dz1q51i] Alguien sabe como lo podemos solucionar? Amigo Cristóbal, en donde encuentro ejemplos sobre la librería curl?
Capturar el motivo del error petición web (curl)
[quote="leandro":eefav946]Muchas gracias por las respuestas, creo que la de Carlos es la que mas se ajusta a nuestra necesidad. El motivo del error: [code=fw:eefav946]<div class="fw" id="{CB}" style="font-family: monospace;"><br />Error: <span style="color: #000000;">1001</span> SubC: <span style="color: #000000;">1001</span><br />OSCode: <span style="color: #000000;">1001</span><br />SubSystem: <span style="color: #000000;">MSXML2</span>.XMLHTTP<br />Envio de CURL: <span style="color: #000000;">DISP_E_MEMBERNOTFOUND</span><br /> </div>[/code:eefav946] Alguien sabe como lo podemos solucionar? Amigo Cristóbal, en donde encuentro ejemplos sobre la librería curl?[/quote:eefav946] Entonces es que no te he entendido: si lo que pretendes es capturar un error de programación o ejecución, estoy de acuerdo. Si lo que necesitas es capturar si la respuesta del API o servicio web que estás atacando te devuelve un código de error te recomiendo que uses lo que te he puesto y analices el contenido de la respuesta que te da el servidor ( no hay una forma genérica de hacerlo, ya que cada server devolverá según esté programado el API o servicio ) En cuanto a la libreria CURL hay bastantes ejemplos en el foro, pero miro a ver si te puedo construir ese mismo ejemplo.
Capturar el motivo del error petición web (curl)
Amigo buenas noches como estas? Revisando en el foro, puede encontrar un ejemplo que publicaste, para compilar con xharbour, incluyendo la librería hbcur.lib. Pero agregando la función que colocaste me salen los siguientes errores: [url:37cfr4f8]http&#58;//forums&#46;fivetechsupport&#46;com/viewtopic&#46;php?f=3&t=40437&p=241434&hilit=curl+xharbour&sid=83943fd443094141a77f5e0834bb4ac0&sid=d699d9e1c47f549e8b8a5829430cb47c#p241692[/url:37cfr4f8] Tampoco encuentro el #include "hbcurl.ch" [code=fw:37cfr4f8]<div class="fw" id="{CB}" style="font-family: monospace;"><br />Turbo Incremental Link <span style="color: #000000;">6.80</span> Copyright <span style="color: #000000;">&#40;</span>c<span style="color: #000000;">&#41;</span> <span style="color: #000000;">1997</span><span style="color: #000000;">-2017</span> Embarcadero Technologies, Inc.<br />Error: <span style="color: #000000;">Unresolved</span> external <span style="color: #ff0000;">'_curl_global_init_mem'</span> referenced <span style="color: #0000ff;">from</span> C:\XHAR1906\LIB\HBCURL.LIB|hbcurl<br />Error: <span style="color: #000000;">Unresolved</span> external <span style="color: #ff0000;">'_curl_global_cleanup'</span> referenced <span style="color: #0000ff;">from</span> C:\XHAR1906\LIB\HBCURL.LIB|hbcurl<br />Error: <span style="color: #000000;">Unresolved</span> external <span style="color: #ff0000;">'_curl_formfree'</span> referenced <span style="color: #0000ff;">from</span> C:\XHAR1906\LIB\HBCURL.LIB|hbcurl<br />Error: <span style="color: #000000;">Unresolved</span> external <span style="color: #ff0000;">'_curl_easy_cleanup'</span> referenced <span style="color: #0000ff;">from</span> C:\XHAR1906\LIB\HBCURL.LIB|hbcurl<br />Error: <span style="color: #000000;">Unresolved</span> external <span style="color: #ff0000;">'_curl_easy_reset'</span> referenced <span style="color: #0000ff;">from</span> C:\XHAR1906\LIB\HBCURL.LIB|hbcurl<br />Error: <span style="color: #000000;">Unresolved</span> external <span style="color: #ff0000;">'_curl_easy_duphandle'</span> referenced <span style="color: #0000ff;">from</span> C:\XHAR1906\LIB\HBCURL.LIB|hbcurl<br />Error: <span style="color: #000000;">Unresolved</span> external <span style="color: #ff0000;">'_curl_easy_init'</span> referenced <span style="color: #0000ff;">from</span> C:\XHAR1906\LIB\HBCURL.LIB|hbcurl<br />Error: <span style="color: #000000;">Unresolved</span> external <span style="color: #ff0000;">'_curl_easy_pause'</span> referenced <span style="color: #0000ff;">from</span> C:\XHAR1906\LIB\HBCURL.LIB|hbcurl<br />Error: <span style="color: #000000;">Unresolved</span> external <span style="color: #ff0000;">'_curl_easy_perform'</span> referenced <span style="color: #0000ff;">from</span> C:\XHAR1906\LIB\HBCURL.LIB|hbcurl<br />Error: <span style="color: #000000;">Unresolved</span> external <span style="color: #ff0000;">'_curl_easy_send'</span> referenced <span style="color: #0000ff;">from</span> C:\XHAR1906\LIB\HBCURL.LIB|hbcurl<br />Error: <span style="color: #000000;">Unresolved</span> external <span style="color: #ff0000;">'_curl_easy_recv'</span> referenced <span style="color: #0000ff;">from</span> C:\XHAR1906\LIB\HBCURL.LIB|hbcurl<br />Error: <span style="color: #000000;">Unresolved</span> external <span style="color: #ff0000;">'_curl_formadd'</span> referenced <span style="color: #0000ff;">from</span> C:\XHAR1906\LIB\HBCURL.LIB|hbcurl<br />Error: <span style="color: #000000;">Unresolved</span> external <span style="color: #ff0000;">'_curl_slist_append'</span> referenced <span style="color: #0000ff;">from</span> C:\XHAR1906\LIB\HBCURL.LIB|hbcurl<br />Error: <span style="color: #000000;">Unresolved</span> external <span style="color: #ff0000;">'_curl_easy_setopt'</span> referenced <span style="color: #0000ff;">from</span> C:\XHAR1906\LIB\HBCURL.LIB|hbcurl<br />Error: <span style="color: #000000;">Unresolved</span> external <span style="color: #ff0000;">'_curl_easy_getinfo'</span> referenced <span style="color: #0000ff;">from</span> C:\XHAR1906\LIB\HBCURL.LIB|hbcurl<br />Error: <span style="color: #000000;">Unresolved</span> external <span style="color: #ff0000;">'_curl_slist_free_all'</span> referenced <span style="color: #0000ff;">from</span> C:\XHAR1906\LIB\HBCURL.LIB|hbcurl<br />Error: <span style="color: #000000;">Unresolved</span> external <span style="color: #ff0000;">'_curl_easy_escape'</span> referenced <span style="color: #0000ff;">from</span> C:\XHAR1906\LIB\HBCURL.LIB|hbcurl<br />Error: <span style="color: #000000;">Unresolved</span> external <span style="color: #ff0000;">'_curl_easy_unescape'</span> referenced <span style="color: #0000ff;">from</span> C:\XHAR1906\LIB\HBCURL.LIB|hbcurl<br />Error: <span style="color: #000000;">Unresolved</span> external <span style="color: #ff0000;">'_curl_version'</span> referenced <span style="color: #0000ff;">from</span> C:\XHAR1906\LIB\HBCURL.LIB|hbcurl<br />Error: <span style="color: #000000;">Unresolved</span> external <span style="color: #ff0000;">'_curl_version_info'</span> referenced <span style="color: #0000ff;">from</span> C:\XHAR1906\LIB\HBCURL.LIB|hbcurl<br />Error: <span style="color: #000000;">Unresolved</span> external <span style="color: #ff0000;">'_curl_easy_strerror'</span> referenced <span style="color: #0000ff;">from</span> C:\XHAR1906\LIB\HBCURL.LIB|hbcurl<br />Error: <span style="color: #000000;">Unresolved</span> external <span style="color: #ff0000;">'_curl_getdate'</span> referenced <span style="color: #0000ff;">from</span> C:\XHAR1906\LIB\HBCURL.LIB|hbcurl<br />Error: <span style="color: #000000;">Unresolved</span> external <span style="color: #ff0000;">'_curl_escape'</span> referenced <span style="color: #0000ff;">from</span> C:\XHAR1906\LIB\HBCURL.LIB|hbcurl<br />Error: <span style="color: #000000;">Unresolved</span> external <span style="color: #ff0000;">'_curl_unescape'</span> referenced <span style="color: #0000ff;">from</span> C:\XHAR1906\LIB\HBCURL.LIB|hbcurl<br />Error: <span style="color: #000000;">Unresolved</span> external <span style="color: #ff0000;">'_curl_free'</span> referenced <span style="color: #0000ff;">from</span> C:\XHAR1906\LIB\HBCURL.LIB|hbcurl<br />Error: <span style="color: #000000;">Unable</span> <span style="color: #0000ff;">to</span> perform link<br />Link Error <br />&nbsp;</div>[/code:37cfr4f8] Te agradecería si tienes entre tus cosas un ejemplo funciona para xharbour <!-- s:oops: --><img src="{SMILIES_PATH}/icon_redface.gif" alt=":oops:" title="Embarassed" /><!-- s:oops: --> de antemano gracias.
Capturar el motivo del error petición web (curl)
Añade las librerias libcurl.lib y hbcurl.lib
Capturar el motivo del error petición web (curl)
Amigo de nuevo gracias por responder Agregue las librerías como mencionaste, permitió compilar, agregue hbcurl.ch, tambien me pidió la libcurl.dll, la cual copie en la carpeta al lado del ejecutable. Pero al lanzar la función ejemplo sale el siguiente error: [img:aegt29rn]https&#58;//hymplus&#46;com/forofw/curlib_error&#46;png[/img:aegt29rn]
Capturar el motivo del error petición web (curl)
Buenas noches para todos [quote:sx15vork]Error: 1001 SubC: 1001 OSCode: 1001 SubSystem: MSXML2.XMLHTTP Envio de CURL: DISP_E_MEMBERNOTFOUND[/quote:sx15vork] hemos logrado detectar que el error mencionado con anterioridad, solo sale cuando direccionamos al servidor nuevo, en el anterior funciona de manera correcta. De casualidad alguien sabe a que se pueda deber? es necesario instalar algún complemento en el nuevo servidor, algo de seguridad? Cabe recordar que solo sucede en algunos computadores, sobre todo en los que tienen windows7. y que la prueba se hizo en el mismo computador y lo único que cambiamos fue la dirección web. Cuando lo direccionamos al servidor <!-- m --><a class="postlink" href="https://hymplus.com/servicios/autorizados">https://hymplus.com/servicios/autorizados</a><!-- m --> funciona [color=#008040:sx15vork]correctamente[/color:sx15vork] pero al direccionarlo al servidor <!-- m --><a class="postlink" href="https://hymlyma.com/servicios/autorizados">https://hymlyma.com/servicios/autorizados</a><!-- m --> es en donde sale el [color=#FF0040:sx15vork]error [/color:sx15vork]
Capturar el motivo del error petición web (curl)
Buenas tardes para todos Bueno les cuento que buscando solucionar este problema que tenemos, logramos compilar la aplicación con harbour, como nos recomendó Cristobal, estamos intentando usar la libreria curl, el problema ahora es que no logramos que el servidor nos entregue una respuesta. Necesitamos ayuda para traducir el código que veníamos usando por el de la libreria curl. Código anterior [code=fw:2m170l8o]<div class="fw" id="{CB}" style="font-family: monospace;"><br />            cBas64 := hb_base64encode<span style="color: #000000;">&#40;</span>::<span style="color: #000000;">user</span>+<span style="color: #ff0000;">":"</span>+::<span style="color: #000000;">pass</span>,len<span style="color: #000000;">&#40;</span>::<span style="color: #000000;">user</span>+<span style="color: #ff0000;">":"</span>+::<span style="color: #000000;">pass</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span><br />            ohttp := CreateObject<span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"MSXML2.XMLHTTP"</span> <span style="color: #000000;">&#41;</span><br />            ohttp:<span style="color: #000000;">Open</span><span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"POST"</span> , ::<span style="color: #000000;">urlenvio</span> ,.F.<span style="color: #000000;">&#41;</span><br />            oHttp:<span style="color: #000000;">SetRequestHeader</span><span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"cache-control"</span>, <span style="color: #ff0000;">"no-cache"</span><span style="color: #000000;">&#41;</span><br />            ohttp:<span style="color: #000000;">SetRequestHeader</span><span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"content-type"</span>, <span style="color: #ff0000;">"application/json"</span> <span style="color: #000000;">&#41;</span><br />            ohttp:<span style="color: #000000;">SetRequestHeader</span><span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"authorization"</span>, <span style="color: #ff0000;">"Basic "</span>+cBas64 <span style="color: #000000;">&#41;</span><br />            <span style="color: #00C800;">TRY</span><br />                ohttp:<span style="color: #000000;">Send</span><span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">cdnaJson</span> <span style="color: #000000;">&#41;</span><br />                response :=  ohttp:<span style="color: #000000;">responseText</span><br />            CATCH oError<br />                cError := <span style="color: #ff0000;">"Error: "</span> + cValToChar<span style="color: #000000;">&#40;</span> oError:<span style="color: #000000;">GenCode</span><span style="color: #000000;">&#41;</span> + ;<br />                        <span style="color: #ff0000;">" SubC: "</span> + cValToChar<span style="color: #000000;">&#40;</span> oError:<span style="color: #000000;">GenCode</span><span style="color: #000000;">&#41;</span> + <span style="color: #ff0000;">" OSCode: "</span> + cValToChar<span style="color: #000000;">&#40;</span> oError:<span style="color: #000000;">GenCode</span><span style="color: #000000;">&#41;</span> + CRLF + ;<br />                        <span style="color: #ff0000;">"SubSystem: "</span> + cValToChar<span style="color: #000000;">&#40;</span> oError:<span style="color: #000000;">SubSystem</span> <span style="color: #000000;">&#41;</span> + CRLF + <span style="color: #ff0000;">"Envio de CURL: "</span> + oError:<span style="color: #000000;">Description</span> <br />                exito := <span style="color: #000000;">&#123;</span>.f.,cError<span style="color: #000000;">&#125;</span><br /><br />                <span style="color: #00C800;">return</span> exito<br />            END <br /> </div>[/code:2m170l8o] Código con curl, que encontramos en el foro [code=fw:2m170l8o]<div class="fw" id="{CB}" style="font-family: monospace;"><br />            cBas64 := hb_base64encode<span style="color: #000000;">&#40;</span>::<span style="color: #000000;">user</span>+<span style="color: #ff0000;">":"</span>+::<span style="color: #000000;">pass</span>,len<span style="color: #000000;">&#40;</span>::<span style="color: #000000;">user</span>+<span style="color: #ff0000;">":"</span>+::<span style="color: #000000;">pass</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span><br />            curl_global_init<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />            hCurl := curl_easy_init<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />            <span style="color: #00C800;">if</span> !empty<span style="color: #000000;">&#40;</span> hCurl <span style="color: #000000;">&#41;</span><br /><br />                curl_easy_setopt<span style="color: #000000;">&#40;</span> hCurl, HB_CURLOPT_URL, ::<span style="color: #000000;">urlenvio</span> <span style="color: #000000;">&#41;</span><br />                AAdd<span style="color: #000000;">&#40;</span> aHeaders, <span style="color: #ff0000;">"authorization: Basic "</span>+cBas64 <span style="color: #000000;">&#41;</span> <br />                AAdd<span style="color: #000000;">&#40;</span> aHeaders, <span style="color: #ff0000;">"content-type : application/json"</span> <span style="color: #000000;">&#41;</span>   <br />                AAdd<span style="color: #000000;">&#40;</span> aHeaders, <span style="color: #ff0000;">"cache-control : no-cache"</span> <span style="color: #000000;">&#41;</span>   <br />                curl_easy_setopt<span style="color: #000000;">&#40;</span> hCurl, HB_CURLOPT_HTTPHEADER, aHeaders <span style="color: #000000;">&#41;</span><br />                curl_easy_setopt<span style="color: #000000;">&#40;</span> hCurl, HB_CURLOPT_CONNECTTIMEOUT , <span style="color: #000000;">100</span> <span style="color: #000000;">&#41;</span><br />                curl_easy_setopt<span style="color: #000000;">&#40;</span> hCurl, HB_CURLOPT_POST, <span style="color: #000000;">1</span><span style="color: #000000;">&#41;</span><br />                curl_easy_setopt<span style="color: #000000;">&#40;</span> hCurl, HB_CURLOPT_CUSTOMREQUEST, <span style="color: #ff0000;">"POST"</span><span style="color: #000000;">&#41;</span><br />                curl_easy_setopt<span style="color: #000000;">&#40;</span> hCurl, HB_CURLOPT_POSTFIELDS, ::<span style="color: #000000;">cdnaJson</span> <span style="color: #000000;">&#41;</span><br />                curl_easy_setopt<span style="color: #000000;">&#40;</span> hCurl, HB_CURLOPT_SSL_VERIFYHOST, .F. <span style="color: #000000;">&#41;</span><br />                curl_easy_setopt<span style="color: #000000;">&#40;</span> hCurl, HB_CURLOPT_SSL_VERIFYPEER, .F. <span style="color: #000000;">&#41;</span><br />                curl_easy_setopt<span style="color: #000000;">&#40;</span> hCurl, HB_CURLOPT_DL_BUFF_SETUP <span style="color: #000000;">&#41;</span><br /><br />                cError := curl_easy_perform<span style="color: #000000;">&#40;</span> hCurl <span style="color: #000000;">&#41;</span><br />                <span style="color: #00C800;">if</span> !Empty<span style="color: #000000;">&#40;</span> cError <span style="color: #000000;">&#41;</span><br />                    <span style="color: #0000ff;">MsgInfo</span><span style="color: #000000;">&#40;</span> curl_easy_strerror<span style="color: #000000;">&#40;</span> cError <span style="color: #000000;">&#41;</span>, <span style="color: #ff0000;">"Error"</span> <span style="color: #000000;">&#41;</span><br />                <span style="color: #00C800;">endif</span><br />                cTexto  := curl_easy_dl_buff_get<span style="color: #000000;">&#40;</span> hCurl <span style="color: #000000;">&#41;</span><br />                fw_memoedit<span style="color: #000000;">&#40;</span> cTexto <span style="color: #000000;">&#41;</span> <span style="color: #B900B9;">//Creo que aqui viene la respuesta </span><br />                curl_easy_reset<span style="color: #000000;">&#40;</span> hCurl <span style="color: #000000;">&#41;</span><br />            <span style="color: #00C800;">endif</span><br />            curl_global_cleanup<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>   <br /> </div>[/code:2m170l8o] Este es el error que se captura en el fw_memoedit() [code=fw:2m170l8o]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><!DOCTYPE HTML <span style="color: #00C800;">PUBLIC</span> <span style="color: #ff0000;">"-//IETF//DTD HTML 2.0//EN"</span>><br /><html><head><br /><title><span style="color: #000000;">400</span> Bad Request</title><br /></head><body><br /><h1>Bad Request</h1><br /><p>Your browser sent a request that this <span style="color: #00C800;">server</span> could not understand.<br /><br /></p><br /></body></html><br /> </div>[/code:2m170l8o] Luego de esto la aplicación se cierra sin que muestre ningún error y tampoco genera el error en el archivo error.log De antemano gracias por la ayuda
Capturar el motivo del error petición web (curl)
Mira a ver si algo de esto te ayuda [code=fw:1swdelwk]<div class="fw" id="{CB}" style="font-family: monospace;"><br />&nbsp; &nbsp; &nbsp; curl_easy_setopt<span style="color: #000000;">&#40;</span> oCurl, HB_CURLOPT_SSL_VERIFYPEER, <span style="color: #000000;">0</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; curl_easy_setopt<span style="color: #000000;">&#40;</span> oCurl, HB_CURLOPT_ENCODING, <span style="color: #ff0000;">"UTF-8"</span> <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">Do</span> <span style="color: #00C800;">Case</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #00C800;">Case</span> cType == <span style="color: #ff0000;">"POST"</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;curl_easy_setopt<span style="color: #000000;">&#40;</span> oCurl, HB_CURLOPT_DL_BUFF_SETUP <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;curl_easy_setopt<span style="color: #000000;">&#40;</span> oCurl, HB_CURLOPT_POST, <span style="color: #000000;">1</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #B900B9;">// &nbsp; //curl_easy_setopt( oCurl, HB_CURLOPT_CUSTOMREQUEST, "POST" )</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #00C800;">if</span> !Empty<span style="color: #000000;">&#40;</span> cParams <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; curl_easy_setopt<span style="color: #000000;">&#40;</span> oCurl, HB_CURLOPT_POSTFIELDS, cParams <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">endif</span><br />&nbsp; &nbsp; &nbsp;<span style="color: #00C800;">EndCase</span><br /><br />&nbsp;</div>[/code:1swdelwk]
Capturar el motivo del error petición web (curl)
No nada, sigue igual <!-- s:( --><img src="{SMILIES_PATH}/icon_sad.gif" alt=":(" title="Sad" /><!-- s:( --> [code=fw:1qx4k4d2]<div class="fw" id="{CB}" style="font-family: monospace;"><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; curl_global_init<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; hCurl := curl_easy_init<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #00C800;">if</span> !empty<span style="color: #000000;">&#40;</span> hCurl <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; curl_easy_setopt<span style="color: #000000;">&#40;</span> hCurl, HB_CURLOPT_URL, ::<span style="color: #000000;">urlenvio</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; AAdd<span style="color: #000000;">&#40;</span> aHeaders, <span style="color: #ff0000;">"authorization: Basic "</span>+cBas64 <span style="color: #000000;">&#41;</span> <br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; AAdd<span style="color: #000000;">&#40;</span> aHeaders, <span style="color: #ff0000;">"content-type : application/json"</span> <span style="color: #000000;">&#41;</span> &nbsp; <br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; AAdd<span style="color: #000000;">&#40;</span> aHeaders, <span style="color: #ff0000;">"cache-control : no-cache"</span> <span style="color: #000000;">&#41;</span> &nbsp; <br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; curl_easy_setopt<span style="color: #000000;">&#40;</span> hCurl, HB_CURLOPT_HTTPHEADER, aHeaders <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; curl_easy_setopt<span style="color: #000000;">&#40;</span> hCurl, HB_CURLOPT_CONNECTTIMEOUT , <span style="color: #000000;">100</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; curl_easy_setopt<span style="color: #000000;">&#40;</span> hCurl, HB_CURLOPT_POST, <span style="color: #000000;">1</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #B900B9;">//curl_easy_setopt( hCurl, HB_CURLOPT_CUSTOMREQUEST, "POST")</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; curl_easy_setopt<span style="color: #000000;">&#40;</span> hCurl, HB_CURLOPT_POSTFIELDS, ::<span style="color: #000000;">cdnaJson</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; curl_easy_setopt<span style="color: #000000;">&#40;</span> hCurl, HB_CURLOPT_SSL_VERIFYHOST, .F. <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; curl_easy_setopt<span style="color: #000000;">&#40;</span> hCurl, HB_CURLOPT_SSL_VERIFYPEER, .F. <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; curl_easy_setopt<span style="color: #000000;">&#40;</span> hCurl, HB_CURLOPT_DL_BUFF_SETUP <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; curl_easy_setopt<span style="color: #000000;">&#40;</span> hCurl, HB_CURLOPT_ENCODING, <span style="color: #ff0000;">"UTF-8"</span> <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; cError := curl_easy_perform<span style="color: #000000;">&#40;</span> hCurl <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #00C800;">if</span> !Empty<span style="color: #000000;">&#40;</span> cError <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">MsgInfo</span><span style="color: #000000;">&#40;</span> curl_easy_strerror<span style="color: #000000;">&#40;</span> cError <span style="color: #000000;">&#41;</span>, <span style="color: #ff0000;">"Error"</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #00C800;">endif</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; cTexto &nbsp;:= curl_easy_dl_buff_get<span style="color: #000000;">&#40;</span> hCurl <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; fw_memoedit<span style="color: #000000;">&#40;</span> cTexto <span style="color: #000000;">&#41;</span> <span style="color: #B900B9;">//Creo que aqui viene la respuesta </span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; curl_easy_reset<span style="color: #000000;">&#40;</span> hCurl <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #00C800;">endif</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; curl_global_cleanup<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp;</div>[/code:1qx4k4d2]
Capturar el motivo del error petición web (curl)
Añade al principio [code=fw:1dhe3z9m]<div class="fw" id="{CB}" style="font-family: monospace;"><br />&nbsp; &nbsp; &nbsp; curl_easy_setopt<span style="color: #000000;">&#40;</span> oCurl, HB_CURLOPT_DEFAULT_PROTOCOL, <span style="color: #ff0000;">"https"</span> <span style="color: #000000;">&#41;</span><br />&nbsp;</div>[/code:1dhe3z9m]
Capturar el motivo del error petición web (curl)
Amigo gracias por la ayuda Ahora sale este error: [code=fw:23oogu2n]<div class="fw" id="{CB}" style="font-family: monospace;"><br />Application<br />===========<br />&nbsp; &nbsp;Path and <span style="color: #0000ff;">name</span>: <span style="color: #000000;">C</span>:\DLYMA\hymlyma.exe <span style="color: #000000;">&#40;</span><span style="color: #000000;">32</span> bits<span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;<span style="color: #0000ff;">Size</span>: <span style="color: #000000;">8</span>,<span style="color: #000000;">435</span>,<span style="color: #000000;">200</span> bytes<br />&nbsp; &nbsp;Compiler version: <span style="color: #000000;">Harbour</span> <span style="color: #000000;">3.2</span>.0dev <span style="color: #000000;">&#40;</span>r2008190002<span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;FiveWin &nbsp;version: <span style="color: #000000;">FWH</span> <span style="color: #000000;">21.06</span><br />&nbsp; &nbsp;C compiler version: <span style="color: #000000;">Borland</span>/Embarcadero C++ <span style="color: #000000;">7.0</span> <span style="color: #000000;">&#40;</span><span style="color: #000000;">32</span>-bit<span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;Windows version: <span style="color: #000000;">6.2</span>, Build <span style="color: #000000;">9200</span> <br /><br />&nbsp; &nbsp;Time <span style="color: #0000ff;">from</span> start: <span style="color: #000000;">0</span> hours <span style="color: #000000;">0</span> mins <span style="color: #000000;">35</span> secs <br />&nbsp; &nbsp;Error occurred <span style="color: #00C800;">at</span>: <span style="color: #000000;">06</span>/<span style="color: #000000;">11</span>/<span style="color: #000000;">2022</span>, <span style="color: #000000;">06</span>:<span style="color: #000000;">51</span>:<span style="color: #000000;">16</span><br />&nbsp; &nbsp;Error description: <span style="color: #000000;">Error</span> BASE/<span style="color: #000000;">1003</span> &nbsp;No existe la variable: <span style="color: #000000;">HB_CURLOPT_DEFAULT_PROTOCOL</span><br />&nbsp;</div>[/code:23oogu2n]
Capturar el motivo del error petición web (curl)
[quote:1jdx3xcc] #define HB_CURLOPT_DEFAULT_PROTOCOL 0x072d00 [/quote:1jdx3xcc]
Capturar el motivo del error petición web (curl)
Amigo gracias por responder pero nada <!-- s:( --><img src="{SMILIES_PATH}/icon_sad.gif" alt=":(" title="Sad" /><!-- s:( --> Ahora esta devolviendo el error [code=fw:1hifcdph]<div class="fw" id="{CB}" style="font-family: monospace;"><br />SSL connect error<br /> </div>[/code:1hifcdph] [code=fw:1hifcdph]<div class="fw" id="{CB}" style="font-family: monospace;">            curl_global_init<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />            oCurl := curl_easy_init<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />            <span style="color: #00C800;">if</span> !empty<span style="color: #000000;">&#40;</span> oCurl <span style="color: #000000;">&#41;</span><br />                curl_easy_setopt<span style="color: #000000;">&#40;</span> oCurl, HB_CURLOPT_DEFAULT_PROTOCOL, <span style="color: #ff0000;">"https"</span> <span style="color: #000000;">&#41;</span><br />                curl_easy_setopt<span style="color: #000000;">&#40;</span> oCurl, HB_CURLOPT_URL, ::<span style="color: #000000;">urlenvio</span> <span style="color: #000000;">&#41;</span><br />                AAdd<span style="color: #000000;">&#40;</span> aHeaders, <span style="color: #ff0000;">"authorization: Basic "</span>+cBas64 <span style="color: #000000;">&#41;</span> <br />                AAdd<span style="color: #000000;">&#40;</span> aHeaders, <span style="color: #ff0000;">"content-type : application/json"</span> <span style="color: #000000;">&#41;</span>   <br />                AAdd<span style="color: #000000;">&#40;</span> aHeaders, <span style="color: #ff0000;">"cache-control : no-cache"</span> <span style="color: #000000;">&#41;</span>   <br />                curl_easy_setopt<span style="color: #000000;">&#40;</span> oCurl, HB_CURLOPT_HTTPHEADER, aHeaders <span style="color: #000000;">&#41;</span><br />                curl_easy_setopt<span style="color: #000000;">&#40;</span> oCurl, HB_CURLOPT_CONNECTTIMEOUT , <span style="color: #000000;">100</span> <span style="color: #000000;">&#41;</span><br />                curl_easy_setopt<span style="color: #000000;">&#40;</span> oCurl, HB_CURLOPT_POST, <span style="color: #000000;">1</span><span style="color: #000000;">&#41;</span><br />                <span style="color: #B900B9;">//curl_easy_setopt( oCurl, HB_CURLOPT_CUSTOMREQUEST, "POST")</span><br />                curl_easy_setopt<span style="color: #000000;">&#40;</span> oCurl, HB_CURLOPT_POSTFIELDS, ::<span style="color: #000000;">cdnaJson</span> <span style="color: #000000;">&#41;</span><br />                curl_easy_setopt<span style="color: #000000;">&#40;</span> oCurl, HB_CURLOPT_SSL_VERIFYHOST, .F. <span style="color: #000000;">&#41;</span><br />                curl_easy_setopt<span style="color: #000000;">&#40;</span> oCurl, HB_CURLOPT_SSL_VERIFYPEER, .F. <span style="color: #000000;">&#41;</span><br />                curl_easy_setopt<span style="color: #000000;">&#40;</span> oCurl, HB_CURLOPT_DL_BUFF_SETUP <span style="color: #000000;">&#41;</span><br />                curl_easy_setopt<span style="color: #000000;">&#40;</span> oCurl, HB_CURLOPT_ENCODING, <span style="color: #ff0000;">"UTF-8"</span> <span style="color: #000000;">&#41;</span><br /><br />                cError := curl_easy_perform<span style="color: #000000;">&#40;</span> oCurl <span style="color: #000000;">&#41;</span><br />                <span style="color: #00C800;">if</span> !Empty<span style="color: #000000;">&#40;</span> cError <span style="color: #000000;">&#41;</span><br />                    <span style="color: #0000ff;">MsgInfo</span><span style="color: #000000;">&#40;</span> curl_easy_strerror<span style="color: #000000;">&#40;</span> cError <span style="color: #000000;">&#41;</span>, <span style="color: #ff0000;">"Error"</span> <span style="color: #000000;">&#41;</span><br />                <span style="color: #00C800;">endif</span><br />                cTexto  := curl_easy_dl_buff_get<span style="color: #000000;">&#40;</span> oCurl <span style="color: #000000;">&#41;</span><br />                fw_memoedit<span style="color: #000000;">&#40;</span> cTexto <span style="color: #000000;">&#41;</span> <span style="color: #B900B9;">//Creo que aqui viene la respuesta </span><br />                curl_easy_reset<span style="color: #000000;">&#40;</span> oCurl <span style="color: #000000;">&#41;</span><br />            <span style="color: #00C800;">endif</span><br />            curl_global_cleanup<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /> </div>[/code:1hifcdph]
Capturar el motivo del error petición web (curl)
Leandro, contacta conmigo por mail o skype
Capturar error en conexion Mysql por odbc
Hola, Tengo un sistemita que se conecta por medio de internet a un servidor MYsql . Para inicializar la conexion tengo la siguiente funcion: function cargaSQL() public oRdd:= Trddodbc():New("subsec", "subsec", "xxxxx") public oODBC:= oRdd:oOdbc If oOdbc:lSuccess MSGINFO("Sistema inicializado correctamente","Conexión") else msgalert("El sistema no pudo abrir la base de datos, cerrando aplicacion...") oOdbc:showerrorlist() oRDD:OOdbc:end() quit Endif El problema que tengo que cuando la conexion nno esta disponible o se tarda mucho el programa no captura el error y manda un error de odbc y el programa se cierra de manera abrupta. Como puedo capturar el error para que no ocurra esto ? Gracias Rene
Capturar estructura de tabla de MSSQL con ADO?
Amigos de foro tengan buena tarde. Como dice el encabezado me gustaria saber como capturo la estructura de una tabla en mssql via ADO puro. He revisado en el foro y creo que no hay respuesta a lo que estoy buscando. De antemano Gracias
Capturar estructura de tabla de MSSQL con ADO?
Espero te sirva : //Recuperamos el Schema de la BD y filtramos por Table, y lo cargamos al combobox aTables:={} oTables := oCSql:oConn:OpenSchema(adSchemaTables) oTables:Filter := "TABLE_TYPE = 'TABLE'" While !oTables:Eof() aAdd(aTables,oTables:Fields(2):Value) oTables:MoveNext() End oTables:Close() //Cierro RecordSet Saludos
Capturar estructura de tabla de MSSQL con ADO?
Amigo lo checo mas tarde y cualquier cosa te comento... Muchas gracias por la respuesta
Capturar la Pantalla y salvarla como JPG (para Antonio)
Caray se ve muy simple. Antonio, Gracias por responder. Voy a probarlo saludos
Capturar la Pantalla y salvarla como JPG (para Antonio)
Hola FiveWinners. Alguien sabe como capturar el contenido de la pantalla y guardarla en un archivo .JPG? Y como se puede reducir el tamaño del archivo .JPG haciendo una pantalla miniatura? Asi como lo hace Windows 7 en su barra inferior. Saludos
Capturar la Pantalla y salvarla como JPG (para Antonio)
Aqui explicamos como generar un JPG a partir de una ventana: <!-- l --><a class="postlink-local" href="http://forums.fivetechsupport.com/viewtopic.php?p=93192#p93192">viewtopic.php?p=93192#p93192</a><!-- l --> El bitmap puedes reducirlo con BmpResize() y del mismo modo obtener el JPG más pequeño
Capturar la Pantalla y salvarla como JPG (para Antonio)
Antonio: lo que realmente requiero es poder capturar la imagen de la pantalla como lo ve el usuario: he usado la siguiente secuencia : DibWrite( "screen.bmp", DibFromBitmap( WndBitmap( oWnd:hWnd ) ) ) , ; ShellExecute( GetActiveWindow() ,nil, cFilePath(GetModuleFileName(GetInstance())) + "screen.bmp",'','',5) ) El resultado que me muestra es la primera pantalla o ventana que se creo, PERO, sobre ese ventana, he mostrado varios diálogos en diferentes posiciones y estos últimos NO se capturan. Ya he intentado capturar las ventanas de los diálogos, pero el resultado es que solo se captura el dialogo en si, pero no la ventana completa. Es decir lo que quiero capturar como JPG O BMP es lo que el usuario esta observando la pantalla. tienes alguna idea? Gracias Saludos
Capturar la Pantalla y salvarla como JPG (para Antonio)
[quote="devtuxtla":3nlr9d1k]Antonio: lo que realmente requiero es poder capturar la imagen de la pantalla como lo ve el usuario: he usado la siguiente secuencia : DibWrite( "screen.bmp", DibFromBitmap( WndBitmap( oWnd:hWnd ) ) ) , ; ShellExecute( GetActiveWindow() ,nil, cFilePath(GetModuleFileName(GetInstance())) + "screen.bmp",'','',5) ) El resultado que me muestra es la primera pantalla o ventana que se creo, PERO, sobre ese ventana, he mostrado varios diálogos en diferentes posiciones y estos últimos NO se capturan. Ya he intentado capturar las ventanas de los diálogos, pero el resultado es que solo se captura el dialogo en si, pero no la ventana completa. Es decir lo que quiero capturar como JPG O BMP es lo que el usuario esta observando la pantalla. tienes alguna idea? Gracias Saludos[/quote:3nlr9d1k] Aunque sea sólo por probar y según tu código, haz: DibWrite( "screen.bmp", DibFromBitmap( WndBitmap( GetDeskTopWindow() ) ) ) , ; ShellExecute( GetActiveWindow() ,nil, cFilePath(GetModuleFileName(GetInstance())) + "screen.bmp",'','',5) ) Por lo que dices, no creo que funcione pero esto es gratis. Un Saludo Carlos G.
Capturar la Pantalla y salvarla como JPG (para Antonio)
OYE Carlos... Excelente Saludos
Capturar la dirección del navegador
Buenas tardes: ¿Cómo puedo capturar desde mi aplicación, la ruta que indica mi navegador que está abierto? Necesito tomar esa dirección, para realizar un procedimiento... tengo el navegador abierto y desde mi sistema, necesito saber dónde está apuntando... Muchas gracias Roberto
Capturar la dirección del navegador
Que navegador ? Cualquier navegador ?
Capturar la dirección del navegador
Si es posible, si Antonio... del navegador que esté activo. Sino, puedo llegar a lanzar uno y usar ese, pero para librarme de eso y que el usuario pueda elegir el que más le guste... Muchas gracias! Roberto
Capturar la dirección del navegador
Roberto, [quote:3hnh0rbo]You can use Ctrl + L ; Ctrl + C. This is valid for all the browser I have used. You can also use F6; Ctrl + C this is working with chrome. You can use F4; Ctrl + C. This is working with Firefox.[/quote:3hnh0rbo] [url:3hnh0rbo]https&#58;//www&#46;edureka&#46;co/community/33916/how-to-get-the-url-of-the-current-tab-in-google-chrome[/url:3hnh0rbo] Tendrias que localizar el handle de la ventana del navegador y enviar esas combinaciones de teclas. El resultado queda en el clipboard. Prueba asi: MsgInfo( FindWindow( "Chrome_WidgetWin_1", 0 ) )
Capturar la dirección del navegador
Estoy probando asi pero aun falla el envío de Ctrl+C [code=fw:1y47iy06]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">"FiveWin.ch"</span> <br /><br /><span style="color: #00D7D7;">#define</span> WM_ACTIVATE  0x0006<br /><br /><span style="color: #00C800;">function</span> Main<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />   <span style="color: #00C800;">local</span> hWndChrome := FindWindow<span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"Chrome_WidgetWin_1"</span>, <span style="color: #000000;">0</span> <span style="color: #000000;">&#41;</span><br /><br />   PostMessage<span style="color: #000000;">&#40;</span> hWndChrome, WM_ACTIVATE, 0x1, 0x056C <span style="color: #000000;">&#41;</span> <br />   PostMessage<span style="color: #000000;">&#40;</span> hWndChrome, WM_KEYDOWN, VK_F6, <span style="color: #000000;">0</span> <span style="color: #000000;">&#41;</span><br />   PostMessage<span style="color: #000000;">&#40;</span> hWndChrome, WM_KEYUP, VK_F6, <span style="color: #000000;">0</span> <span style="color: #000000;">&#41;</span><br />   PostMessage<span style="color: #000000;">&#40;</span> hWndChrome, WM_KEYDOWN, VK_CONTROL, <span style="color: #000000;">0</span> <span style="color: #000000;">&#41;</span><br />   PostMessage<span style="color: #000000;">&#40;</span> hWndChrome, WM_KEYDOWN, <span style="color: #0000ff;">Asc</span><span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"c"</span> <span style="color: #000000;">&#41;</span>, <span style="color: #000000;">0</span> <span style="color: #000000;">&#41;</span><br />   PostMessage<span style="color: #000000;">&#40;</span> hWndChrome, WM_KEYUP, VK_CONTROL, <span style="color: #000000;">0</span> <span style="color: #000000;">&#41;</span><br />   PostMessage<span style="color: #000000;">&#40;</span> hWndChrome, WM_KEYUP, <span style="color: #0000ff;">Asc</span><span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"c"</span> <span style="color: #000000;">&#41;</span>, <span style="color: #000000;">0</span> <span style="color: #000000;">&#41;</span><br /><br />   OpenClipboard<span style="color: #000000;">&#40;</span> <span style="color: #000000;">0</span> <span style="color: #000000;">&#41;</span><br />   <span style="color: #0000ff;">MsgInfo</span><span style="color: #000000;">&#40;</span> GetClpData<span style="color: #000000;">&#40;</span> <span style="color: #000000;">1</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br />   CloseClipboard<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br /> </div>[/code:1y47iy06]
Capturar la dirección del navegador
He probado también asi pero de momento no hay suerte: [code=fw:1fa50w89]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">"fivewin.ch"</span> <br /><br /><span style="color: #00D7D7;">#define</span> WM_ACTIVATE &nbsp;0x0006<br /><br /><span style="color: #00C800;">function</span> Main<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> hWndChrome := FindWindow<span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"Chrome_WidgetWin_1"</span>, <span style="color: #000000;">0</span> <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;PostMessage<span style="color: #000000;">&#40;</span> hWndChrome, WM_ACTIVATE, 0x1, 0x056C <span style="color: #000000;">&#41;</span> <br />&nbsp; &nbsp;<span style="color: #0000ff;">Sleep</span><span style="color: #000000;">&#40;</span> <span style="color: #000000;">500</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;PostMessage<span style="color: #000000;">&#40;</span> hWndChrome, WM_KEYDOWN, VK_F6, <span style="color: #000000;">0</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;PostMessage<span style="color: #000000;">&#40;</span> hWndChrome, WM_KEYUP, VK_F6, <span style="color: #000000;">0</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;SendCtrlC<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;OpenClipboard<span style="color: #000000;">&#40;</span> <span style="color: #000000;">0</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;<span style="color: #0000ff;">MsgInfo</span><span style="color: #000000;">&#40;</span> GetClpData<span style="color: #000000;">&#40;</span> <span style="color: #000000;">1</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;CloseClipboard<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br /><br /><span style="color: #00D7D7;">#pragma</span> BEGINDUMP<br /><br /><span style="color: #00D7D7;">#include</span> <hbapi.h><br /><span style="color: #00D7D7;">#include</span> <windows.h><br /><br /><span style="color: #00C800;">HB_FUNC</span><span style="color: #000000;">&#40;</span> SENDCTRLC <span style="color: #000000;">&#41;</span><br /><span style="color: #000000;">&#123;</span><br />&nbsp; &nbsp;INPUT ip;<br />&nbsp; &nbsp;ip.type = INPUT_KEYBOARD;<br />&nbsp; &nbsp;ip.ki.wScan = <span style="color: #000000;">0</span>;<br />&nbsp; &nbsp;ip.ki.time = <span style="color: #000000;">0</span>;<br />&nbsp; &nbsp;ip.ki.dwExtraInfo = <span style="color: #000000;">0</span>;<br />&nbsp;<br />&nbsp; &nbsp;<span style="color: #B900B9;">// Press the "Ctrl" key</span><br />&nbsp; &nbsp;ip.ki.wVk = VK_CONTROL;<br />&nbsp; &nbsp;ip.ki.dwFlags = <span style="color: #000000;">0</span>; <span style="color: #B900B9;">// 0 for key press</span><br />&nbsp; &nbsp;SendInput<span style="color: #000000;">&#40;</span> <span style="color: #000000;">1</span>, &ip, sizeof<span style="color: #000000;">&#40;</span> INPUT <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span>;<br /><br />&nbsp; &nbsp;<span style="color: #B900B9;">// Press the "c" key</span><br />&nbsp; &nbsp;ip.ki.wVk = <span style="color: #ff0000;">'c'</span>;<br />&nbsp; &nbsp;ip.ki.dwFlags = <span style="color: #000000;">0</span>; <span style="color: #B900B9;">// 0 for key press</span><br />&nbsp; &nbsp;SendInput<span style="color: #000000;">&#40;</span> <span style="color: #000000;">1</span>, &ip, sizeof<span style="color: #000000;">&#40;</span> INPUT <span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span>;<br /><br />&nbsp; &nbsp;<span style="color: #B900B9;">// Release the "c" key</span><br />&nbsp; &nbsp;ip.ki.wVk = <span style="color: #ff0000;">'c'</span>;<br />&nbsp; &nbsp;ip.ki.dwFlags = KEYEVENTF_KEYUP;<br />&nbsp; &nbsp;SendInput<span style="color: #000000;">&#40;</span> <span style="color: #000000;">1</span>, &ip, sizeof<span style="color: #000000;">&#40;</span> INPUT <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span>;<br /><br />&nbsp; &nbsp;<span style="color: #B900B9;">// Release the "Ctrl" key</span><br />&nbsp; &nbsp;ip.ki.wVk = VK_CONTROL;<br />&nbsp; &nbsp;ip.ki.dwFlags = KEYEVENTF_KEYUP;<br />&nbsp; &nbsp;SendInput<span style="color: #000000;">&#40;</span> <span style="color: #000000;">1</span>, &ip, sizeof<span style="color: #000000;">&#40;</span> INPUT <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span>;<br />&nbsp; &nbsp;<br />&nbsp; &nbsp;<span style="color: #0000ff;">Sleep</span><span style="color: #000000;">&#40;</span> <span style="color: #000000;">1000</span> <span style="color: #000000;">&#41;</span>; <span style="color: #B900B9;">// pause for 1 second</span><br /><span style="color: #000000;">&#125;</span><br /><br /><span style="color: #00D7D7;">#pragma</span> ENDDUMP</div>[/code:1fa50w89]
Capturar la dirección del navegador
Muchas gracias Antonio! La consulta es, se podrá? He probado con el formato que me pasas y no tengo el resultado tampoco... Roberto
Capturar la dirección del navegador
Antonio, si lanzo mi url a WebView, no puedo obtener el resultado en algún dato? Veo que la WebView tiene un par de datas pero no devuelve eso. Avísame cuando puedas! Gracias!!
Capturar la dirección del navegador
Usando WebView es muy sencillo: [code=fw:1jvj1c7f]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">"FiveWin.ch"</span><br /><br /><span style="color: #B900B9;">//----------------------------------------------------------------------------//</span><br /><br /><span style="color: #00C800;">function</span> Main<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> oWebView := TWebView<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>:<span style="color: #00C800;">New</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;oWebView:<span style="color: #000000;">bOnBind</span> = <span style="color: #000000;">&#123;</span> | cJson, nCalls | <span style="color: #0000ff;">MsgInfo</span><span style="color: #000000;">&#40;</span> cJson, nCalls <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span><br />&nbsp; &nbsp;oWebView:<span style="color: #000000;">Bind</span><span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"SendToFWH"</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;oWebView:<span style="color: #000000;">Navigate</span><span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"https://www.google.com"</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;<span style="color: #0000ff;">Sleep</span><span style="color: #000000;">&#40;</span> <span style="color: #000000;">200</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;oWebView:<span style="color: #000000;">Eval</span><span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"SendToFWH( document.URL )"</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;oWebView:<span style="color: #000000;">Run</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;oWebView:<span style="color: #000000;">Destroy</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br /><br /><span style="color: #B900B9;">//----------------------------------------------------------------------------//</span></div>[/code:1jvj1c7f]
Capturar la dirección del navegador
Gracias Maestro... intentaré ver si puedo aplicar esto... muchas gracias!!!!!! Saludos, Roberto...
Capturar la ventana de encima de todo
Si tengo varias aplicaciones abiertas (Word, Excel, Explorer, etc), ¿alguien podría decirme cómo obtener el handle a la de encima de todo? ¿Y a la segunda (o sea, la que esté justo por debajo de ésa? Gracias
Capturar la ventana de encima de todo
Resuelto: Este código presenta las ventanas abiertas empezando por la de más arriba... [code:2ri82lzc] hWnd &#58;= GETWINDOW&#40;GETDESKTOPWINDOW&#40;&#41;, GW_CHILD&#41; DO WHILE hWnd > 0 // Para eliminar ventanas ocultas o de sistema nT &#58;= WndTop&#40;hWnd&#41; ; nT &#58;= IIF&#40;nT == NIL, 0, nT&#41; nL &#58;= WndLeft&#40;hWnd&#41; ; nL &#58;= IIF&#40;nL == NIL, 0, nL&#41; nW &#58;= WndWidth&#40;hWnd&#41; nH &#58;= WndHeight&#40;hWnd&#41; cText &#58;= GetWindowText&#40;hWnd&#41; IF nT > 0 &#46;AND&#46; nL >0 &#46;AND&#46; nW > 0 &#46;AND&#46; nH > 0 &#46;AND&#46; !EMPTY&#40;cText&#41; &#46;AND&#46; IsWindowVisible&#40;hWnd&#41; ? cText ENDIF hWnd &#58;= GETWINDOW&#40;hWnd, GW_HWNDNEXT&#41; ENDDO [/code:2ri82lzc] Rafael
Capturar mensajes
Hola. Sabe alguiuen como capturar los mensajes: WM_ENTERSIZEMODE 0x0231 WM_WXITSIZEMODE 0x9232 Necesito capturarlos desde una MDICHILD para controlar cuando refrescarla tras cambiarla de tamaño. Creo que sería interesante para mucha gente por lo que he leido en el foro.
Capturar mensajes
<!-- m --><a class="postlink" href="http://msdn.microsoft.com/pt-br/library/windows/desktop/ms632622(v=vs.85">http://msdn.microsoft.com/pt-br/library ... 22(v=vs.85</a><!-- m -->).aspx
Capturar mensajes
Hay más comands interesantes no incluidos en mi version de FWH (2007): WM_WINDOWPOSCHANGING 0x0046 WM_WINDOWPOSCHANGED 0x0047 WM_SIZING 0x0214 No se si en otras versiones los han tenido en cuanta.
Capturar mensajes
Supongo que estos mensajes se pueden capturar desde el método HANDLEEVENT de la clase TWindow, pero preguntaba si no hubiera otra forma de hacerlo sin tener que modificar esa clase.
Capturar mensajes
Antolin, La forma correcta sería heredar una nueva clase a partir de TWindow e implementar su Método HandleEvent() en donde se atienda a esos mensajes. Nosotros podriamos usar un codeblock y evaluarlo para cada mensaje de Windows, pero decidimos no hacerlo al entender que enlenteceria mucho la aplicación ya que constantemente se generan muchísimos mensajes de Windows.
Capturar mensajes
Gracias Antonio. Efectivamente modificando la TWindow no va, pero modificando la MDICHILD SI. Ya sé cuano he termindado de redimensionar la pantalla para refrescar los controles. Ahora voy a ver si averiguo que mensaje recibe cuando le doy al boton "Restaurar" de la Barra de Titulos. Gracias otr avez.
Capturar mensajes
OK averiguado es: WM_SIZE 0x0005 Si WParam = 0 la pantalla ha sido restaurada (ni maximizada ni minimizada). Si WParam = 1 la pantalla ha sido minimizada. Si WParam = 2 la pantalla ha sido maximizada. Si WParam = 3 (para pop_ups) cuando otra pantalla ha sido restaurada. Si WParam = 4 (para pop_ups) cuando otra pantalla ha sido maximizada. LParam trae las nuevas dimensiones del area de clientes. La parte LOW trae el Width y la parte HIGH el HEIGHT. A ver como las separo ahora...
Capturar mensajes
Puedes usar las funciones nLoWord( nLParam ) y nHiWord( nLParam ) de FWH
Capturar mensajes
Gracias Antonio. Lo he resuelto con nHeight := int(LParam/65536) y nWidth := LParam-(nHeight*65536) pero utilizaré las tuyas que son más racionales.
Capturar nTotal de columnas en TReport
Hola todos. Disculpen mi insistencia. Eso mismo. Sé que oReport:aColumns[n]:nTotal contiene la sumatoria de las columnas numericas. Lo que quiero hacer es poder identificar cuales columnas tienen su nTotal en 0, pero desde oReport:lCreated. ¿Se puede? Por ejemplo: Con oReport:bEnd se pueden identificar //ok Con oReport:bPostEnd se pueden identificar //ok Con if oReport:lCreated NO se pueden identificar // las muestra, todas, con nTotal en 0 El caso es que se necesita hacer ciertas operaciones, con las columnas que tienen su total en 0. (una de ellas borrarlas del reporte ), por supuesto se quiere hacer de manera automatica, una vez creado el reporte, sin necesidad de emplear multiples lineas de codigo antes de codificar el reporte propiamente dicho . No tengo problemas con DelColumn(nCol), ni :Stabilize(). El problema es que :bEnd (segun mis pruebas) no borra toda la columna, sino solo las columnas de la ultima linea, y ya se imaginan el resultado en el preview: desde la primera hasta la penultima linea, todas las columnas integras, y en la ultima linea recortadas las columnas eliminadas. [b:1u2pqbxx]En resumen, mi pregunta es. ¿Permite oReport:lCreated identificar los nTotal de cada columna del reporte?[/b:1u2pqbxx] Ej: if oReport:lCreated For n := 1 to len(oReport:aColumns) MsgInfo(oReport:aColumns[n]:nTotal Next endif Saludos.
Capturar nTotal de columnas en TReport
Francisco: Pues parece que no hay forma, lo he intentado con xHarbour sin buenos resultados Saludos
Capturar nTotal de columnas en TReport
Francisco, no he leido detenidamente tu problema, pero creo que quieres quitar alguna columna de un reporte si su total es 0, el reporte como sabes se crea linea a linea, entonces no podrás eliminar una columna de todo el reporte, deberas hacer un pre-procesamiento para evitar el crear las columnas con totales 0 saludos Marcelo
Capturar nTotal de columnas en TReport
Armando, Muchisimas gracias por tu tiempo e interes. Marcelo, [quote="Marcelo":29dwvqdo] deberas hacer un pre-procesamiento para evitar el crear las columnas con totales 0[/quote:29dwvqdo] Asi es como lo tengo, pero el caso es que quiero automatizar esto. Lo siguiente trabaja perfectamente: [code=fw:29dwvqdo]<div class="fw" id="{CB}" style="font-family: monospace;"> <br /><span style="color: #00C800;">if</span> oReport:<span style="color: #000000;">lCreated</span><br />        oReport:<span style="color: #000000;">DelColumn</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">10</span><span style="color: #000000;">&#41;</span> <span style="color: #B900B9;">//col 10  del reporte</span><br />        oReport:<span style="color: #000000;">DelColumn</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">13</span><span style="color: #000000;">&#41;</span> <span style="color: #B900B9;">//col 14  ""</span><br />        oReport:<span style="color: #000000;">DelColumn</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">17</span><span style="color: #000000;">&#41;</span> <span style="color: #B900B9;">//col 19  ""</span><br />        oReport:<span style="color: #000000;">DelColumn</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">17</span><span style="color: #000000;">&#41;</span> <span style="color: #B900B9;">//col 20  ""</span><br />        oReport:<span style="color: #000000;">DelColumn</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">17</span><span style="color: #000000;">&#41;</span> <span style="color: #B900B9;">//col 21  ""</span><br />        oReport:<span style="color: #000000;">DelColumn</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">17</span><span style="color: #000000;">&#41;</span> <span style="color: #B900B9;">//col 22  ""</span><br /><span style="color: #00C800;">endif</span><br /> </div>[/code:29dwvqdo] Por lo tanto se puede hacer desde el :lCreated, como quiero. Lo que pasa es que no he encontrado la forma de obtener los totales antes del :bEnd, para lo cual estoy trabajando con un copia de TReport. Los ::aColumns:nTotal se crean en el method PLAY(), y realmente no entiendo por qué no se mantienen al igual que los demas componentes del objeto: titulos de columnas, etc. Gracias a ambos, nuevamente.
Capturar numero telefonico con fivewin
Necesito capturar el numero telefonico al recibir una llamada para buscarlo en base de clientes, vi un post que hablaba muy detalladamente de como hacerlo, pero por algun motivo, no puedo encontrarlo con las búsquedas <!-- s:( --><img src="{SMILIES_PATH}/icon_sad.gif" alt=":(" title="Sad" /><!-- s:( --> . Cualquier ayuda al respecto o guía se valorará y agradecerá muuuuuuchísimo!!!!! <!-- s:D --><img src="{SMILIES_PATH}/icon_biggrin.gif" alt=":D" title="Very Happy" /><!-- s:D --> Gracias desde ya.
Capturar numero telefonico con fivewin
Hola Jose Revisa si esto te sirve. #define _DDE_CH #define _FOLDER_CH #define _VIDEO_CH #define _TREE_CH #define _ODBC_CH #include "FiveWin.ch" #include "Tsbrowse.ch" #include "Report.ch" #define FULL_SIZE 405 #define HALF_SIZE 260 #define IN_BUFFER 500 #define TERM_SIZE 300 extern Set,Setfocus, GetTextWidth // Blinker stuff static nComm, cTerminal, oTerminal,OWND,OBRW,oReport static cNumber static oSpeaker, oHangDown, oLocalNum, oNumber static aPredefined //----------------------------------------------------------------------------// function Main() local oDlg, ofig1 local cLocalNum := "123456789" local oHand local lOpened := .f. *----------------------------------------------------------------------------* cNumber = Space( 20 ) SET 3DLOOK ON LoadPredPhones() USE teleFono alias telefono NEW SHARED GO TOP DEFINE WINDOW oDLG TITLE "Central Telefonica." FROM 5,5 TO 450,320; COLOR CLR_BLACK,CLR_CEL oDLG:bCommNotify = { | nComm, nStatus | BytesAtPort( nComm, nStatus ) } @1,1 BROWSE OBRW ; ALIAS "TELEFONO"; COLOR CLR_BLACK,CLR_CEL; SIZE 975,600 ; ON DBLCLICK ASUMIR(@obrw); of oDlg ADD COLUMN TO BROWSE oBrw DATA TELEFONO->FECHA ; HEAD "Fecha" ; SIZE 80 PIXELS ADD COLUMN TO BROWSE oBrw DATA TELEFONO->HORA ; HEAD "Hora" PICTURE"99:99"; SIZE 60 PIXELS ADD COLUMN TO BROWSE oBrw DATA TELEFONO->EXTE ; HEAD "EXT" ; SIZE 50 PIXELS ADD COLUMN TO BROWSE oBrw DATA TELEFONO->CUARTO_ID ; HEAD "HAB" ; SIZE 50 PIXELS ADD COLUMN TO BROWSE oBrw DATA TELEFONO->TELE ; HEAD "TELEFONO" ; SIZE 120 PIXELS ADD COLUMN TO BROWSE oBrw DATA TELEFONO->DURACION ; HEAD "TIEMPO" PICTURE"99.99" ; SIZE 40 PIXELS ADD COLUMN TO BROWSE oBrw DATA TELEFONO->LUGAR ; HEAD "DESTINO" ; SIZE 130 PIXELS oBrw:nHeightCell += 5 oBrw:nHeightHead += 4 oBrw:nLineStyle := 4 ACTIVATE WINDOW oDlg ; ON INIT ( odlg:maximize(), ; If( ! lInitModem(), oDlg:End(),),; EnableCommNotification( nComm, oDlg:hWnd, IN_BUFFER, IN_BUFFER ) ); VALID ( CloseComm( nComm ), .t. ) return nil //----------------------------------------------------------------------------// function lInitModem() local cDcb, nError, nBytes nComm = OpenComm( "COM1", 1024, 128 ) if ! BuildCommDcb( "COM1:19200,n,8,1", @cDcb ) nError = GetCommError( nComm ) MsgStop( "Error initializing modem!" ) return .f. endif if ! SetCommState( cDcb ) nError = GetCommError( nComm ) MsgStop( "Error initializing modem!" ) return .f. endif if ( nBytes := WriteComm( nComm, "ATZ0" + Chr( 13 ) ) ) < 0 nError = GetCommError( nComm ) MsgStop( "Error initializing modem!" ) return .f. endif return .t. //----------------------------------------------------------------------------// function DialNumber( cNumber ) local nBytes := WriteComm( nComm, AllTrim( cNumber ) + Chr( 13 ) ) if nBytes < 0 MsgStop( "Modem error: " + Str( GetCommError( nComm ) ) ) endif return nil //----------------------------------------------------------------------------// function SendModem( cMsg ) local nBytes := WriteComm( nComm, cMsg ) if nBytes < 0 MsgStop( "Modem error: " + Str( GetCommError( nComm ) ) ) endif return nil //----------------------------------------------------------------------------// function HangUp( lOpen ) oSpeaker:Hide() oHangDown:Show() oLocalNum:Show() SendModem( "ATDT" + If( lOpen, Chr( 13 ), " " ) ) SysRefresh() return nil //----------------------------------------------------------------------------// function HangDown() SendModem( "ATH" + Chr( 13 ) ) oHangDown:Hide() oLocalNum:Hide() oSpeaker:Show() return nil //----------------------------------------------------------------------------// function LoadPredPhones() local oIni aPredefined = Array( 8 ) INI oIni FILENAME ".\phone.ini" GET aPredefined[ 1 ] SECTION "Predefined" ENTRY "1" OF oIni DEFAULT "" GET aPredefined[ 2 ] SECTION "Predefined" ENTRY "2" OF oIni DEFAULT "" GET aPredefined[ 3 ] SECTION "Predefined" ENTRY "3" OF oIni DEFAULT "" GET aPredefined[ 4 ] SECTION "Predefined" ENTRY "4" OF oIni DEFAULT "" GET aPredefined[ 5 ] SECTION "Predefined" ENTRY "5" OF oIni DEFAULT "" GET aPredefined[ 6 ] SECTION "Predefined" ENTRY "6" OF oIni DEFAULT "" GET aPredefined[ 7 ] SECTION "Predefined" ENTRY "7" OF oIni DEFAULT "" GET aPredefined[ 8 ] SECTION "Predefined" ENTRY "8" OF oIni DEFAULT "" ENDINI return nil //----------------------------------------------------------------------------// function Predefined( nOrder ) if ! Empty( aPredefined[ nOrder ] ) cNumber = PadR( aPredefined[ nOrder ], 20 ) oNumber:Refresh() HangUp( .f. ) DialNumber( aPredefined[ nOrder ] ) endif return nil //----------------------------------------------------------------------------// function BytesAtPort( nComm, nStatus ) LOCAL M:=SPACE(80) local cBuffer := Space( IN_BUFFER ) DEFAULT cTerminal := Space( TERM_SIZE ) ReadComm( nComm, @cBuffer ) *cTerminal = PadR( AllTrim( cTerminal ) + AllTrim( cBuffer ) + CRLF,TERM_SIZE ) cTerminal = AllTrim( cBuffer ) Saludos erick almanza
Capturar numero telefonico con fivewin
Hola, A lo mejor te serviria lo de este link: [url:2bz9219x]http&#58;//groups&#46;google&#46;com/group/comp&#46;lang&#46;xharbour/browse_thread/thread/7afa76ca216f5885/eb13aa6f45af32c6?show_docid=eb13aa6f45af32c6&pli=1[/url:2bz9219x] Pere
Capturar numero telefonico con fivewin
Muchas Gracias por sus respuestas!!!!!! Estaré chequeando y les consulto en un rato. Gracias!!!! <!-- s:D --><img src="{SMILIES_PATH}/icon_biggrin.gif" alt=":D" title="Very Happy" /><!-- s:D -->
Capturar numero telefonico con fivewin
Reviviendo Muertos: [b:twmfomgg]jose_murugosa:[/b:twmfomgg] Pudo resolver el problema del Identificador de llamadas..? Alguien tiene un ejemplo operativo..? He provado el ejemplo phone.prg pero me dice "Error de Inicialización del Modem", Trabajo con un modem 56k HSP56 de PCtel... Gracias y saludos..
Capturar numero telefonico con fivewin
Pues eso, ¿alguien lo ha conseguido? este es un tema recurrente en el foro que aparece de vez en cuando. Yo lo he intentado en varias ocasiones, desafortunadamente con resultados negativos. ¿Sería aplicable a un router ADSL, que supongo es lo que usamos la mayoría?
Capturar numero telefonico con fivewin
En mi caso funciona correctamente, bajo ciertas condiciones minimas... 1ro, El MoDem debe tener capacidad para manejar el ID 2do, El proveedor de telefonia debe activar el servicio de Identificador de llamadas El MoDem que uso es el que se describe en este link [url:3ty2p4ah]http&#58;//www&#46;ascendtech&#46;us/itemdesc&#46;asp?ic=MDHPPN503095001&eq=&Tp=[/url:3ty2p4ah] El codigo es este: [code=fw:3ty2p4ah]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #B900B9;">// FiveWin Phone - (c) FiveTech 1993-5</span><br /><span style="color: #B900B9;">// A.Linares</span><br /><br /><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">"FiveWin.ch"</span><br /><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">"Folder.ch"</span><br /><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">"Phone.ch"</span><br /><br /><span style="color: #00D7D7;">#define</span> FULL_SIZE &nbsp;<span style="color: #000000;">405</span><br /><span style="color: #00D7D7;">#define</span> HALF_SIZE &nbsp;<span style="color: #000000;">260</span><br /><br /><span style="color: #00D7D7;">#define</span> IN_BUFFER &nbsp;<span style="color: #000000;">254</span> <span style="color: #B900B9;">//20</span><br /><span style="color: #00D7D7;">#define</span> TERM_SIZE &nbsp;<span style="color: #000000;">300</span><br /><br /><span style="color: #B900B9;">//extern Set, GetTextWidth // Blinker stuff</span><br /><br /><span style="color: #00C800;">static</span> nComm, cTerminal, oTerminal, cComm<br /><span style="color: #00C800;">static</span> cNumber<br /><span style="color: #00C800;">static</span> oSpeaker, oHangDown, oLocalNum, oNumber<br /><br /><span style="color: #00C800;">static</span> aPredefined, cCadena<br /><br /><span style="color: #B900B9;">//----------------------------------------------------------------------------//</span><br /><br /><span style="color: #00C800;">function</span> Main<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> oDlg, oBrw<br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> cLocalNum := <span style="color: #ff0000;">"123456789"</span><br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> oHand<br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> lOpened := .t.<br />&nbsp; &nbsp;cCadena := <span style="color: #ff0000;">""</span><br /><br /><span style="color: #00C800;">IF</span> ISEXERUNNING<span style="color: #000000;">&#40;</span> CFILENAME<span style="color: #000000;">&#40;</span> HB_ARGV<span style="color: #000000;">&#40;</span> <span style="color: #000000;">0</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #B900B9;">// evita el doble arranque</span><br />&nbsp; MsgWait<span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"Phone está en Ejecución"</span>,<span style="color: #ff0000;">"---"</span>,<span style="color: #000000;">2</span><span style="color: #000000;">&#41;</span><br />&nbsp; <span style="color: #00C800;">Return</span><span style="color: #000000;">&#40;</span><span style="color: #00C800;">Nil</span><span style="color: #000000;">&#41;</span><br /><span style="color: #00C800;">ENDIF</span><br /><br />cComm := <span style="color: #ff0000;">"COM3"</span><br /><br />&nbsp; &nbsp;cNumber = Space<span style="color: #000000;">&#40;</span> <span style="color: #000000;">20</span> <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;SET _3DLOOK <span style="color: #0000ff;">ON</span><br /><br />&nbsp; &nbsp;<span style="color: #B900B9;">//MsgLogo( "FwPhone", 2 )</span><br /><br />&nbsp; &nbsp;LoadPredPhones<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">if</span> ! File<span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"phone.dbf"</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; DbCreate<span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"Phone"</span>, <span style="color: #000000;">&#123;</span> <span style="color: #000000;">&#123;</span> <span style="color: #ff0000;">"LAST"</span>, &nbsp; <span style="color: #ff0000;">"C"</span>, <span style="color: #000000;">30</span>, <span style="color: #000000;">0</span> <span style="color: #000000;">&#125;</span>,;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #000000;">&#123;</span> <span style="color: #ff0000;">"FIRST"</span>, &nbsp;<span style="color: #ff0000;">"C"</span>, <span style="color: #000000;">30</span>, <span style="color: #000000;">0</span> <span style="color: #000000;">&#125;</span>,;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #000000;">&#123;</span> <span style="color: #ff0000;">"NUMBER"</span>, <span style="color: #ff0000;">"C"</span>, <span style="color: #000000;">20</span>, <span style="color: #000000;">0</span> <span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;<span style="color: #00C800;">endif</span><br /><br />&nbsp; &nbsp;USE Phone<br /><br />&nbsp; &nbsp;<span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">CURSOR</span> oHand <span style="color: #0000ff;">RESOURCE</span> <span style="color: #ff0000;">"Catch"</span><br /><br />&nbsp; &nbsp;<span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">DIALOG</span> oDlg <span style="color: #0000ff;">RESOURCE</span> <span style="color: #ff0000;">"Phone"</span><br /><br />&nbsp; &nbsp;oDlg:<span style="color: #000000;">bCommNotify</span> = <span style="color: #000000;">&#123;</span> | nComm, nStatus | BytesAtPort<span style="color: #000000;">&#40;</span> nComm, nStatus <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span><br /><br />&nbsp; &nbsp;<span style="color: #0000ff;">REDEFINE</span> BITMAP oSpeaker <span style="color: #0000ff;">ID</span> ID_SPEAKER <span style="color: #0000ff;">OF</span> oDlg <span style="color: #0000ff;">RESOURCE</span> <span style="color: #ff0000;">"Speaker"</span> ;<br />&nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">ON</span> <span style="color: #0000ff;">CLICK</span> HangUp<span style="color: #000000;">&#40;</span> .t. <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;oSpeaker:<span style="color: #000000;">oCursor</span> = oHand<br /><br />&nbsp; &nbsp;<span style="color: #0000ff;">REDEFINE</span> <span style="color: #0000ff;">BUTTON</span> oHangDown <span style="color: #0000ff;">ID</span> ID_HANGDOWN <span style="color: #0000ff;">OF</span> oDlg <span style="color: #0000ff;">ACTION</span> HangDown<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;<span style="color: #0000ff;">REDEFINE</span> <span style="color: #0000ff;">GET</span> oLocalNum <span style="color: #0000ff;">VAR</span> cLocalNum <span style="color: #0000ff;">ID</span> ID_LOCALNUM <span style="color: #0000ff;">OF</span> oDlg<br /><br />&nbsp; &nbsp;<span style="color: #0000ff;">REDEFINE</span> <span style="color: #0000ff;">GET</span> oNumber <span style="color: #0000ff;">VAR</span> cNumber <span style="color: #0000ff;">ID</span> ID_NUMBER <span style="color: #0000ff;">OF</span> oDlg<br /><br />&nbsp; &nbsp;<span style="color: #0000ff;">REDEFINE</span> <span style="color: #0000ff;">GET</span> oTerminal <span style="color: #0000ff;">VAR</span> cTerminal MEMO <span style="color: #0000ff;">ID</span> ID_TERMINAL <span style="color: #0000ff;">OF</span> oDlg<br /><br />&nbsp; &nbsp;<span style="color: #0000ff;">REDEFINE</span> <span style="color: #0000ff;">BUTTON</span> <span style="color: #0000ff;">ID</span> ID_ONE <span style="color: #0000ff;">OF</span> oDlg ;<br />&nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">ACTION</span> <span style="color: #000000;">&#40;</span> cNumber := PadR<span style="color: #000000;">&#40;</span> AllTrim<span style="color: #000000;">&#40;</span> cNumber <span style="color: #000000;">&#41;</span> + <span style="color: #ff0000;">"1"</span>, <span style="color: #000000;">20</span> <span style="color: #000000;">&#41;</span>,;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;oNumber:<span style="color: #0000ff;">Refresh</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;<span style="color: #0000ff;">REDEFINE</span> <span style="color: #0000ff;">BUTTON</span> <span style="color: #0000ff;">ID</span> ID_TWO <span style="color: #0000ff;">OF</span> oDlg ;<br />&nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">ACTION</span> <span style="color: #000000;">&#40;</span> cNumber := PadR<span style="color: #000000;">&#40;</span> AllTrim<span style="color: #000000;">&#40;</span> cNumber <span style="color: #000000;">&#41;</span> + <span style="color: #ff0000;">"2"</span>, <span style="color: #000000;">20</span> <span style="color: #000000;">&#41;</span>,;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;oNumber:<span style="color: #0000ff;">Refresh</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;<span style="color: #0000ff;">REDEFINE</span> <span style="color: #0000ff;">BUTTON</span> <span style="color: #0000ff;">ID</span> ID_THREE <span style="color: #0000ff;">OF</span> oDlg ;<br />&nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">ACTION</span> <span style="color: #000000;">&#40;</span> cNumber := PadR<span style="color: #000000;">&#40;</span> AllTrim<span style="color: #000000;">&#40;</span> cNumber <span style="color: #000000;">&#41;</span> + <span style="color: #ff0000;">"3"</span>, <span style="color: #000000;">20</span> <span style="color: #000000;">&#41;</span>,;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;oNumber:<span style="color: #0000ff;">Refresh</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;<span style="color: #0000ff;">REDEFINE</span> <span style="color: #0000ff;">BUTTON</span> <span style="color: #0000ff;">ID</span> ID_FOUR <span style="color: #0000ff;">OF</span> oDlg ;<br />&nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">ACTION</span> <span style="color: #000000;">&#40;</span> cNumber := PadR<span style="color: #000000;">&#40;</span> AllTrim<span style="color: #000000;">&#40;</span> cNumber <span style="color: #000000;">&#41;</span> + <span style="color: #ff0000;">"4"</span>, <span style="color: #000000;">20</span> <span style="color: #000000;">&#41;</span>,;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;oNumber:<span style="color: #0000ff;">Refresh</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;<span style="color: #0000ff;">REDEFINE</span> <span style="color: #0000ff;">BUTTON</span> <span style="color: #0000ff;">ID</span> ID_FIVE <span style="color: #0000ff;">OF</span> oDlg ;<br />&nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">ACTION</span> <span style="color: #000000;">&#40;</span> cNumber := PadR<span style="color: #000000;">&#40;</span> AllTrim<span style="color: #000000;">&#40;</span> cNumber <span style="color: #000000;">&#41;</span> + <span style="color: #ff0000;">"5"</span>, <span style="color: #000000;">20</span> <span style="color: #000000;">&#41;</span>,;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;oNumber:<span style="color: #0000ff;">Refresh</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;<span style="color: #0000ff;">REDEFINE</span> <span style="color: #0000ff;">BUTTON</span> <span style="color: #0000ff;">ID</span> ID_SIX <span style="color: #0000ff;">OF</span> oDlg ;<br />&nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">ACTION</span> <span style="color: #000000;">&#40;</span> cNumber := PadR<span style="color: #000000;">&#40;</span> AllTrim<span style="color: #000000;">&#40;</span> cNumber <span style="color: #000000;">&#41;</span> + <span style="color: #ff0000;">"6"</span>, <span style="color: #000000;">20</span> <span style="color: #000000;">&#41;</span>,;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;oNumber:<span style="color: #0000ff;">Refresh</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;<span style="color: #0000ff;">REDEFINE</span> <span style="color: #0000ff;">BUTTON</span> <span style="color: #0000ff;">ID</span> ID_SEVEN <span style="color: #0000ff;">OF</span> oDlg ;<br />&nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">ACTION</span> <span style="color: #000000;">&#40;</span> cNumber := PadR<span style="color: #000000;">&#40;</span> AllTrim<span style="color: #000000;">&#40;</span> cNumber <span style="color: #000000;">&#41;</span> + <span style="color: #ff0000;">"7"</span>, <span style="color: #000000;">20</span> <span style="color: #000000;">&#41;</span>,;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;oNumber:<span style="color: #0000ff;">Refresh</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;<span style="color: #0000ff;">REDEFINE</span> <span style="color: #0000ff;">BUTTON</span> <span style="color: #0000ff;">ID</span> ID_EIGHT <span style="color: #0000ff;">OF</span> oDlg ;<br />&nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">ACTION</span> <span style="color: #000000;">&#40;</span> cNumber := PadR<span style="color: #000000;">&#40;</span> AllTrim<span style="color: #000000;">&#40;</span> cNumber <span style="color: #000000;">&#41;</span> + <span style="color: #ff0000;">"8"</span>, <span style="color: #000000;">20</span> <span style="color: #000000;">&#41;</span>,;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;oNumber:<span style="color: #0000ff;">Refresh</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;<span style="color: #0000ff;">REDEFINE</span> <span style="color: #0000ff;">BUTTON</span> <span style="color: #0000ff;">ID</span> ID_NINE <span style="color: #0000ff;">OF</span> oDlg ;<br />&nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">ACTION</span> <span style="color: #000000;">&#40;</span> cNumber := PadR<span style="color: #000000;">&#40;</span> AllTrim<span style="color: #000000;">&#40;</span> cNumber <span style="color: #000000;">&#41;</span> + <span style="color: #ff0000;">"9"</span>, <span style="color: #000000;">20</span> <span style="color: #000000;">&#41;</span>,;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;oNumber:<span style="color: #0000ff;">Refresh</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;<span style="color: #0000ff;">REDEFINE</span> <span style="color: #0000ff;">BUTTON</span> <span style="color: #0000ff;">ID</span> ID_ZERO <span style="color: #0000ff;">OF</span> oDlg ;<br />&nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">ACTION</span> <span style="color: #000000;">&#40;</span> cNumber := PadR<span style="color: #000000;">&#40;</span> AllTrim<span style="color: #000000;">&#40;</span> cNumber <span style="color: #000000;">&#41;</span> + <span style="color: #ff0000;">"0"</span>, <span style="color: #000000;">20</span> <span style="color: #000000;">&#41;</span>,;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;oNumber:<span style="color: #0000ff;">Refresh</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;<span style="color: #0000ff;">REDEFINE</span> <span style="color: #0000ff;">BUTTON</span> <span style="color: #0000ff;">ID</span> ID_MORE <span style="color: #0000ff;">OF</span> oDlg ;<br />&nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">ACTION</span> <span style="color: #000000;">&#40;</span> <span style="color: #00C800;">If</span><span style="color: #000000;">&#40;</span> ! lOpened,;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #000000;">&#40;</span> lOpened := .t., oDlg:<span style="color: #000000;">SetSize</span><span style="color: #000000;">&#40;</span> <span style="color: #000000;">0</span>, FULL_SIZE <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span>,;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #000000;">&#40;</span> lOpened := .f., oDlg:<span style="color: #000000;">SetSize</span><span style="color: #000000;">&#40;</span> <span style="color: #000000;">0</span>, HALF_SIZE <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span>, oDlg:<span style="color: #0000ff;">Refresh</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;<span style="color: #0000ff;">REDEFINE</span> <span style="color: #0000ff;">BUTTON</span> <span style="color: #0000ff;">ID</span> ID_PLAY <span style="color: #0000ff;">OF</span> oDlg ;<br />&nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">ACTION</span> <span style="color: #00C800;">If</span><span style="color: #000000;">&#40;</span> ! Empty<span style="color: #000000;">&#40;</span> cNumber <span style="color: #000000;">&#41;</span>, <span style="color: #000000;">&#40;</span> HangUp<span style="color: #000000;">&#40;</span> .f. <span style="color: #000000;">&#41;</span>, DialNumber<span style="color: #000000;">&#40;</span> cNumber <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span>,<span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;<span style="color: #0000ff;">REDEFINE</span> <span style="color: #0000ff;">BUTTON</span> <span style="color: #0000ff;">ID</span> ID_CLOSE <span style="color: #0000ff;">OF</span> oDlg <span style="color: #0000ff;">ACTION</span> oDlg:<span style="color: #000000;">End</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;<span style="color: #0000ff;">REDEFINE</span> <span style="color: #0000ff;">BUTTON</span> <span style="color: #0000ff;">ID</span> ID_BLANK <span style="color: #0000ff;">OF</span> oDlg ;<br />&nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">ACTION</span> <span style="color: #000000;">&#40;</span> cNumber := Space<span style="color: #000000;">&#40;</span> <span style="color: #000000;">20</span> <span style="color: #000000;">&#41;</span>, oNumber:<span style="color: #0000ff;">Refresh</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>,;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;cTerminal := Space<span style="color: #000000;">&#40;</span> <span style="color: #000000;">50</span> <span style="color: #000000;">&#41;</span>, oTerminal:<span style="color: #0000ff;">Refresh</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;<span style="color: #0000ff;">REDEFINE</span> <span style="color: #0000ff;">BUTTON</span> <span style="color: #0000ff;">PROMPT</span> aPredefined<span style="color: #000000;">&#91;</span> <span style="color: #000000;">1</span> <span style="color: #000000;">&#93;</span> <span style="color: #0000ff;">ID</span> ID_PRED1 <span style="color: #0000ff;">OF</span> oDlg ;<br />&nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">ACTION</span> Predefined<span style="color: #000000;">&#40;</span> <span style="color: #000000;">1</span> <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;<span style="color: #0000ff;">REDEFINE</span> <span style="color: #0000ff;">BUTTON</span> <span style="color: #0000ff;">PROMPT</span> aPredefined<span style="color: #000000;">&#91;</span> <span style="color: #000000;">2</span> <span style="color: #000000;">&#93;</span> <span style="color: #0000ff;">ID</span> ID_PRED2 <span style="color: #0000ff;">OF</span> oDlg ;<br />&nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">ACTION</span> Predefined<span style="color: #000000;">&#40;</span> <span style="color: #000000;">2</span> <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;<span style="color: #0000ff;">REDEFINE</span> <span style="color: #0000ff;">BUTTON</span> <span style="color: #0000ff;">PROMPT</span> aPredefined<span style="color: #000000;">&#91;</span> <span style="color: #000000;">3</span> <span style="color: #000000;">&#93;</span> <span style="color: #0000ff;">ID</span> ID_PRED3 <span style="color: #0000ff;">OF</span> oDlg ;<br />&nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">ACTION</span> Predefined<span style="color: #000000;">&#40;</span> <span style="color: #000000;">3</span> <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;<span style="color: #0000ff;">REDEFINE</span> <span style="color: #0000ff;">BUTTON</span> <span style="color: #0000ff;">PROMPT</span> aPredefined<span style="color: #000000;">&#91;</span> <span style="color: #000000;">4</span> <span style="color: #000000;">&#93;</span> <span style="color: #0000ff;">ID</span> ID_PRED4 <span style="color: #0000ff;">OF</span> oDlg ;<br />&nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">ACTION</span> Predefined<span style="color: #000000;">&#40;</span> <span style="color: #000000;">4</span> <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;<span style="color: #0000ff;">REDEFINE</span> <span style="color: #0000ff;">BUTTON</span> <span style="color: #0000ff;">PROMPT</span> aPredefined<span style="color: #000000;">&#91;</span> <span style="color: #000000;">5</span> <span style="color: #000000;">&#93;</span> <span style="color: #0000ff;">ID</span> ID_PRED5 <span style="color: #0000ff;">OF</span> oDlg ;<br />&nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">ACTION</span> Predefined<span style="color: #000000;">&#40;</span> <span style="color: #000000;">5</span> <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;<span style="color: #0000ff;">REDEFINE</span> <span style="color: #0000ff;">BUTTON</span> <span style="color: #0000ff;">PROMPT</span> aPredefined<span style="color: #000000;">&#91;</span> <span style="color: #000000;">6</span> <span style="color: #000000;">&#93;</span> <span style="color: #0000ff;">ID</span> ID_PRED6 <span style="color: #0000ff;">OF</span> oDlg ;<br />&nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">ACTION</span> Predefined<span style="color: #000000;">&#40;</span> <span style="color: #000000;">6</span> <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;<span style="color: #0000ff;">REDEFINE</span> <span style="color: #0000ff;">BUTTON</span> <span style="color: #0000ff;">PROMPT</span> aPredefined<span style="color: #000000;">&#91;</span> <span style="color: #000000;">7</span> <span style="color: #000000;">&#93;</span> <span style="color: #0000ff;">ID</span> ID_PRED7 <span style="color: #0000ff;">OF</span> oDlg ;<br />&nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">ACTION</span> Predefined<span style="color: #000000;">&#40;</span> <span style="color: #000000;">7</span> <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;<span style="color: #0000ff;">REDEFINE</span> <span style="color: #0000ff;">BUTTON</span> <span style="color: #0000ff;">PROMPT</span> aPredefined<span style="color: #000000;">&#91;</span> <span style="color: #000000;">8</span> <span style="color: #000000;">&#93;</span> <span style="color: #0000ff;">ID</span> ID_PRED8 <span style="color: #0000ff;">OF</span> oDlg ;<br />&nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">ACTION</span> Predefined<span style="color: #000000;">&#40;</span> <span style="color: #000000;">8</span> <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;<span style="color: #0000ff;">REDEFINE</span> <span style="color: #0000ff;">LISTBOX</span> oBrw ;<br />&nbsp; &nbsp; &nbsp; FIELDS AllTrim<span style="color: #000000;">&#40;</span> Phone->Last <span style="color: #000000;">&#41;</span> + <span style="color: #ff0000;">", "</span> + AllTrim<span style="color: #000000;">&#40;</span> Phone->First <span style="color: #000000;">&#41;</span>,;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Phone->Number ;<br />&nbsp; &nbsp; &nbsp; HEADERS <span style="color: #ff0000;">"Name"</span>, <span style="color: #ff0000;">"Number"</span> ;<br />&nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">ID</span> ID_DATABASE <span style="color: #0000ff;">OF</span> oDlg ;<br />&nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">ON</span> DBLCLICK <span style="color: #000000;">&#40;</span> cNumber := Phone->Number, oNumber:<span style="color: #0000ff;">Refresh</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>,;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; HangUp<span style="color: #000000;">&#40;</span> .f. <span style="color: #000000;">&#41;</span>, DialNumber<span style="color: #000000;">&#40;</span> cNumber <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;<span style="color: #0000ff;">REDEFINE</span> TABS <span style="color: #0000ff;">ID</span> ID_SECTIONS <span style="color: #0000ff;">OF</span> oDlg ;<br />&nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">PROMPTS</span> <span style="color: #ff0000;">"&Personal"</span>, <span style="color: #ff0000;">"&Bussiness"</span>, <span style="color: #ff0000;">"&Home"</span> ;<br />&nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">ACTION</span> MsgBeep<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;<span style="color: #0000ff;">REDEFINE</span> <span style="color: #0000ff;">BUTTON</span> <span style="color: #0000ff;">ID</span> ID_ADD <span style="color: #0000ff;">OF</span> oDlg ;<br />&nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">ACTION</span> <span style="color: #000000;">&#40;</span> Phone-><span style="color: #000000;">&#40;</span> DbAppend<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span>, oBrw:<span style="color: #000000;">GoTop</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;<span style="color: #0000ff;">ACTIVATE</span> <span style="color: #0000ff;">DIALOG</span> oDlg ;<br />&nbsp; &nbsp; &nbsp;<span style="color: #0000ff;">ON</span> <span style="color: #0000ff;">INIT</span> <span style="color: #000000;">&#40;</span> oDlg:<span style="color: #000000;">SetSize</span><span style="color: #000000;">&#40;</span> <span style="color: #000000;">0</span>, FULL_SIZE <span style="color: #000000;">&#41;</span>,; &nbsp;<span style="color: #B900B9;">//HALF_SIZE ),;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;oHangDown:<span style="color: #000000;">Hide</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>, oLocalNum:<span style="color: #000000;">Hide</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>,;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">If</span><span style="color: #000000;">&#40;</span> ! lInitModem<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>, oDlg:<span style="color: #000000;">End</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>,<span style="color: #000000;">&#41;</span>,;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;EnableCommNotification<span style="color: #000000;">&#40;</span> nComm, oDlg:<span style="color: #000000;">hWnd</span>, IN_BUFFER, IN_BUFFER <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span>;<br />&nbsp; &nbsp; &nbsp;<span style="color: #0000ff;">VALID</span> <span style="color: #000000;">&#40;</span> CloseComm<span style="color: #000000;">&#40;</span> nComm <span style="color: #000000;">&#41;</span>, .t. <span style="color: #000000;">&#41;</span><br /><br /><span style="color: #B900B9;">//escribetxt(cCadena)</span><br /><br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br /><br /><span style="color: #B900B9;">//----------------------------------------------------------------------------//</span><br /><br /><span style="color: #00C800;">function</span> lInitModem<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> cDcb, nError, nBytes<br /><br />&nbsp; &nbsp;nComm = OpenComm<span style="color: #000000;">&#40;</span> cComm, <span style="color: #000000;">1024</span>, <span style="color: #000000;">128</span> <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">if</span> ! BuildCommDcb<span style="color: #000000;">&#40;</span> cComm + <span style="color: #ff0000;">":2400,n,8,1"</span>, @cDcb <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; nError = GetCommError<span style="color: #000000;">&#40;</span> nComm <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; MsgStop<span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"Error initializing modem!"</span>, <span style="color: #ff0000;">"1"</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">return</span> .f.<br />&nbsp; &nbsp;<span style="color: #00C800;">endif</span><br /><br />&nbsp; &nbsp;#ifdef __CLIPPER__<br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">if</span> ! SetCommState<span style="color: #000000;">&#40;</span> cDcb <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;#else<br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">if</span> ! SetCommState<span style="color: #000000;">&#40;</span> nComm, cDcb <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;#endif<br />&nbsp; &nbsp; &nbsp; nError = GetCommError<span style="color: #000000;">&#40;</span> nComm <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; MsgStop<span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"Error initializing modem!"</span>,<span style="color: #ff0000;">"2"</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">return</span> .f.<br />&nbsp; &nbsp;<span style="color: #00C800;">endif</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">if</span> <span style="color: #000000;">&#40;</span> nBytes := WriteComm<span style="color: #000000;">&#40;</span> nComm, <span style="color: #ff0000;">"ATZ0"</span> + Chr<span style="color: #000000;">&#40;</span> <span style="color: #000000;">13</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> < <span style="color: #000000;">0</span><br />&nbsp; &nbsp; &nbsp; nError = GetCommError<span style="color: #000000;">&#40;</span> nComm <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; MsgStop<span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"Error initializing modem!"</span>,<span style="color: #ff0000;">"3"</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">return</span> .f.<br />&nbsp; &nbsp;<span style="color: #00C800;">endif</span><br /><br />&nbsp; &nbsp;WriteComm<span style="color: #000000;">&#40;</span>nComm, <span style="color: #ff0000;">"AT S0=0 X4"</span> + Chr<span style="color: #000000;">&#40;</span> <span style="color: #000000;">13</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> &nbsp; &nbsp;<span style="color: #B900B9;">// S0=n &nbsp;n=numero de RINGs para contestar automaticamente</span><br />&nbsp; &nbsp;WriteComm<span style="color: #000000;">&#40;</span>nComm, <span style="color: #ff0000;">"AT #CID=2"</span> &nbsp;+ Chr<span style="color: #000000;">&#40;</span> <span style="color: #000000;">13</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> &nbsp; &nbsp;<span style="color: #B900B9;">// "AT #CID=1" Activar identificacion de llamada</span><br /><br /><span style="color: #00C800;">return</span> .t.<br /><br /><span style="color: #B900B9;">//----------------------------------------------------------------------------//</span><br /><br /><span style="color: #00C800;">function</span> DialNumber<span style="color: #000000;">&#40;</span> cNumber <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> nBytes := WriteComm<span style="color: #000000;">&#40;</span> nComm, AllTrim<span style="color: #000000;">&#40;</span> cNumber <span style="color: #000000;">&#41;</span> + Chr<span style="color: #000000;">&#40;</span> <span style="color: #000000;">13</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">if</span> nBytes < <span style="color: #000000;">0</span><br />&nbsp; &nbsp; &nbsp; MsgStop<span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"Modem error: "</span> + Str<span style="color: #000000;">&#40;</span> GetCommError<span style="color: #000000;">&#40;</span> nComm <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;<span style="color: #00C800;">endif</span><br /><br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br /><br /><span style="color: #B900B9;">//----------------------------------------------------------------------------//</span><br /><br /><span style="color: #00C800;">function</span> SendModem<span style="color: #000000;">&#40;</span> cMsg <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> nBytes := WriteComm<span style="color: #000000;">&#40;</span> nComm, cMsg <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">if</span> nBytes < <span style="color: #000000;">0</span><br />&nbsp; &nbsp; &nbsp; MsgStop<span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"Modem error: "</span> + Str<span style="color: #000000;">&#40;</span> GetCommError<span style="color: #000000;">&#40;</span> nComm <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;<span style="color: #00C800;">endif</span><br /><br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br /><br /><span style="color: #B900B9;">//----------------------------------------------------------------------------//</span><br /><br /><span style="color: #00C800;">function</span> HangUp<span style="color: #000000;">&#40;</span> lOpen <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;oSpeaker:<span style="color: #000000;">Hide</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;oHangDown:<span style="color: #000000;">Show</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;oLocalNum:<span style="color: #000000;">Show</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;SendModem<span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"ATDT"</span> + <span style="color: #00C800;">If</span><span style="color: #000000;">&#40;</span> lOpen, Chr<span style="color: #000000;">&#40;</span> <span style="color: #000000;">13</span> <span style="color: #000000;">&#41;</span>, <span style="color: #ff0000;">" "</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;SysRefresh<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br /><br /><span style="color: #B900B9;">//----------------------------------------------------------------------------//</span><br /><br /><span style="color: #00C800;">function</span> HangDown<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;SendModem<span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"ATH"</span> + Chr<span style="color: #000000;">&#40;</span> <span style="color: #000000;">13</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;oHangDown:<span style="color: #000000;">Hide</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;oLocalNum:<span style="color: #000000;">Hide</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;oSpeaker:<span style="color: #000000;">Show</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br /><br /><span style="color: #B900B9;">//----------------------------------------------------------------------------//</span><br /><br /><span style="color: #00C800;">function</span> LoadPredPhones<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> oIni<br /><br />&nbsp; &nbsp;aPredefined = Array<span style="color: #000000;">&#40;</span> <span style="color: #000000;">8</span> <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;INI oIni FILENAME <span style="color: #ff0000;">".<span style="color: #000000;">\p</span>hone.ini"</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">GET</span> aPredefined<span style="color: #000000;">&#91;</span> <span style="color: #000000;">1</span> <span style="color: #000000;">&#93;</span> SECTION <span style="color: #ff0000;">"Predefined"</span> ENTRY <span style="color: #ff0000;">"1"</span> <span style="color: #0000ff;">OF</span> oIni <span style="color: #00C800;">DEFAULT</span> <span style="color: #ff0000;">""</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">GET</span> aPredefined<span style="color: #000000;">&#91;</span> <span style="color: #000000;">2</span> <span style="color: #000000;">&#93;</span> SECTION <span style="color: #ff0000;">"Predefined"</span> ENTRY <span style="color: #ff0000;">"2"</span> <span style="color: #0000ff;">OF</span> oIni <span style="color: #00C800;">DEFAULT</span> <span style="color: #ff0000;">""</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">GET</span> aPredefined<span style="color: #000000;">&#91;</span> <span style="color: #000000;">3</span> <span style="color: #000000;">&#93;</span> SECTION <span style="color: #ff0000;">"Predefined"</span> ENTRY <span style="color: #ff0000;">"3"</span> <span style="color: #0000ff;">OF</span> oIni <span style="color: #00C800;">DEFAULT</span> <span style="color: #ff0000;">""</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">GET</span> aPredefined<span style="color: #000000;">&#91;</span> <span style="color: #000000;">4</span> <span style="color: #000000;">&#93;</span> SECTION <span style="color: #ff0000;">"Predefined"</span> ENTRY <span style="color: #ff0000;">"4"</span> <span style="color: #0000ff;">OF</span> oIni <span style="color: #00C800;">DEFAULT</span> <span style="color: #ff0000;">""</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">GET</span> aPredefined<span style="color: #000000;">&#91;</span> <span style="color: #000000;">5</span> <span style="color: #000000;">&#93;</span> SECTION <span style="color: #ff0000;">"Predefined"</span> ENTRY <span style="color: #ff0000;">"5"</span> <span style="color: #0000ff;">OF</span> oIni <span style="color: #00C800;">DEFAULT</span> <span style="color: #ff0000;">""</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">GET</span> aPredefined<span style="color: #000000;">&#91;</span> <span style="color: #000000;">6</span> <span style="color: #000000;">&#93;</span> SECTION <span style="color: #ff0000;">"Predefined"</span> ENTRY <span style="color: #ff0000;">"6"</span> <span style="color: #0000ff;">OF</span> oIni <span style="color: #00C800;">DEFAULT</span> <span style="color: #ff0000;">""</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">GET</span> aPredefined<span style="color: #000000;">&#91;</span> <span style="color: #000000;">7</span> <span style="color: #000000;">&#93;</span> SECTION <span style="color: #ff0000;">"Predefined"</span> ENTRY <span style="color: #ff0000;">"7"</span> <span style="color: #0000ff;">OF</span> oIni <span style="color: #00C800;">DEFAULT</span> <span style="color: #ff0000;">""</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">GET</span> aPredefined<span style="color: #000000;">&#91;</span> <span style="color: #000000;">8</span> <span style="color: #000000;">&#93;</span> SECTION <span style="color: #ff0000;">"Predefined"</span> ENTRY <span style="color: #ff0000;">"8"</span> <span style="color: #0000ff;">OF</span> oIni <span style="color: #00C800;">DEFAULT</span> <span style="color: #ff0000;">""</span><br />&nbsp; &nbsp;ENDINI<br /><br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br /><br /><span style="color: #B900B9;">//----------------------------------------------------------------------------//</span><br /><br /><span style="color: #00C800;">function</span> Predefined<span style="color: #000000;">&#40;</span> nOrder <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">if</span> ! Empty<span style="color: #000000;">&#40;</span> aPredefined<span style="color: #000000;">&#91;</span> nOrder <span style="color: #000000;">&#93;</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; cNumber = PadR<span style="color: #000000;">&#40;</span> aPredefined<span style="color: #000000;">&#91;</span> nOrder <span style="color: #000000;">&#93;</span>, <span style="color: #000000;">20</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; oNumber:<span style="color: #0000ff;">Refresh</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; HangUp<span style="color: #000000;">&#40;</span> .f. <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; DialNumber<span style="color: #000000;">&#40;</span> aPredefined<span style="color: #000000;">&#91;</span> nOrder <span style="color: #000000;">&#93;</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;<span style="color: #00C800;">endif</span><br /><br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br /><br /><span style="color: #B900B9;">//-------------------------------------------------------------------------------------------</span><br /><span style="color: #00C800;">function</span> BytesAtPort<span style="color: #000000;">&#40;</span> nComm, nStatus <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> cBuffer := Space<span style="color: #000000;">&#40;</span> IN_BUFFER <span style="color: #000000;">&#41;</span>, cBusy, cFech, cHora, cNmro, cTmp<br /><br />&nbsp; &nbsp;<span style="color: #00C800;">DEFAULT</span> cTerminal := Space<span style="color: #000000;">&#40;</span> TERM_SIZE <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;ReadComm<span style="color: #000000;">&#40;</span> nComm, @cBuffer <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;cBusy := ALLTRIM<span style="color: #000000;">&#40;</span>cBuffer <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;cCadena += <span style="color: #00C800;">If</span><span style="color: #000000;">&#40;</span>!EMPTY<span style="color: #000000;">&#40;</span>cBusy<span style="color: #000000;">&#41;</span>, cBusy, <span style="color: #ff0000;">""</span><span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;cTerminal := PadR<span style="color: #000000;">&#40;</span> AllTrim<span style="color: #000000;">&#40;</span> cTerminal <span style="color: #000000;">&#41;</span> + AllTrim<span style="color: #000000;">&#40;</span> cBuffer <span style="color: #000000;">&#41;</span>, TERM_SIZE <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;oTerminal:<span style="color: #0000ff;">Refresh</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">If</span> cBusy = <span style="color: #ff0000;">"BUSY"</span><br />&nbsp; &nbsp; &nbsp;SYSWAIT<span style="color: #000000;">&#40;</span><span style="color: #000000;">2</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp;HangDown<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;<span style="color: #00C800;">EndIf</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">IF</span> <span style="color: #0000ff;">SUBSTR</span><span style="color: #000000;">&#40;</span>cBusy,<span style="color: #000000;">1</span>,<span style="color: #000000;">5</span><span style="color: #000000;">&#41;</span> = <span style="color: #ff0000;">"DATE="</span><br /><br />&nbsp; &nbsp; &nbsp;cTmp := MEMOTRAN<span style="color: #000000;">&#40;</span>cBusy<span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp;cTmp := STRTRAN<span style="color: #000000;">&#40;</span>cTmp,<span style="color: #ff0000;">";"</span>,<span style="color: #ff0000;">""</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp;cTmp := STRTRAN<span style="color: #000000;">&#40;</span>cTmp,<span style="color: #ff0000;">" "</span>,<span style="color: #ff0000;">""</span><span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp; &nbsp;cFech := <span style="color: #0000ff;">SUBSTR</span><span style="color: #000000;">&#40;</span>cTmp, <span style="color: #00C800;">AT</span><span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"DATE="</span>, cTmp<span style="color: #000000;">&#41;</span>, <span style="color: #00C800;">AT</span><span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"TIME="</span>, cTmp<span style="color: #000000;">&#41;</span> <span style="color: #000000;">-1</span><span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp; &nbsp;cTmp &nbsp;:= <span style="color: #0000ff;">SUBSTR</span><span style="color: #000000;">&#40;</span>cTmp, <span style="color: #00C800;">AT</span><span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"TIME="</span>, cTmp<span style="color: #000000;">&#41;</span>, <span style="color: #000000;">256</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp;cHora := <span style="color: #0000ff;">SUBSTR</span><span style="color: #000000;">&#40;</span>cTmp, <span style="color: #00C800;">AT</span><span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"TIME="</span>, cTmp<span style="color: #000000;">&#41;</span>, <span style="color: #00C800;">AT</span><span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"NMBR="</span>, cTmp<span style="color: #000000;">&#41;</span> <span style="color: #000000;">-1</span><span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp; &nbsp;cTmp &nbsp;:= <span style="color: #0000ff;">SUBSTR</span><span style="color: #000000;">&#40;</span>cTmp, <span style="color: #00C800;">AT</span><span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"NMBR="</span>, cTmp<span style="color: #000000;">&#41;</span>, <span style="color: #000000;">256</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp;cNmro := <span style="color: #0000ff;">SUBSTR</span><span style="color: #000000;">&#40;</span>cTmp, <span style="color: #00C800;">AT</span><span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"NMBR="</span>, cTmp<span style="color: #000000;">&#41;</span>, <span style="color: #000000;">256</span><span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp; &nbsp;escribetxt<span style="color: #000000;">&#40;</span> cFech + <span style="color: #ff0000;">" "</span> + cHora + <span style="color: #ff0000;">" "</span> + cNmro <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">EndIf</span><br /><br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br /><br /><span style="color: #B900B9;">//----------------------------------------------------------------------------//</span><br /><span style="color: #00C800;">Function</span> EscribeTxt<span style="color: #000000;">&#40;</span>cTxt, cFile, lModo, cRuta<span style="color: #000000;">&#41;</span><br /><span style="color: #00C800;">local</span> hHandle, cTxTmp, lOk<br /><span style="color: #00C800;">DEFAULT</span> cFile := <span style="color: #ff0000;">"llamadas.txt"</span><br /><span style="color: #00C800;">DEFAULT</span> lModo := .f.<br /><span style="color: #00C800;">DEFAULT</span> cRuta := <span style="color: #ff0000;">""</span><br /><br />lOk := .f.<br /><span style="color: #00C800;">If</span> lModo<br />&nbsp; cTxTmp := <span style="color: #ff0000;">" "</span><br />&nbsp; <span style="color: #00C800;">If</span> File<span style="color: #000000;">&#40;</span>cFile<span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; hHandle := FOpen<span style="color: #000000;">&#40;</span>cFile<span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; FRead<span style="color: #000000;">&#40;</span>hHandle, @cTxTmp, <span style="color: #000000;">64000</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; FCLose<span style="color: #000000;">&#40;</span>hHandle<span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; cTxt := ALLTRIM<span style="color: #000000;">&#40;</span>cTxTmp<span style="color: #000000;">&#41;</span> + CHR<span style="color: #000000;">&#40;</span><span style="color: #000000;">13</span><span style="color: #000000;">&#41;</span> + CHR<span style="color: #000000;">&#40;</span><span style="color: #000000;">10</span><span style="color: #000000;">&#41;</span> + cTxt<br />&nbsp; <span style="color: #00C800;">EndIf</span><br /><span style="color: #00C800;">EndIf</span><br /><br />hHandle := FCREATE<span style="color: #000000;">&#40;</span>cFile<span style="color: #000000;">&#41;</span><br />FWrite<span style="color: #000000;">&#40;</span>hHandle,cTxt<span style="color: #000000;">&#41;</span><br />FClose<span style="color: #000000;">&#40;</span>hHandle<span style="color: #000000;">&#41;</span><br /><br /><span style="color: #00C800;">Return</span><span style="color: #000000;">&#40;</span>lOk<span style="color: #000000;">&#41;</span></div>[/code:3ty2p4ah]
Capturar numero telefonico con fivewin
[b:1r5i0niz]Gracias Willy: [/b:1r5i0niz] Reviso el ejemplo que envias y comento, según he visto el módem que estoy usando tiene la característica de identificar llamadas e incluso con el comando AT#CID=1, el proveedor de telefonía local esta habilito el servicio de identificador, puesto que en la casa del propietario tiene un teléfono con identificador integrado y si muestra en pantalla el nombre de la persona que llama y que esta registrado en la memoria del telefono, siempre y cuando no se desconecte de la toma de corriente electrica jejeje. El modem que pretendo usar no es PCI Express como el que usas, la tarjeta madre de la pc que usa mi cliente es algo viejita, todavia usa los PCI y en el caso del modem un puerto CNR (Comunication Network Riser), sería cuestión de provar con varios modems, cosa que no puedo pues solo tengo este por lo pronto... [b:1r5i0niz]Manuel Aranda:[/b:1r5i0niz] Pienso a mi modesta forma de pensar y en mis vagos conocimientos que sería un tanto complicado identificar el número de llamada mediante un modem ADSL, hay varios factores a comentar y solventar puesto que la interface de comunicación de una PC al modem es via Wifi o Ethernet, si a esto le agregamos que la conexión está protegida por un firewall y una IP, nos daria algo más de trabajo saber este dato que si tuvieramos directamente conectado el modem a un puerto de nuestra PC. Mi idea es que teniendo el modem conectado a mi PC, este reciba en la entrada "Line" la señal del proveedor para identificar el número de telefono que realizó la llamada, y abrir automaticamente una ventana en mi sistema para capturar el pedido, mientras que en la salida "Phone" se conecte el teléfono para contestar la llamada y recibir el pedido del cliente, como cuando usabamos el ancho de banda de 56k para internet. Hasta donde he investigado, es posible identificar con ayuda del modem el número al segundo tono de llamda, todavia no lo he comprobado, pues no paso de intentar establecer comunicación con el modem. Me gustaría y si no es mucho pedir a los que tienen esto solucionado, compartieran un video para saber como se comporta el identificador con sus sistemas, así como sus esperiencias y soluciones.. De todas maneras, entre más se comente tendriamos más de donde encontrar solución a este tema...
Capturar numero telefonico con fivewin
Colegas: De Nuevo con esto... Resulta que al fin pude hechar a volar este sample del identificador de llamadas, resolvi de otra forma el problema de comunicación con el modem, pues no he encontrado el driver adecuado, y re-utilizando mi vieja laptop de 32mb en ram y 456 Mhz que trae un modem hsp56 mr pctel via, le instale xp sp3, con su correspondiente driver para hacer pruebas, dudando de que fuera posible dicha azaña: corri el ejemplo que da arriba Willi y mi laptop que lo levantó sin problemas, escucho la bocina del modem haciendo comunicación con la aplicación, puedo marcar desde el mismo ejemplo, escucho los tonos de marcado y hasta cuando me contestan. Animado de que todo hiba de maravilla esperé a que entrara una llamada para conocer como funcionaba, pero me lleve una desagradable sorpresa, resulta que el teléfono timbro 2 veces, el programa lo identificó como "RING" pero nunca supe que numero era el que habia marcado, desconosco si algo falta o si algo hize mal, la linea de mi cliente tiene el servicio de identificador de llamadas activo, puesto que en su telefono de mesa si lo muestra, el modem soporta la identificación de llamadas puesto que la instrución AT#CID=1 marca OK. Si alguien tiene una imagen de como les funciona y conoce más el porque no logro identificar el número y me explica se lo agraeceré, [img:3s74y904]http&#58;//img197&#46;imageshack&#46;us/img197/9846/phonemy&#46;jpg[/img:3s74y904] Saludos.. <!-- s:cry: --><img src="{SMILIES_PATH}/icon_cry.gif" alt=":cry:" title="Crying or Very sad" /><!-- s:cry: --> <!-- s:oops: --><img src="{SMILIES_PATH}/icon_redface.gif" alt=":oops:" title="Embarassed" /><!-- s:oops: --> <!-- s:wink: --><img src="{SMILIES_PATH}/icon_wink.gif" alt=":wink:" title="Wink" /><!-- s:wink: --> <!-- s:roll: --><img src="{SMILIES_PATH}/icon_rolleyes.gif" alt=":roll:" title="Rolling Eyes" /><!-- s:roll: --> <!-- s:lol: --><img src="{SMILIES_PATH}/icon_lol.gif" alt=":lol:" title="Laughing" /><!-- s:lol: --> <!-- s:lol: --><img src="{SMILIES_PATH}/icon_lol.gif" alt=":lol:" title="Laughing" /><!-- s:lol: --> <!-- s:x --><img src="{SMILIES_PATH}/icon_mad.gif" alt=":x" title="Mad" /><!-- s:x -->