Inno Setup Calling DLL with string as parameter

后端 未结 1 1096
感动是毒
感动是毒 2021-01-16 21:50

I\'m getting a exception when I attempt to use my DLL from the Inno Setup script.

I think the problem is this line in the dll code:

StreamReader sre         


        
相关标签:
1条回答
  • 2021-01-16 21:57

    I assume you are (correctly) using Unicode version of Inno Setup (in the latest Inno Setup 6, there's only the Unicode version)

    In the Unicode version of Inno Setup, string is a wide string. For the wide string, you need to use UnmanagedType.LPWStr, not UnmanagedType.LPStr.


    UnmanagedType.LPStr is an Ansi string – an equivalent of AnsiString in Inno Setup and string in the Ansi version of Inno Setup.


    Though as @mirtheil commented already, replacing a string in a text file can easily be implemented in Pascal Script: Replace a text in a file with Inno Setup.

    0 讨论(0)
提交回复
热议问题