FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour PeekByte problem !
Posts: 301
Joined: Fri Jun 01, 2007 09:07 AM
PeekByte problem !
Posted: Wed Dec 07, 2011 08:31 AM

Function PeekByte allways crash (break) program for example sample program fwbios
windows error: "fwbios.exe has encountered a problem and needs to close. We are sorry for the inconvenience."
(In 16 bit fivewin work fine)

Any sugestions ?

Best regards,

Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: PeekByte problem !
Posted: Wed Dec 07, 2011 10:15 AM

In 32 and 64 bits it is forbidden (by the operating system) to directly access to memory addresses contents.

You have to use Windows API functions to access the information that you are looking for

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 301
Joined: Fri Jun 01, 2007 09:07 AM
Re: PeekByte problem !
Posted: Tue Dec 13, 2011 03:15 PM

Thanks for reply Antonio,
How to do that some help please ?
Best regardas,

Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: PeekByte problem !
Posted: Tue Dec 13, 2011 07:00 PM

What bios info do you need ?

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 301
Joined: Fri Jun 01, 2007 09:07 AM
Re: PeekByte problem !
Posted: Wed Dec 14, 2011 07:41 AM

Hi,
In start BiosDate !
Best regards,

Posts: 824
Joined: Thu Oct 13, 2005 07:39 AM
Re: PeekByte problem !
Posted: Wed Dec 14, 2011 08:35 AM
You can use wmi to get these informations

Code (fw): Select all Collapse
TRY
    oWmi := CreateObject( "wbemScripting.SwbemLocator" )
  CATCH oErr
    oWmi := nil
    lError := .t.
    cError := oErr:Description
  END

  IF !lError
    objWMI:= ::oWmi:ConnectServer() // (strComputer, "root\cimv2")
  ENDIF

oBios := objWMI:ExecQuery( "Select * FROM Win32_BIOS" )

FOR EACH oData IN oBios
    cManufacturer  := oData:Manufacturer
    cName          := oData:Name
    cSerialNumber  := oData:SerialNumber
    dReleaseDate   := StoD (SubStr(oData:ReleaseDate,1,8))
    cVersion       := oData:SMBIOSBIOSVersion
    cRevison       := oData:Version
NEXT
kind regards

Stefan
Posts: 301
Joined: Fri Jun 01, 2007 09:07 AM
Re: PeekByte problem !
Posted: Thu Dec 15, 2011 09:05 AM

Hi Stefan
Thanks for reply , this is going well ...
But i am still interested how to use Windows api functions (what is the way to use them)

With best regards,

Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: PeekByte problem !
Posted: Thu Dec 15, 2011 10:13 AM

You can read that info from the registry:

HKEY_LOCAL_MACHINE\HARDWARE\DESCRIPTION\System\

SystemBIOSDate
SystemBIOSVersion
VideoBIOSDate

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 301
Joined: Fri Jun 01, 2007 09:07 AM
Re: PeekByte problem !
Posted: Thu Dec 15, 2011 10:27 AM

Hi Antonio,
That is ok ...work fine
But i want to know how to use Windows Api functions. Not only for bios date but probably i will need to use other api functions.
i mean HOW TO CALL API FUNCTIONS ?

Regards,

Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: PeekByte problem !
Posted: Thu Dec 15, 2011 10:39 AM

All the source code in FWH\source\winapi*.c are example of calls to the Windows API functions

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: PeekByte problem !
Posted: Thu Dec 15, 2011 10:40 AM

Here you have an example:

viewtopic.php?f=3t=23083p=123781#p123781

&&

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 301
Joined: Fri Jun 01, 2007 09:07 AM
Re: PeekByte problem !
Posted: Fri Dec 16, 2011 08:29 AM

Thanks Antonio,
Regards,

Continue the discussion