Note that there are some explanatory texts on larger screens.

plurals
  1. POWhat to do when dll return a string not correctly terminated
    text
    copied!<p>I have an third part dll that have a function that returns a string. When I call the function I got for example "123456" back. At least it seams like that, but when i do mystring.length it does not return any length. If I set the text property of a label it shows "123456".</p> <p>When I have the string I got from the dll I send it to a webservice function:</p> <pre><code>rem call dll and get string dim mystring as string=mydll.getstring() rem Send it to the webservice webservice.SaveString(mystring) </code></pre> <p>The webservice crashes with an webexeption ("protocoll error") when I send in the string I got from the dll. If I instead send it like this:</p> <pre><code>rem call dll and get string dim mystring as string=mydll.getstring() rem Send it to the webservice dim FixedString as string = mid(mystring,1,6) webservice.SaveString(mystring) </code></pre> <p>Then it works and everything is fine. That leads me to think that the string I got from the DLL is in someway not terminated correct. And I dont know how to fix it from vb.net (I cant change the DLL) and I dont know in beforehand how long the string will be.</p> <p>The dll does only work on site when specific hardware is connected so I can't sit at the office trying to fix this in dev-environment. So I would like to have some possibly solutions to this before I go to the customer again.</p> <p><strong>Edit 1:</strong> I tried to just do a loop that looped from 1 to 100 (because I dont know the real length) and tried to copy all characters that &lt;>"" to a new variable but it didnt work. I didnt try other variants because the day was over and I had to leave the customer site.</p> <p><strong>Edit 2:</strong><br> The DLL Im talking to is made in VB6. That DLL is talking to other DLLs that is made in C++ (I think).</p> <p>My program &lt; - > vb6-DLL &lt;-> c++-DLL &lt;-> hardware</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload