473,237 Members | 1,174 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,237 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 4706
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: jianzs | last post by:
Introduction Cloud-native applications are conventionally identified as those designed and nurtured on cloud infrastructure. Such applications, rooted in cloud technologies, skillfully benefit from...
0
by: abbasky | last post by:
### Vandf component communication method one: data sharing ​ Vandf components can achieve data exchange through data sharing, state sharing, events, and other methods. Vandf's data exchange method...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 7 Feb 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:30 (7.30PM). In this month's session, the creator of the excellent VBE...
0
by: fareedcanada | last post by:
Hello I am trying to split number on their count. suppose i have 121314151617 (12cnt) then number should be split like 12,13,14,15,16,17 and if 11314151617 (11cnt) then should be split like...
0
Git
by: egorbl4 | last post by:
Скачал я git, хотел начать настройку, а там вылезло вот это Что это? Что мне с этим делать? ...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: Aftab Ahmad | last post by:
Hello Experts! I have written a code in MS Access for a cmd called "WhatsApp Message" to open WhatsApp using that very code but the problem is that it gives a popup message everytime I clicked on...
0
by: Aftab Ahmad | last post by:
So, I have written a code for a cmd called "Send WhatsApp Message" to open and send WhatsApp messaage. The code is given below. Dim IE As Object Set IE =...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...

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.