473,326 Members | 2,048 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,326 software developers and data experts.

using managed dll in c# project

Hi,

DA PROBLEM:

Once I wrote a c++ dll. I wanted to use that dll in my new c# project,
so I compiled it with the CLR option. The compilation was ok.
Like I said, I wanted to use the dll (with several classes in it), in
my c# project. I added the reference to my c# project. But still I
can't use the classes. Do I need to use Dllimport?.
When I look at the object browser, i can see all the classes but there
are no methods.

DA SOLUTION

don't know, thats why I'm here...

Thank U
Nov 17 '05 #1
2 4711
Steven,

What is known as a class in standard C++ is known as a __nogc class in
Managed Extensions. (Managed Extensions is C++ with the CLR option.)
Managed Extensions supports two kinds of classes: __nogc classes and
__gc classes. You can only use __gc classes in a C# project.

You'll have to read up on Managed Extensions in the MSDN Library. The
documentation explains how you can create __gc classes based on your
existing __nogc classes.

Good luck!

Bart Jacobs

Steven Cool wrote:
Hi,

DA PROBLEM:

Once I wrote a c++ dll. I wanted to use that dll in my new c# project,
so I compiled it with the CLR option. The compilation was ok.
Like I said, I wanted to use the dll (with several classes in it), in
my c# project. I added the reference to my c# project. But still I
can't use the classes. Do I need to use Dllimport?.
When I look at the object browser, i can see all the classes but there
are no methods.

DA SOLUTION

don't know, thats why I'm here...

Thank U


Nov 17 '05 #2
Dank u Bart voor de informatie

mvg

Steven

Bart Jacobs <ba*********@student.kuleuven.ac.be> wrote in message news:<10***************@seven.kulnet.kuleuven.ac.b e>...
Steven,

What is known as a class in standard C++ is known as a __nogc class in
Managed Extensions. (Managed Extensions is C++ with the CLR option.)
Managed Extensions supports two kinds of classes: __nogc classes and
__gc classes. You can only use __gc classes in a C# project.

You'll have to read up on Managed Extensions in the MSDN Library. The
documentation explains how you can create __gc classes based on your
existing __nogc classes.

Good luck!

Bart Jacobs

Steven Cool wrote:
Hi,

DA PROBLEM:

Once I wrote a c++ dll. I wanted to use that dll in my new c# project,
so I compiled it with the CLR option. The compilation was ok.
Like I said, I wanted to use the dll (with several classes in it), in
my c# project. I added the reference to my c# project. But still I
can't use the classes. Do I need to use Dllimport?.
When I look at the object browser, i can see all the classes but there
are no methods.

DA SOLUTION

don't know, thats why I'm here...

Thank U

Nov 17 '05 #3

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

Similar topics

121
by: typingcat | last post by:
First of all, I'm an Asian and I need to input Japanese, Korean and so on. I've tried many PHP IDEs today, but almost non of them supported Unicode (UTF-8) file. I've found that the only Unicode...
2
by: Jon | last post by:
I am creating a mix managed/unmanaged C++ project. Since some of the *.cpp's do not use managed extension, the project option of has to be set to 'no'. ( Note that using '#pragma unmanaged'...
3
by: Ben Terry | last post by:
I have imported a legacy C++ project into a VisualStudio.NET 2003 solution. I have some new C# projects in the solution as well. I am using the managed extensions in my C++ project so that I can...
7
by: Kristof Thys via .NET 247 | last post by:
Post a new message to microsoft.public.dotnet.languages.vc http://www.dotnet247.com/247reference/default.aspx Hello, I've been struggling for weeks with this problem, I hope I find some...
5
by: Andrew | last post by:
I want to use a managed c++ class from an unmanaged class. Here is my code: // *** Unmanaged Code // .h file class UnmanagedClass { public: // Other stuff here
1
by: Steve Marsden | last post by:
Hi All the information I had read suggested that if you had an existing C project that you wished to change to managed code all you had to do was use the /clr switch and then over time you could...
0
by: Gustavo L. Fabro | last post by:
Greetings! I found myself with a LNK2020 linking problem using VS.NET 2003 under a situation that I was able to replicate in a small project. I found one workaround for the problem too, but...
1
by: s_schutte | last post by:
Here's my situation. I have an unmanaged C++ project that I am using to interface with the Lotus Notes C API. I then have a managed C++ project in the same solution that functions as a "C++...
2
by: Kevin Sun | last post by:
I have a problem about non-managed code and managed code.Could you like to give me some suggestion? In a non-managed MFC application project, I add some managed codes and these files are setted...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
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...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
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...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

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.