473,322 Members | 1,425 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,322 software developers and data experts.

Share question

Hi,

I defined the following linked list in pure C++ (an unmanaged dll):

struct Teststruct{
ULONG mydata;
std::vector<CString> mystrings;
};

std::list<Teststruct> mystructs;
Now, the problem is, that I have to share this data with a VB .net
application (the .net application calls a function in this C++ Dll) - but how
can I transfer this data to .net correctly? How to marshal this?

Thanks a lot for any help,

Peter
Nov 17 '05 #1
1 816
Peter Schmitz wrote:
Hi,

I defined the following linked list in pure C++ (an unmanaged dll):

struct Teststruct{
ULONG mydata;
std::vector<CString> mystrings;
};

std::list<Teststruct> mystructs;
Now, the problem is, that I have to share this data with a VB .net
application (the .net application calls a function in this C++ Dll) -
but how can I transfer this data to .net correctly? How to marshal
this?


Short answer, you can't, at least not directly. A type that use C++
standard library containers can be understood only by C++.

If you need to have the collection be pure unmanaged C++, then your best bet
would be to wrap this list in CLS-compliant managed class that exposes a
standard IEnumerable, ICollection and IList interfaces that can be consumed
by VB.NET or any other .NET language.

-cd
Nov 17 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

13
by: Joseph,,, | last post by:
I've seen data about database market share that shows IBM slightly ahead of Oracle. However, looking at the data with a finer granularity shows IBM with a huge lead in market share in the...
346
by: rkusenet | last post by:
http://biz.yahoo.com/rc/040526/tech_database_marketshare_1.html Interesting to see that database sales for windows is more than Unix.
68
by: rkusenet | last post by:
http://www.eweek.com/article2/0,1759,1820667,00.asp The database market grew by 10.3 percent in 2004, fueled largely by hunger for business intelligence and analytics, according to numbers...
7
by: Frank Rizzo | last post by:
Hello, I've asked this question in the languages.vb group, but got no response, so I'll try my luck here. My app needs to copy a file from a local folder to a network share. The network share...
16
by: ad | last post by:
I have write a clss, say DM.cs, and I save it in a independent directory like c:\MyUtil I have a new project in c:\proj1. When I use VS to add the existed c:\MyUtil\DM.cs to the new project,...
6
by: Tony Fonager | last post by:
I am currently developing a statistics system in ASP.NET, and need to share information about the customers websites, in this application. (I have simplified my code, to make my project easier to...
8
by: Tony Fonager | last post by:
I am currently developing a statistics system in ASP.NET, and need to share information about the customers websites, in this application. (I have simplified my code, to make my project easier to...
1
by: Shallotx | last post by:
I am working on a database imaging application. Links to the images are stored in the database and accessed via a shared network drive. This network share is mapped when the user logs on to...
3
by: Bob Peek | last post by:
I would like to share code between several web sites that exist as virtual directories under a single site. It appears that I have to create an app_code directory under each virtual root in order...
2
by: Thierry Kennes | last post by:
Hello, I'm trying to get the permissions on a shared folder using NetShareGetInfo api. I've got this function above that is supposed to give me the permission thanks to shi2_permission. The...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.