Sign in to follow this  
Followers 0
Michel Claveau

Handle on string/_UDF?

4 posts in this topic

Hi!

Is it possible to obtain a handle on a string, and/or UDF function?

(I want use these handles for callback in COM server)

Share this post


Link to post
Share on other sites



no but you can create your own Null terminated strings...

$sString = "Test"
$vStruct = DllStructCreate("char[" & StringLen($sString) + 1 &  "]")
DllStructSetData($vStruct,1,$sString)
$szPtr = DllStructGetPtr($vStruct)
ConsoleWrite(DllStructGetData($vStruct,1))

but keep in mind that memory is freed when $vStruct is destroyed...

but you can allways manualy 'malloc' and 'free' with dllcall if you need something more presistent :lmao:


CoProc Multi Process Helper libraryTrashBin.nfshost.com store your AutoIt related files here!AutoIt User Map

Share this post


Link to post
Share on other sites

Hummm....

Thanks for your (fast) answer.

But your solution is an ersatz, with some limits for use.

Perhaps, in a future release of AutoIt? Perhaps a possible way in DLL-callback direction?

Have a good night-or-day

Share this post


Link to post
Share on other sites

i tought com events are supported...

but i hadly use com so i cant tell you for sure :lmao:

of course you could have more complex structures than the one mentioned above...

and you can trigger events with windows messageing ( Check out GUIRegisterMsg and 'PostMessage' Api...)


CoProc Multi Process Helper libraryTrashBin.nfshost.com store your AutoIt related files here!AutoIt User Map

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0