Problem with Call DLL Function on Korean Windows
Posted: Tue Nov 21, 2006 4:31 am
Hello,
I enountered a strange error during install, which happens when using a Call DLL function command. This is related to the contents of the string parameter. I have a function in the DLL, which encodes a string passed as parameter, and it also returns the encoded string in the same parameter. Parameter is defined as "allocated string buffer" in IA command.
The encoding algorithm generates a string, which contains characters with codes from 32 to 255. After the function returns, installer will show following error:
Runtime error in setup script:
Line 1451: List index out of bounds (195)
And the installer closes after that.
I debugged the installer by inserting messagebox commands, to locate the point of the error. It happens while IA executes the "Call DLL Function" command. I further checked the DLL function itself, and there is no exception in the function. The error will occur, if the string parameter is assigned with particular string.
How to reproduce the problem:
- Use Korean Windows (I used Korean Windows 2000 Professional)
- Create a simple DLL with one function that accepts PCHAR parameter
- The function should just assign string 'cľ˙đ)1ĄÄˇ3ŕGâ' to the parameter
- Create a script, which will call this function
Have you experienced this before? The string returned might not be "valid" multibyte string for Korean code-page (since it can contain any sequence of characters from 32-255). If this is the cause for the error, what alternative do you recommend to encode a string and add its value to the "Write Registry" command?
Regards
Andrej
I enountered a strange error during install, which happens when using a Call DLL function command. This is related to the contents of the string parameter. I have a function in the DLL, which encodes a string passed as parameter, and it also returns the encoded string in the same parameter. Parameter is defined as "allocated string buffer" in IA command.
The encoding algorithm generates a string, which contains characters with codes from 32 to 255. After the function returns, installer will show following error:
Runtime error in setup script:
Line 1451: List index out of bounds (195)
And the installer closes after that.
I debugged the installer by inserting messagebox commands, to locate the point of the error. It happens while IA executes the "Call DLL Function" command. I further checked the DLL function itself, and there is no exception in the function. The error will occur, if the string parameter is assigned with particular string.
How to reproduce the problem:
- Use Korean Windows (I used Korean Windows 2000 Professional)
- Create a simple DLL with one function that accepts PCHAR parameter
- The function should just assign string 'cľ˙đ)1ĄÄˇ3ŕGâ' to the parameter
- Create a script, which will call this function
Have you experienced this before? The string returned might not be "valid" multibyte string for Korean code-page (since it can contain any sequence of characters from 32-255). If this is the cause for the error, what alternative do you recommend to encode a string and add its value to the "Write Registry" command?
Regards
Andrej