[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Gideon

11/4/2003 5:27:00 PM

hi all.
i've got old c++ code that uses STL containers extensively.
i would eventually like to compile that code as a .NET assembly and later
use it from c#.
how much of a problem would that be, mixing managed and non-managed objects,
etc?
anyone has had experience with that?


2 Answers

Nicholas Paldino [.NET/C# MVP]

11/4/2003 6:01:00 PM

0

Gideon,

It depends on what you are trying to do. If you are looking to store
managed objects in STL containers, I don't know if you are going to have
much luck with that (it might be possible, but my instincts tell me no).

However, if you are using STL to store and perform operations on
structures that are internal to the classes, then creating a managed
assembly would be much easier.

It might actually be easier to compile your code into a COM in-process
server, and then access the items through interop. It all depends on the
design of your components.

Hope this helps.


--
- Nicholas Paldino [.NET/C# MVP]
- mvp@spam.guard.caspershouse.com


"Gideon" <gideon@dwl.co.uk.invalid> wrote in message
news:esMuUkvoDHA.2232@TK2MSFTNGP09.phx.gbl...
> hi all.
> i've got old c++ code that uses STL containers extensively.
> i would eventually like to compile that code as a .NET assembly and later
> use it from c#.
> how much of a problem would that be, mixing managed and non-managed
objects,
> etc?
> anyone has had experience with that?
>
>


Sebastien Lambla

11/10/2003 12:39:00 PM

0

Gideon,

you have two ways to go about that.
First way, used Managed C++ to provide a layer between managed code and your
native code, and compile your current code with /clr, you should be able to
get a .net assembly with mixed native / dotnet language usable from c#.
Second way, wait for the next release of Visual C++, which will have C++/CLI
integration and a .net friendly STL.

--
Sebastien Lambla
http://thetechnologist.is-a-geek...


"Gideon" <gideon@dwl.co.uk.invalid> a écrit dans le message de news:
esMuUkvoDHA.2232@TK2MSFTNGP09.phx.gbl...
> hi all.
> i've got old c++ code that uses STL containers extensively.
> i would eventually like to compile that code as a .NET assembly and later
> use it from c#.
> how much of a problem would that be, mixing managed and non-managed
objects,
> etc?
> anyone has had experience with that?
>
>