Passing a string from VB.NET to C++ DLL

I need to pass a string from VB.NET to a C++ DLL.
My limitation is that I need to be able to manipulate the string in c++, I need all the functionalty I get from std::string.
I tryed casting to std::string without much luck.
I need the VB.NET type, C++ type and any other casts or code needed to use them.
Who is Participating?
PAQed with points refunded (150)

Community Support Moderator
I think you may do this using safearrays.

Following may be helpful :

Handling VB strings (as part of an array of UDT)

Interfacing VB and C++

EladlaAuthor Commented:
I have seen the flipcode site....not much help to me.
Thanks anyway.
Any other ideas?
Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Alternatively have a look at this post which suggesting to use StringBuilder : <====


EladlaAuthor Commented:
I need something similar to the find function of std:string
or it`s useless to me.
I`ll check out your other link.
EladlaAuthor Commented:
I checked out the would work, but since I`m using unmanaged code and would rather
stick to stdlib C++, I don`t want to import .net namespaces and such.
EladlaAuthor Commented:
I have already found this:

And it looks like it`s working. If anyone has better ideas, mainly ones that do not require
com or atl type references...please let me know.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.