nExtMem() provocando GPF con xhb.com

nExtMem() provocando GPF con xhb.com

Postby carlos vargas » Tue Mar 15, 2016 3:10 am

Antonio, la funcion nExtMem() esta provocando gpf con xhb.com, esta funcion es usada en errsysw.prg por lo que cuando una app compilada con xhb.com genera un error, el cuadro de dialogo del error no aparece, si no que la aplicacion simplemnte colapsa y se cierra.
con xharbour y harbour funciona bien, ahora en los fuentes de fwh aparece la definicion de una funcion nExtMem pero esta encerrada en un
ifdef __CLIPPER__ por lo que no es la que se esta compilando con las app de 32 bits
Code: Select all  Expand view

#include "FiveWin.ch"

//----------------------------------------------------------------------------//

function Main()
   
   xbrowse(GetVersion())
   xbrowse(GetTasks())
   ?"IsWinNT():",IsWinNT()
   ?"IsExe64():",IsExe64()
   ?"ProcName( 7 ):",ProcName( 7 )
   ?"GetCPU():",GetCPU()
   ?" GetCPUSpeed():", GetCPUSpeed()
   ?"nExtMem():",nExtMem()
   MsgInfo( "Hello world from Harbour and FWH!" )
   
return nil

 

memstat.prg
Code: Select all  Expand view

#ifdef __CLIPPER__

function nExtMem()

   local oMemoryStatus

   STRUCT oMemoryStatus
      MEMBER nSize          AS LONG
      MEMBER nMemoryLoad    AS LONG
      MEMBER nTotalPhys     AS LONG
      MEMBER nAvailPhys     AS LONG
      MEMBER nTotalPageFile AS LONG
      MEMBER nAvailPageFile AS LONG
      MEMBER nTotalVirtual  AS LONG
      MEMBER nAvailVirtual  AS LONG
   ENDSTRUCT

   oMemoryStatus:nSize = oMemoryStatus:SizeOf()
   GblMemStat( oMemoryStatus:cBuffer )

return oMemoryStatus:nTotalPhys

DLL32 FUNCTION GblMemStat( pMEMORYSTATUS AS LPSTR ) AS VOID PASCAL ;
                           FROM "GlobalMemoryStatus" LIB "kernel32.dll"

#endif
Salu2
Carlos Vargas
Desde Managua, Nicaragua (CA)
User avatar
carlos vargas
 
Posts: 1719
Joined: Tue Oct 11, 2005 5:01 pm
Location: Nicaragua

Re: nExtMem() provocando GPF con xhb.com

Postby carlos vargas » Tue Mar 15, 2016 3:16 am

Antonio, he quitado la compilacion condicional y ya funciona.
Code: Select all  Expand view
#include "FiveWin.ch"
#include "dll.ch"
#include "struct.ch"
//----------------------------------------------------------------------------//

function Main()
   
   xbrowse(GetVersion())
   xbrowse(GetTasks())
   ?"IsWinNT():",IsWinNT()
   ?"IsExe64():",IsExe64()
   ?"ProcName( 7 ):",ProcName( 7 )
   ?"GetCPU():",GetCPU()
   ?" GetCPUSpeed():", GetCPUSpeed()
   ?"nExtMem():",nExtMem()
?a+1      //--------------------------->provocamos un error
   MsgInfo( "Hello world from Harbour and FWH!" )
   
return nil

//----------------------------------------------------------------------------//


function nExtMem()

   local oMemoryStatus

   STRUCT oMemoryStatus
      MEMBER nSize          AS LONG
      MEMBER nMemoryLoad    AS LONG
      MEMBER nTotalPhys     AS LONG
      MEMBER nAvailPhys     AS LONG
      MEMBER nTotalPageFile AS LONG
      MEMBER nAvailPageFile AS LONG
      MEMBER nTotalVirtual  AS LONG
      MEMBER nAvailVirtual  AS LONG
   ENDSTRUCT

   oMemoryStatus:nSize = oMemoryStatus:SizeOf()
   GblMemStat( oMemoryStatus:cBuffer )

return oMemoryStatus:nTotalPhys

DLL32 FUNCTION GblMemStat( pMEMORYSTATUS AS LPSTR ) AS VOID PASCAL ;
                           FROM "GlobalMemoryStatus" LIB "kernel32.dll"
Salu2
Carlos Vargas
Desde Managua, Nicaragua (CA)
User avatar
carlos vargas
 
Posts: 1719
Joined: Tue Oct 11, 2005 5:01 pm
Location: Nicaragua

Re: nExtMem() provocando GPF con xhb.com

Postby Antonio Linares » Thu Mar 31, 2016 2:06 pm

Carlos,

Incluido para la próxima versión, gracias!
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42076
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain


Return to FiveWin para Harbour/xHarbour

Who is online

Users browsing this forum: Google [Bot] and 65 guests