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 / July 2006

Tip: Looking for answers? Try searching our database.

How to marshall a vector<string>

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
SONET - 24 Jul 2006 19:20 GMT
I'm a newbie to marshalling, what's the best way to call the following C++
function
from C#?

void foo(const vector<string> name) ?

I've tried doing a

[DllImport("test.dll"), CharSet = CharSet.Ansi)]
public static extern void foo(ArrayList name);

but that didn't work.
Dmytro Lapshyn [MVP] - 27 Jul 2006 12:45 GMT
Hi,

I don't think there's an easy way to marshal STL template classes. I see
people are having problems even with regular string arrays. You can probably
set out to write a custom marshaler, but it's a LOT of pain IMO. I'd stick
to regular string arrays when doing C++ <-> C# interop.

Signature

Regards,
Dmytro Lapshyn [MVP]
http://blogs.vbcity.com/DmytroL

> I'm a newbie to marshalling, what's the best way to call the following C++
> function
[quoted text clipped - 8 lines]
>
> but that didn't work.

Rate this thread:







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.