interop question

S

S Wheeler

This may have been previously addressed, if so sorry...

I am trying to create a serialization library that will be used from
unmanaged vc++. I have working vc++ managed code that serializes and
de-serializes objects to/from XML. But, I want to use this from an unmanaged
vc app that I am writing. Several questions: is it possible to create
managed static library that can then be linked to my unmanaged app at build
time; or must I use a dll if I want a library. I understand that if I create
a .net class library that is a dll and will then require COM to use from my
unmanaged app ??

Or, would it be better to try and co-mingle the unmanaged and managed code ?
I want to try to keep the boundaries between managed and unmanaged as
distinct as possible; the core of my app needs to be somewhat portable and I
am really just looking for an easy way to do object serializations which
seems to be .net framework serialization, but if using this makes the core
of my app non-portable then that is not too good..

Thanks for your advice...
 
B

Bruno van Dooren

S Wheeler said:
This may have been previously addressed, if so sorry...

I am trying to create a serialization library that will be used from
unmanaged vc++. I have working vc++ managed code that serializes and
de-serializes objects to/from XML. But, I want to use this from an
unmanaged vc app that I am writing. Several questions: is it possible to
create managed static library that can then be linked to my unmanaged app
at build time; or must I use a dll if I want a library. I understand that
if I create a .net class library that is a dll and will then require COM
to use from my unmanaged app ??
If you build a .NET class library, you can register it using regasm. that
way, you'll be able to use it as a COM object in other languages.
this insures greates portability because not all languages support static
linking (LabVIEW to name one), but nearly all languages support either COM
or .NET.
This also resolves any runtime library incompatibilities that might arise if
your unmanaged app uses a different compiler.
This solution is most portable, and makes a clear distinction between
managed and unmanaged code.

Or, would it be better to try and co-mingle the unmanaged and managed code
? I want to try to keep the boundaries between managed and unmanaged as
distinct as possible; the core of my app needs to be somewhat portable and
I am really just looking for an easy way to do object serializations which
seems to be .net framework serialization, but if using this makes the core
of my app non-portable then that is not too good..
This is possible, but in the interest of portability (and simplicity), using
a class library is the better solution for the reasons mentioned above.

kind regards,
Bruno.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top