Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 162213
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T11:21:03+00:00 2026-05-11T11:21:03+00:00

I have an third part dll that have a function that returns a string.

  • 0

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’.

When I have the string I got from the dll I send it to a webservice function:

rem call dll and get string dim mystring as string=mydll.getstring()  rem Send it to the webservice webservice.SaveString(mystring)  

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:

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)  

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.

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.

Edit 1: 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 <>” 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.

Edit 2:
The DLL Im talking to is made in VB6. That DLL is talking to other DLLs that is made in C++ (I think).

My program < – > vb6-DLL <-> c++-DLL <-> hardware

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. 2026-05-11T11:21:04+00:00Added an answer on May 11, 2026 at 11:21 am

    Check out the MSDN documentation about strings, especially the part about:

    In the .NET Framework, a String object can include embedded nulls, which count as a part of the string’s length. However, in some languages, such as C and C++, a null character indicates the end of a string, is not considered a part of the string, and is not counted as part of the string’s length. This means that the following common assumptions that C and C++ programmers or that libraries written in C or C++ might make about strings are not necessarily valid when applied to String objects:

    The value returned by the strlen or wcslen functions does not necessarily equal String.Length.

    The string created by the strcpy_s or wcscpy_s functions is not necessarily identical to the string created by the String.Copy method.

    You should ensure that native C and C++ code that instantiates String objects, and code that is passed String objects through platform invoke, do not assume that an embedded null marks the end of the string.

    Instead I’d do something like:

    rem call dll and get string dim mystring as string=string.intern(mydll.getstring()) 

    (Note: I haven’t tried this)

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 75k
  • Answers 75k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • added an answer This question has been formulated very loosely and this is… May 11, 2026 at 2:49 pm
  • added an answer iTunes registers itself as a protocol handler for custom itms://… May 11, 2026 at 2:49 pm
  • added an answer An HTA obviously cannot be target of a shell drop… May 11, 2026 at 2:49 pm

Related Questions

I have an ASP.NET 2.0 application (installed on IIS 6.0 from an MSI) which
I have an application that sends messages to an external web service. I build
When designing tables, I've developed a habit of having one column that is unique
Brief description of requirements (Lots of good answers here, thanks to all, I'll update

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.