PeekByte problem !

PeekByte problem !

Postby avista » Wed Dec 07, 2011 8: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,
User avatar
avista
 
Posts: 301
Joined: Fri Jun 01, 2007 9:07 am
Location: Macedonia

Re: PeekByte problem !

Postby Antonio Linares » 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
User avatar
Antonio Linares
Site Admin
 
Posts: 41328
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: PeekByte problem !

Postby avista » Tue Dec 13, 2011 3:15 pm

Thanks for reply Antonio,
How to do that some help please ?
Best regardas,
User avatar
avista
 
Posts: 301
Joined: Fri Jun 01, 2007 9:07 am
Location: Macedonia

Re: PeekByte problem !

Postby Antonio Linares » Tue Dec 13, 2011 7:00 pm

What bios info do you need ?
regards, saludos

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

Re: PeekByte problem !

Postby avista » Wed Dec 14, 2011 7:41 am

Hi,
In start BiosDate !
Best regards,
User avatar
avista
 
Posts: 301
Joined: Fri Jun 01, 2007 9:07 am
Location: Macedonia

Re: PeekByte problem !

Postby StefanHaupt » Wed Dec 14, 2011 8:35 am

You can use wmi to get these informations

Code: Select all  Expand view

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
StefanHaupt
 
Posts: 824
Joined: Thu Oct 13, 2005 7:39 am
Location: Germany

Re: PeekByte problem !

Postby avista » Thu Dec 15, 2011 9: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,
User avatar
avista
 
Posts: 301
Joined: Fri Jun 01, 2007 9:07 am
Location: Macedonia

Re: PeekByte problem !

Postby Antonio Linares » 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
User avatar
Antonio Linares
Site Admin
 
Posts: 41328
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: PeekByte problem !

Postby avista » 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,
User avatar
avista
 
Posts: 301
Joined: Fri Jun 01, 2007 9:07 am
Location: Macedonia

Re: PeekByte problem !

Postby Antonio Linares » 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
User avatar
Antonio Linares
Site Admin
 
Posts: 41328
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: PeekByte problem !

Postby Antonio Linares » Thu Dec 15, 2011 10:40 am

regards, saludos

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

Re: PeekByte problem !

Postby avista » Fri Dec 16, 2011 8:29 am

Thanks Antonio,
Regards,
User avatar
avista
 
Posts: 301
Joined: Fri Jun 01, 2007 9:07 am
Location: Macedonia


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 6 guests