Jump to content

[Solved] Need help with DllStructCreate


Markos
 Share

Recommended Posts

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
Link to comment
Share on other sites

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!

Link to comment
Share on other sites

  • Developers

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

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...