Page 1 of 1

Error Invalid memory access ( read error at address 12 )

Posted: Sun Nov 15, 2009 9:41 am
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

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

Posted: Sun Nov 15, 2009 11:18 am
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!

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

Posted: Sun Nov 15, 2009 12:03 pm
by RE-A
The "OpenDevice" function doesn't have any parameters, works for me on beta 2.

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

Posted: Mon Nov 16, 2009 2:33 am
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: