Click here to Skip to main content
15,885,880 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Good morning everyone..

i'm working with c#4.0 And Brics cad.. to generate the drawings in bricscad. i got that ..but my problem is.. display the drawing in c# window form only with out opening the brics cad..
->i got that option in visual c++ , but i'm not understanding that code..
-> anybody please help me to solve this problem in c# coding


thankyou
Posted

1 solution

There are no such thing as a miracle: if you need some C++ code to be used, you will need to learn some C++, enough to understand it, or have someone to do this part of work.

You can re-use C++ code and bind it to your .NET application, but please don't think that you can do it without understanding. Maybe it will require deeper understanding of C++ than most of pure-C++ developers have, because many of them don't understand many internals, but all interop problems requires you to understand them.

You will need this knowledge to use P/Invoke.

If you need to learn P/Invoke, start from here:
http://en.wikipedia.org/wiki/P/Invoke[^],
http://msdn.microsoft.com/en-us/library/Aa712982[^].

This CodeProject can also be useful: Essential P/Invoke[^].

The hardness of solution will depend on complexity of C++ interfaces. It can range from very easy to most tricky.

One alternative to P/Invoke is to use C++/CLI mixed-mode (managed+unmanaged) project. This project could build a DLL required by the global hooks, but it can contain some managed wrapper CLI code, so, from the standpoint of your .NET application, you can use it as a regular .NET assembly, that is, reference it. Please see:
http://en.wikipedia.org/wiki/C%2B%2B/CLI[^],
http://www.ecma-international.org/publications/standards/Ecma-372.htm[^],
http://msdn.microsoft.com/en-us/library/xey702bw.aspx[^],
http://msdn.microsoft.com/en-us/library/3bstk3k5[^].

But note that this way will require you to learn both C++ and C++/CLI, yet another language. Ready to do some work? :-)

—SA
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900