Need help getting tooltip userlib working

BlitzPlus Forums/BlitzPlus Programming/Need help getting tooltip userlib working

Kanati(Posted 2004) [#1]
The string you are passing to the dll is not getting "converted"... I'm guessing that instead of taking your "lol" + asc(0) as a string, it's looking at it as a memory address to a string.

As to what exactly you need to do to fix it... I haven't got the time right now to look, but when I get home later tonight I'll see what I can dig up.

Kanati


skn3(Posted 2004) [#2]
Nice one, I was on those lines after a few hours of looking for a bug in my code.

I am passing the address of a seperate string bank, containing the string+asc(0), not just directly plonking it into the main struct bank.

It makes no difference as to what your string is, so my initial conclusion was that putting the value of a bankhandle, into another bank would infact not point to the bank in question (wtf ?). I know this to be false, in the case of using it again in blitz basic. Passing that bank across to another system is of course a totaly different matter.

Oh and 1 thing to try, in debug mode/no-debug-mode the text in the tooltip will change.

Its frustrating to say the least :)


skn3(Posted 2004) [#3]
No one got a solution ?
It would be a shame to let this helpfull userlib goto waste..


ford escort(Posted 2004) [#4]
i'm not at ease with 'userlib stuff' but it seem that the string don't have any effect to the tool type displayed,but
if you modify the adress passed to the userlib
ex:
PokeInt(bank,36,bankstring+2)

the string displayed is shorter.so it look like that there's something wrong with what is do with the adress sent


pantsonhead.com(Posted 2004) [#5]
I reckon there's a problem with the ToolInfo structure.

I've seen it defined like this in VB so I wonder if using the bank address is actually required.

Private Type TOOLINFO
    lSize As Long
    lFlags As Long
    hwnd As Long
    lId As Long
    lpRect As RECT
    hInstance As Long
    lpStr As String
    lParam As Long
End Type

Are you getting ",,%Ÿ" in debug mode? I get the same text as your picture in non-debug mode.

I will have another decent look at this tonight as my lunch break is now over :(


skn3(Posted 2004) [#6]
Yeah I get those texts in the different debug modes.

The trouble is, a string in blitz (as far as I know) be poked as an int memory location into a bank. Which is how the lpStr type stores it.

When passing a string to a userlib, it converts fine, but passing the string in that way, via a "fake" struct is seemingly impossible, without pointers in blitz. GAH!

I have a dll that somone made for me, I'll put it up for download soon if this can't be resolved.


skn3(Posted 2004) [#7]
Well I got it working by myself :D



I'll make some wrapper functions in blitz, and look into all the other possabilities now. Expect a userlib soon :)


pantsonhead.com(Posted 2004) [#8]
Excellent work - keen to see your working code now :)


skn3(Posted 2004) [#9]
Nooooooooooooooooooooooooooooooo!

After all this hassle of getting it working, then writting the functions and blah blah blah.

They don't seem to working properly. They will create ok, they will function fine. When you click on the gadget you attached the tooltip to, the tooltip will disappear and then no longer function.

Very anoying.

Doed anyone know anything about tooltips, and how to get around it ?