Connecting Tech Pros Worldwide Forums | Help | Site Map

exporting unmanaged classes from a managed dll

nikola
Guest
 
Posts: n/a
#1: Nov 17 '05
is it possible to export (and, above all, import afterwards) an unmanaged class from a managed dll (compiled with the /clr switch. it would in fact probably result in a mixed mode dll)? it seems that member methods of any exported unmanaged class are compiled as static and global if the /clr switch is on. why? how to import such classes in antoher project? is there a workaround?

thanks...

---
Posted using Wimdows.net NntpNews Component -

Post Made from http://www.DotNetJunkies.com/newsgroups Our newsgroup engine supports Post Alerts, Ratings, and Searching.

Ronald Laeremans [MSFT]
Guest
 
Posts: n/a
#2: Nov 17 '05

re: exporting unmanaged classes from a managed dll


__declspec(dllexport) and __declspec(dllimport) or whatever other mechanism
you are already using in the situation where you are not compiling with
/clr.

Ronald Laeremans
Visual C+++ team

"nikola" <pejcicn@-NOSPAM-club-internet.fr> wrote in message
news:eZtMnczwEHA.2572@tk2msftngp13.phx.gbl...[color=blue]
> is it possible to export (and, above all, import afterwards) an unmanaged
> class from a managed dll (compiled with the /clr switch. it would in fact
> probably result in a mixed mode dll)? it seems that member methods of any
> exported unmanaged class are compiled as static and global if the /clr
> switch is on. why? how to import such classes in antoher project? is there
> a workaround?
>
> thanks...
>
> ---
> Posted using Wimdows.net NntpNews Component -
>
> Post Made from http://www.DotNetJunkies.com/newsgroups Our newsgroup
> engine supports Post Alerts, Ratings, and Searching.[/color]


nikola
Guest
 
Posts: n/a
#3: Nov 17 '05

re: exporting unmanaged classes from a managed dll



Thanks Ronald.
Still, it does not respond completely to my questions: "how?" & "i
there a workaround?".
There might be one: the exported unmanaged class should inheri
from an unmanaged pure virtual class (technically an interface), b
created by a managed class from the same (managed, compiled with /clr
library, and presented to the outside world as the mentioned unmanage
interface. It is maybe a little bit "heavy", but I haven't found an
other way.

Thanks again.
Regards,
n


-
nikol
-----------------------------------------------------------------------
Posted via http://www.codecomments.co
-----------------------------------------------------------------------

Ronald Laeremans [MSFT]
Guest
 
Posts: n/a
#4: Nov 17 '05

re: exporting unmanaged classes from a managed dll


I think I am still misunderstanding what you are trying to do. To export a
class (i.e. the definition of a class since that is the only thing you can
"export") is completely independent from whether you compile the DLL with
the /clr switch for all compilands, for no compilands or for a subset of all
compilands.

What you are referring to now seems to have something to do with an instance
of this class.

If you can provide a few lines of sample code, plus an illustration of what
broke in your scenario by virtue of specifying the /clr switch should make
sure I understand fully what you are trying to do.

Thanks!

Ronald

"nikola" <nikola.1fvehr@mail.codecomments.com> wrote in message
news:nikola.1fvehr@mail.codecomments.com...[color=blue]
>
> Thanks Ronald.
> Still, it does not respond completely to my questions: "how?" & "is
> there a workaround?".
> There might be one: the exported unmanaged class should inherit
> from an unmanaged pure virtual class (technically an interface), be
> created by a managed class from the same (managed, compiled with /clr)
> library, and presented to the outside world as the mentioned unmanaged
> interface. It is maybe a little bit "heavy", but I haven't found any
> other way.
>
> Thanks again.
> Regards,
> n.
>
>
>
> --
> nikola
> ------------------------------------------------------------------------
> Posted via http://www.codecomments.com
> ------------------------------------------------------------------------
>[/color]


Closed Thread