Memory Access Violation with CallDLL

Blitz3D Forums/Blitz3D Beginners Area/Memory Access Violation with CallDLL

The forum is locked. These are the original blitzbasic.com forums, kept so they can still be read. No new topics, replies or edits can be made here. To join in, head over to the Blitz3D+ forums.

It's been a while since I used Blitz3D but I am still suffering from the same problems. Since all these years I own Blitz3D (2003) I was never able to get CallDLL() running properly. I searched the forums but couldn't find a straight example demonstrating how to use this command. I mean an example wich is reproducable and not dependant from a specific library.

Please someone have a look at this code:

Graphics(420,320,0,2)
SetBuffer(BackBuffer())

Function PokeString(Bank,Offset,Message$)
	Length = Len(Message$)-1
	
	For i=0 To Length
		PokeByte(Bank,Offset + i,Asc(Mid(Message$,i+1,1)))		
	Next
End Function

strHead$ = "Noitice"
strBody$ = "This is a test string honkey!"

hMemHead = CreateBank(Len(strHead$))
hMemBody = CreateBank(Len(strBody$))

PokeString(hMemHead,0,strHead$)
PokeString(hMemBody,0,strBody$)

hMemInput = CreateBank(16)

PokeInt(hMemInput,00,0)			; hWnd		: Handle to the owner window of the message box to be created
PokeInt(hMemInput,04,hMemBody )	; lpText	: Pointer to a null-terminated string that contains the message to be displayed
PokeInt(hMemInput,08,hMemHead)	; lpCaption	: Pointer to a Null-terminated string that contains the dialog box title
PokeInt(hMemInput,12,48)		; uType		: Specifies the contents and behavior of the dialog box

CallDLL("user32","MessageBoxA",hMemInput)

Repeat : Cls : Flip : Until KeyDown(1) : End

I appreciate any help on this issue.