Error Invalid memory access ( read error at address 12 )

Just starting out? Need help? Post your questions and find answers here.
John-G
User
User
Posts: 52
Joined: Wed Oct 03, 2007 5:13 pm
Location: Pittsburgh,Pa.
Contact:

Error Invalid memory access ( read error at address 12 )

Post by John-G »

Hello ... A small problem .. I am making this program that's talking to a card on the USB port. It opens and all the code works but when it leaves the Procedure with a "EndProcedure" i get a "Invalid memory access ( read error at address 12 )" Does any one know what it is or how i can get it to work .. i and using 4.40 beta 6 windoes x86

HELP :?: Thanks John :shock:

Code: Select all

Procedure.l Open_Card()
Result.l = OpenLibrary(0,#PB_Compiler_FilePath + "Drivers\K8061.dll") ;The DLL used To talk To the Controler
;
If Result.l = 0
  Debug "----------------------"
  Debug "Driver file not Opened"
  Debug "----------------------"
  card_driver_k8061.l=0
  End
EndIf 
  Debug ""
  Debug "----------------------"
  Debug "Driver file Opened"
  Debug "----------------------"
  card_driver_k8061.l=1
  SetGadgetState(#Radio_0,2)

Result.l = CallFunction(0, "OpenDevice" ,TEST.l); Open the 8061 Card
Debug ""
Debug "----------------------"
Debug Result.l
Debug "----------------------"

Delay(10000)
EndProcedure
srod
PureBasic Expert
PureBasic Expert
Posts: 10589
Joined: Wed Oct 29, 2003 4:35 pm
Location: Beyond the pale...

Re: Error Invalid memory access ( read error at address 12 )

Post by srod »

You sure that the OpenDevice() function takes any parameters? From what I can see looking at the original Pascal code, it doesn't seem to take any!
I may look like a mule, but I'm not a complete ass.
RE-A
User
User
Posts: 39
Joined: Thu Aug 21, 2008 4:19 pm
Location: Belgium
Contact:

Re: Error Invalid memory access ( read error at address 12 )

Post by RE-A »

The "OpenDevice" function doesn't have any parameters, works for me on beta 2.
John-G
User
User
Posts: 52
Joined: Wed Oct 03, 2007 5:13 pm
Location: Pittsburgh,Pa.
Contact:

Re: Error Invalid memory access ( read error at address 12 )

Post by John-G »

that was it .. took off the parameter and all is working .. should of though of that .. but did not .. Thanks as Allways :lol:
Post Reply