Try defining the function with $ suffix, eg, :
FUNCTION IntToBin$ (num)
or, define the function return type as STRING, eg :
FUNCTION STRING IntToBin (num)
Don't forget to change the function declaration in the
PROLOG as well.
You don't need the line EXTERNAL STRING nu$.
ciao,
D.
I built your library. Both functions worked as expected.
How are you calling AllTrim? Can you provide your test code?
Also, you can shorten the above functions by using
RETURN HEX$ (num)
or
RETURN TRIM$ (istr$)
ciao,
D.
Two important things:
1. Autohotkey expects to pass all string parameters by address.
So we need to modify the xblite function to accept a string address:
DECLARE FUNCTION STRING AllTrim ( saddr )
FUNCTION STRING AllTrim (saddr)
nist$ = CSTRING$ (saddr) ' convert address into string
RETURN TRIM$ (nist$) ' return nist$
END FUNCTION
2. When calling an external function from autohotkey which expects
a string returned, you need to allocate enough space for the returned
string by calling VarSetCapacity:
VarSetCapacity(Str2, 6)
Str2 := Dllcall( "skan.dll\AllTrim", Str, " sdsads ", Str)
MsgBox, % Str2 "`nerrorlevel: " errorLevel
ciao,
D.