Sign in to follow this  
Followers 0
Markos

[Solved] Need help with DllStructCreate

6 posts in this topic

#1 ·  Posted (edited)

Hello, I am working on little TeamSpeak2 plugin that uses their TSRemote.dll

It has function 'tsrGetUserInfo' which returns TS2 Users info (his flags, channel, etc.)

but it requires a pointer to a Struct of 38 elements!

Actually it is working for me with only 16 elements, but then I dont receive all of the informations

the function would normally return. If I specify more elements, AutoIt crashes with 'Dont send' dialog.

Did I do something wrong? Or is it known autoit limitation? Is it problem of the dll?

Is there something I can do to fix this problem?

Thanx for your help.

$struct = DllStructCreate('int PlayerId;int ChannelID;char[4];char[4];char[4];char[4];char[4];char[4];char[4];char[4];int PlayerPrivileges;int PlayerFlags;int;int;int;int')
$pointer = DllStructGetPtr($struct)
Edited by Markos

Share this post


Link to post
Share on other sites



Hi!

I would love to help but it's kinda hard without documentation :)


Broken link? PM me and I'll send you the file!

Share this post


Link to post
Share on other sites

Hi!

I would love to help but it's kinda hard without documentation :)

You quite didnt read my post. Is it even POSSIBLE to create struct with more than 16 elements?


Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

You quite didnt read my post. Is it even POSSIBLE to create struct with more than 16 elements?

I'm pretty sure I have created structs with way more than 16 elements. Some of the structs on msdn are really big!

And to back it up:

$str=""
For $i=0 To 100
    $str&="int;"
Next
$struct=DllStructCreate($str)

If @error Then MsgBox(0,"Error","Couldn't create struct")

For $i=1 To 100
    DllStructSetData($struct,$i,$i-1)
Next

For $i=1 To 100
    ConsoleWrite("Element "&$i&": "&DllStructGetData($struct,$i)&@CRLF)
Next
Edited by monoceres

Broken link? PM me and I'll send you the file!

Share this post


Link to post
Share on other sites

Have you done a search for 'tsrGetUserInfo' in this forum?

I had a couple of hits and the structures they created are different than you do so my guess is that you need to check the structure.

Jos


Visit the SciTE4AutoIt3 Download page for the latest versions        Beta files                                                          Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites

@Jos

Yes I searched that. Their structure didnt work for me.

But I have fixed it now, It must have 38 elements but I missed 1 "int" so i had 37.

That caused the autoIt crash.

Thanx for your help anyway


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