473,385 Members | 1,356 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,385 software developers and data experts.

exporting unmanaged classes from a managed dll

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.
Nov 17 '05 #1
3 1748
__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:eZ**************@tk2msftngp13.phx.gbl...
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.

Nov 17 '05 #2

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
-----------------------------------------------------------------------

Nov 17 '05 #3
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" <ni***********@mail.codecomments.com> wrote in message
news:ni***********@mail.codecomments.com...

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
------------------------------------------------------------------------

Nov 17 '05 #4

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

Similar topics

1
by: Bob Rock | last post by:
Hello, in the last few days I've made my first few attempts at creating mixed C++ managed-unmanaged assemblies and looking aftwerwards with ILDASM at what is visible in those assemblies from a...
6
by: Stijn | last post by:
Hi there, I have the following problem. At the moment I am creating an application that interfaces with several hardware modules via USB. Each of these devices has its own functionality and I...
0
by: Niall | last post by:
I'm attempting to put a C# front end on my unmanaged C++ ray tracer code. It's still in experimental stage, as I have never done anything with exporting types from an unmanaged dll through to a...
2
by: joye | last post by:
Hello, My question is how to use C# to call the existing libraries containing unmanaged C++ classes directly, but not use C# or managed C++ wrappers unmanaged C++ classes? Does anyone know how...
2
by: Bob Rock | last post by:
Hello, in the last few days I've made my first few attempts at creating mixed C++ managed-unmanaged assemblies and looking afterwards with ILDASM at what is visible in those assemblies from a...
7
by: Gustavo L. Fabro | last post by:
Greetings! Some classes that once compiled without problems on VS 2003 have now problems on VS 2005 Beta 1. I'm talking about a __nogc class that is exported with __declspec(dllexport). The...
9
by: Amit Dedhia | last post by:
Hi All I have a VC++ 2005 MFC application with all classes defined as unmanaged classes. I want to write my application data in xml format. Since ADO.NET has buit in functions available for...
2
by: Jon Slaughter | last post by:
How difficult is it for one to integrate unmanaged C++ into C#? I know for functions one can use DLLimport but how does one go about doing it for classes? Do I have to completely reimplement the...
1
by: Saad | last post by:
Hi, I have a MC++dll, whose functions i want to use in unmanaged c++. I read that one of the ways to use the managed functions in unmanaged world is by exposing the managed api as flat api. I...
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: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.