Jump to content
Sign in to follow this  
JohnOne

DllCall?

Recommended Posts

trancexx

Autoit will ignore all characters after the null-terminator, so your second null won't get thru.

Just use two two characters bigger dllstruct and fill it with the original string. Have in mind that binary code will receive passive buffer and not actual CString, so for anything done on it you have to use copy constructor to create real CString that you can work on.

  • Like 1

♡♡♡

.

eMyvnE

Share this post


Link to post
Share on other sites
JohnOne

Have in mind that binary code will receive passive buffer and not actual CString, so for anything done on it you have to use copy constructor to create real CString that you can work on.

I'll have to confess to not knowing what exactly this means.

I'm I to assume that with a struct say "wstr[256]" that the whole thing will get through filled with just 128 char string?

It's quite odd really because I wrapped the function in C/++ myself in a dll, and called it without a problem, but calling directly from AutoIt fails.

So I must assume there is problem with my struct or other code, which I'll post up if I cannot figure out this morning.

Thanks for help folks.


AutoIt Absolute Beginners    Require a serial    Pause Script    Video Tutorials by Morthawt   ipify 

Monkey's are, like, natures humans.

Share this post


Link to post
Share on other sites
trancexx

There is no such thing as wstr[] in AutoIt, probably you meant wchar[].

If you want to pass string in len of 5 characters and want it to be double-null-termninated then create struct in size of 7 characters and fill it with the string. Last two characters will be null-s, because AutoIt zero-out allocated space anyway.

  • Like 2

♡♡♡

.

eMyvnE

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  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.