Jump to content

Retrieving string from DllStruct


Recommended Posts

A sample says more than a thousand words:

$s=DllStructCreate("char[255]")

$str=""
For $i=0 To 253
    $str&=Chr(Random(1,255,1))
Next
; Set the string to some random data
DllStructSetData($s,1,$str)

; Retrieve the string the usual way
$fromstruct=DllStructGetData($s,1)

; Get the string, char by char
$fromstruct2=""
For $i=1 To 254
    $fromstruct2&=DllStructGetData($s,1,$i)
Next

; They're not equal :/
MsgBox(0,($fromstruct==$fromstruct2),$fromstruct&@CRLF&@CRLF&$fromstruct2)

I just cannot see the difference, I thought the only difference would be that AutoIt would stop reading at Chr(0) in the first method.

Edited by monoceres

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

Link to comment
Share on other sites

I once forgot how old I am. This girl, lady actually, asked me and I just couldnt't remember. Nooo way. It was so embarrassing. While she waited there for my answer I tried to calculate it from my birth year (somehow did remember that) but just couldn't. Mainly because I couldn't remember what year it was.

So this is nothing. Don't worry.

edit:

btw, don't tell anyone this. I don't want it spread. It's a secret.

Edited by trancexx

♡♡♡

.

eMyvnE

Link to comment
Share on other sites

I once forgot how old I am. This girl, lady actually, asked me and I just couldnt't remember. Nooo way. It was so embarrassing. While she waited there for my answer I tried to calculate it from my birth year (somehow did remember that) but just couldn't. Mainly because I couldn't remember what year it was.

So this is nothing. Don't worry.

edit:

btw, don't tell anyone this. I don't want it spread. It's a secret.

Hahaha how drunk were you? :)

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

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...