M.A.V with a DECLS

Blitz3D Forums/Blitz3D Programming/M.A.V with a DECLS

ZJP(Posted 2009) [#1]
Hi,

I,ve a MAV with this function.
.lib "BINT32.DLL" 
BINT_Message(Title$, TextToShow$): "BINT_Message" 


The same works well with VB6
Declare Sub BINT_Message Lib "BINT32.DLL" (ByVal Title As String, ByVal TextToShow As String)

I think the error comes from the passing of parameters. (ByVal for VB6. Blitz3D? )
Any solution?

JP

PS : http://www.thinbasic.com/index.php?option=com_jdownloads&Itemid=95&task=view.download&cid=7


Abrexxes(Posted 2009) [#2]
This ask not for a string but for a pointer to a string (AINSI).

Try this:

.lib "BINT32.DLL" 
BINT_Message(Title*, TextToShow*): "BINT_Message"


To send from blitz, create 2 banks
Now make a bank from string as you can see (in reverse)

BinT_Message (bank1,ban2)




Here an example from my Bass Lib to read out a String

Function BASS_GetDeviceDescriptionString$(device%)
	Local Pointer,BnkDescription,Description$,I,Char
	Pointer = BASS_GetDeviceDescription(device)
	If Not Pointer Then
		Return ""
	Else
		BnkDescription = CreateBank(256)
		BASS_RtlMoveMemory1(BnkDescription,Pointer,256)
		For I = 0 To 255
			Char = PeekByte(BnkDescription,I)
			If Char = 0 Then Exit
			Description$ = Description$ + Chr$(Char)
		Next
	EndIf
	FreeBank BnkDescription : Return Description$
End Function


Sorry, i hope this helps, i am 10 minutes out of bed and my brain still needs coffee. ;)


bye


ZJP(Posted 2009) [#3]
I already tried that :-(
"Dommage 'in french'", BINT32 is a free small Basic Interpreter 32-bit DLL designed to be used inside PowerBASIC for scripting. It works very well with VB6
JP
;Decls
.lib "BINT32.DLL" 
BINT_About() : "BINT_About"
BINT_Message(Title*, TextToShow*): "BINT_Message"

; Blitz code
BINT_About ; <<<< Function without parameters. Works well !!!
bank_title   = CreateBank(255)
bank_message = CreateBank(255)

title$=" The window's title"
message$=" and now the message"

str_to_BK(bank_title,title$)
str_to_BK(bank_message,message$)

BINT_Message(bank_title, bank_message) ; <<<<< MAV HERE
WaitKey
End 

Function str_to_BK(bank,s$)
	Local i
	s$ = s$+ Chr(0)
	For i = 1 To Len(s$)
	PokeByte bank, i-1, Asc(Mid$(s$,i,1))
	Next
End Function



Abrexxes(Posted 2009) [#4]
Please give me the MSN return of this stuff ( No idea , never used,


[FR]J ai jamais a faire avec ca, Done moi la API, je vais voir. Google me done rien. MSN non plus[/FR]

salu


ZJP(Posted 2009) [#5]
Api, doc and test here. Including VB6 first test. Thx
Edit : download link removed. PB solved.
JP


Abrexxes(Posted 2009) [#6]
puh,maybee we must move with RtlMoveMemory to a local mem adress. I dont have experience with PowerBasic. As you want do "send" text....*blub


ZJP(Posted 2009) [#7]
"...RtlMoveMemory ..." I will try this function. Thank you

JP


ZJP(Posted 2009) [#8]
Problem solved with a wrapper ;-)
Project here http://www.blitzbasic.com/Community/posts.php?topic=83975
JP