Archive: System::Call and spaces in strings


System::Call and spaces in strings
  Hi all,

I am seeing something a bit weird. If I call my custom DLL with System::Call, any parameter of type text string ("t") which contains a space in the NSIS script, results in my DLL receiving an empty string... if I put no spaces it works fine and my DLL receives the right string.

So,

something like:

StrCpy$1 "A String With Spaces"

>System::Call 'MyDLL::MyFunc(t)i(r1).r0? c'
Results in MyFunc receiving a string buffer that starts with \0 i.e. an empty string.

If I do this instead:

StrCpy$1 "AStringWithoutSpaces"

>System::Call 'MyDLL::MyFunc(t)i(r1).r0? c'
... then it works.

Have you guys got any idea what's going on? Maybe I am doing something wrong...

Thanks!

Are you really passing it as r1 in your installer as well or do you use $1? The latter can cause what you're seeing as the string is inserted as is and must be properly quoted.