title: Can't get value in dll function when pass string from inno to dll?
body: <p>I want to pass a string to my dll funcfion, but the function cannot get the value.
  first I get the string from cmd line using GetMyParam function. it's right.then, i pass
  the value to my dll using innotest function.</p>
  
  <pre><code>function innotest(PName:string):Integer;
  external 'innotest@E:\client\branch\maintain\1.4\bin\sdostate-debug\update.dll stdcall setuponly';
  
  function GetMyParam(PName:string):string;
  var
    CmdLine : String;
    CmdLineLen : Integer;
    i : Integer;
  begin
      Result := '';
      CmdLineLen:=ParamCount();
      for i:=0 to CmdLineLen do
      begin
      CmdLine:=ParamStr(i);
      if CmdLine = PName then
        begin
            CmdLine:=ParamStr(i+1);
            Result := CmdLine;
            Exit;
        end;
      end;
  end;
  
  procedure CurStepChanged(CurStep: TSetupStep); 
  var 
  res: String;
  
  begin
  if (CurStep = ssPostInstall) and (Pos('setup', WizardSelectedTasks(false)) &gt; 0)then
  begin
  res := GetMyParam('-myParam');
  MsgBox(res, mbInformation, mb_Ok);
  innotest(res);
  end;
  end;
  </code></pre>
  
  <p>Msgbox has the res value.
  here is my dll code: the string's length is 1.</p>
  
  <pre><code>DWORD Update::innotest(string str)
  {
      LPCWSTR s = StringHelper::ANSIToUnicode(str).c_str();
      MessageBox(0,s,0,0);
      return 0;
  }
  </code></pre>