Page 1 of 1

'Invalid memory Access' with GTK-API

Posted: Fri Sep 09, 2005 11:34 pm
by Pinhead
It runs!
Thank you!

Posted: Fri Sep 09, 2005 11:37 pm
by freak
The last parameter must be the pointer to a long variable to receive the cursor position after the text was inserted.
Also you should probably remove the "+1" there from datenmenge.l

gtk_editable_insert_text_(GadgetID(#Editor_1),*Buffer,datenmenge.l,@position.l)

Posted: Sat Sep 10, 2005 12:04 am
by Pinhead
I tried this:

Code: Select all

	      If ReadFile(#File_1, File.s)
		         laenge=FileSize(File.s)
		         *Buffer.b = AllocateMemory(laenge)
		         If *Buffer
		             datenmenge.l = ReadData(*Buffer, laenge)
		             CloseFile(#File_1)
   		           *Buffer = AllocateMemory(datenmenge.l)
           		   *position.l=AllocateMemory(1)
   		           PokeB(*position,0)
		             gtk_editable_insert_text_(GadgetID(#Editor_1),*Buffer,datenmenge.l,@position.l)
		         Else
	               MessageRequester("Fehler", "Speicher nicht reserviert!", 0)
	          EndIf
	      Else
In the characters in the editor are not showabel, I only see squaers...
The Input file is a html file