|
go to the below url i have tried it and it works fine good luck.
http://www.codeproject.com/csharp/unmanage.asp
|
|
|
|
|
Thank you, but I'm still looking for a proper explanation of how to write wrapper classes in managed C++ for my unmanaged C++ classes. Sorry I didn't tell in the first message.
|
|
|
|
|
moist wrote:
how to write wrapper classes in managed C++ for my unmanaged C++ classes.
Look here[^]
|
|
|
|
|
I have allready seen the so called "Migration Guide" that consists of two parts, which the first one I find completly useless. I am able to write a wrapper class, but still I wonder how you can create three different projects in a solution, one for your unmanaged c++ class that you want to wrap, a second for your managed c++ wrapper class and third a c# project that uses the wrapper class. How to do that is not included in The Migration Guide.
|
|
|
|
|
You mean to tell me that all this is over knowing how to
add projects to a solution?
|
|
|
|
|
Yes.
Let's say that you have some nice C++ classes you implemented some while ago and that you want to use them in your C# project. I can't figure out how to create a new solution from scratch and then create three different projects; one unmanaged for your old C++ classes, a managed C++ project for your wrapper and a third for your C#. I guess the main problem I have is to choose the proper settings for the unmanaged project since there are no such thing as a unmanaged C++ class library. I beleived that this was a trvial task, but I still don't know how to get it working.
Thanks for the replies.
|
|
|
|
|
1. Wrap your unmanaged C/C++ code in a static library.
2. Make a Managed C++ DLL project, with all the Managed C++ wrapper classes. Link with the static library created in 1.
3. Use the DLL created in step 2, in a C# project of your choice.
It will work 100%.
|
|
|
|
|
Hi there,
I am wondering where i can learn Managed C++.NET. I had check out the msdn C++.NET specs. Very hard to learn.
I had no money to buy books.
And there are far too little tutorials on this area in google.
Only see some like Hello World, Sortting algorithm (mostly consoles).
I had no much knowledge in c++ so i can't be looking at application and learn it.
Any help please?
Thanks.
Regards,
Chua Wen Ching :p
|
|
|
|
|
|
Thanks.
I saw the articles are rated less than 4.. is it risky to read those?
Regards,
Chua Wen Ching :p
|
|
|
|
|
|
I actually disagree that this book is a worthy purchase. As I mentioned in a previous post, I personally know Richard and he is very good. However, this book is not up to his usually high standards.
Cheers,
Tom Archer
Inside C#, Extending MFC Applications with the .NET Framework
It's better to listen to others than to speak, because I already know what I'm going to say anyway. - Jörgen Sigvardsson
|
|
|
|
|
When looking at the reviews on a Web public site such CodeProject, you have to realize that there are no prerequisites required for someone to post a rating. Therefore, while some of the reviews (both good and bad) are valid, there are many times when a person posting the rating might not be the best person to quantify the value of a given ariticle and in many cases, bad ratings can be directly attributed to personal issues between the rater and the article.
If you truly want to determine if an article is worth reading, I would first look at the remarks at the bottom of the article. Are there a lot of unanswered questions about bugs? Are a lot of errors being pointed out that are not being corrected in the article? In the case of Nish's articles, I think you'll find that the overwhelming majority of articles are top-notch and the few that had any problems were quickly corrected so that they're also top-notch now.
Cheers,
Tom Archer
Inside C#, Extending MFC Applications with the .NET Framework
It's better to listen to others than to speak, because I already know what I'm going to say anyway. - Jörgen Sigvardsson
|
|
|
|
|
Hello.
I'm a beginner in Managed C++. I have created a Windows Forms application. The wizard has generated a project with a app.rc resource file.
I have added to this rc file a string to the String Table and a Icon ( like in MFC ).
Now, my problem it's that I can't read the string or the icon from the resource file.
I have tryd to use the resource Manager but I'm not able to make it work.
Please, can anyone help me ?
|
|
|
|
|
hello can any body tell me how i can stop my c++ multithreaded console aplication from auto exiting once main() has been executed,i need to keep my thread working and stop the proggie exiting.or how could i make my app stay open until the thread get's out of the loop?
thanx
chris
|
|
|
|
|
Have the main wait for the threads to finish. When you created the threads you are given a handle to each thread. Just do a wait multiple for all on the thread handles.
Tim Smith
I'm going to patent thought. I have yet to see any prior art.
|
|
|
|
|
If you are using Managed Threads --> check IsBackground thread property: may help.
"...Ability to type is not enough to become a Programmer. Unless you type in VB. But then again you have to type really fast..."
Me
|
|
|
|
|
Hi everyone
If i type:
System::Windows::Forms::Button* btn = new System::Windows::Forms::Button();
btn->
in a generic C++ class within a C++.NET application i get no intellisense options although if i type it out, the code compiles and works.
Is this a bug?
|
|
|
|
|
I am trying to write a small program to send data to a serial port and then read it back. I need to set this up as a class. I am very new with c++ .net and was hoping someone might have some suggestions or examples. Most of the programs i have seen are more complicated than i am looking for.
|
|
|
|
|
|
Hi everybody.
Is there a way to use .NET Remoting with Visual C++ .Net?
In positive case, how to build the interfaces like they're
built in C#?
Thanks,
Moises.
|
|
|
|
|
|
|
Hello.
I'm writing a managed C++ application, and I have created a __gc class that acts as a Cache between the Database and my application.
I want that this caché can be accesed from anywhere in the application.
So I tried to do this.
In stdafx.h
extern CCache* g_pCache;
In stdafx.cpp
CCache* g_pCache = new CCache ();
and I have the following error message:
error C3145: 'g_pCache' : cannot declare a global or static managed type object or a __gc pointer
Its possible to define a variable of a managed type that its global ? How ?
Thanks.
|
|
|
|
|