Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / .NET Framework / Interop / April 2004

Tip: Looking for answers? Try searching our database.

VB6 string arrays with NULLS truncating when returned to vb.net  

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Patrick Horn - 01 Apr 2004 18:40 GMT
I am calling a VB6 dll from a vb.net windows application that returns an array of strings.  My issue is it seems to truncate after a NULL character.  

For Example VB 6 is returning a string with the HEX value of 4E 31 00 00  01 00 20 20 20 20 20 00 00 00 20 20 20 31 32 30
But when it gets back to Vb.net all I have is 4E 31 or ??? N1???
Now I can return the same string as a return value of a function and I get it all.  

Please Help,
Patrick Horn

---
Mattias Sj?gren - 12 Apr 2004 12:52 GMT
Patrick,

>But when it gets back to Vb.net all I have is 4E 31 or “ N1â€?

Are you sure about that? How long is the string on the managed side
(as indicated by the .Length property)? The debugger may cut off the
content at the first null character even if the actual string is
longer.

Mattias

Signature

Mattias Sjögren [MVP]  mattias @ mvps.org
http://www.msjogren.net/dotnet/ | http://www.dotnetinterop.com
Please reply only to the newsgroup.

DotNetJunkies User - 13 Apr 2004 18:18 GMT
Yes, .Length returns 2.  The acutal data returned is N1, when posting to the message board some garbage got in the place of quote signs that where around the N1.

Thanks,
Pat

---

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.