FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin para Pocket PC Puede hacerse un Soft Reset del Pocket desde el programa???
Posts: 365
Joined: Sat Oct 08, 2005 07:59 PM
Puede hacerse un Soft Reset del Pocket desde el programa???
Posted: Mon Oct 09, 2006 04:52 PM

Quisiera incluir en mi programa un bot贸n que fuerce un soft reset del PC.
(lo necesito por si pierdo el enlace con un dispositivo Bluetooth para poder reponerlo. O alguien sabe alguna forma m谩s elegante?)

Supongo que en el API debe haber alguna forma de forzar el reset del ordenador. Alguien podr铆a postear el c贸digo necesario?
Gracias

Rafael

Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Puede hacerse un Soft Reset del Pocket desde el programa???
Posted: Tue Oct 10, 2006 08:45 AM
Rafael,

Prueba as铆:
#pragma BEGINDUMP

#include <windows.h>
#include <hbapi.h>

HB_FUNC( EXITWINDOWSEX )
{
   hb_retl( ExitWindowsEx( EWX_REBOOT, 0 ) );
}

#pragma ENDDUMP
regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 365
Joined: Sat Oct 08, 2005 07:59 PM
Puede hacerse un Soft Reset del Pocket desde el programa???
Posted: Tue Oct 10, 2006 11:01 AM

Antonio:
Creo que me falta algo. Al compilar me da:

error C2065: 'ExitWindowsEx' : undeclared identifier

(Utilizo la versi贸n FWPPC de 24 agosto 2006) Un saludo,

Rafael

Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Puede hacerse un Soft Reset del Pocket desde el programa???
Posted: Tue Oct 10, 2006 11:49 AM

Rafael,

Tienes que enlazar aygshell.lib tambien.

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 365
Joined: Sat Oct 08, 2005 07:59 PM
Puede hacerse un Soft Reset del Pocket desde el programa???
Posted: Tue Oct 10, 2006 12:19 PM

Antonio:

Ya la enlazaba pero sigue sin compilar. 驴aygshell.lib ha de ir en alguna posici贸n especial? Yo utilizo el bat de compilaci贸n est谩ndard que viene con el FWPPC. Aclaro que por ahora me he limitado a copiar tu c贸digo al final de mi fuente, sin ni siquiera hacerle ninguna llamada.

Me sigue faltando algo...
Rafael

Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Puede hacerse un Soft Reset del Pocket desde el programa???
Posted: Tue Oct 10, 2006 11:08 PM

Rafael,

Lo estamos revisando...

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Puede hacerse un Soft Reset del Pocket desde el programa???
Posted: Tue Oct 10, 2006 11:16 PM
Rafael,

Este es el c贸digo correcto, pero no hace reboot de momento...
#include "FWCE.ch"

function Main()

   local oWnd
   
   DEFINE WINDOW oWnd TITLE "Exit"
   
   @ 2, 2 BUTTON "Reboot" SIZE 80, 20 ACTION MsgInfo( ExitWindowsEx() )
   
   ACTIVATE WINDOW oWnd 
   
return nil

#pragma BEGINDUMP 

#include <windows.h> 
#include <hbapi.h> 

extern "C" { BOOL ExitWindowsEx( UINT uFlags, DWORD dwReserved ); }

HB_FUNC( EXITWINDOWSEX ) 
{ 
   hb_retl( ExitWindowsEx( EWX_REBOOT, 0 ) ); 
} 

#pragma ENDDUMP
regards, saludos

Antonio Linares
www.fivetechsoft.com

Continue the discussion