Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: C#4.0
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 24-Jan-13 17:26pm
Harikas591

1 solution

Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

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? Smile | :)
 
—SA
  Permalink  

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

  Print Answers RSS
0 OriginalGriff 6,649
1 Sergey Alexandrovich Kryukov 6,270
2 CPallini 5,190
3 George Jonsson 3,574
4 Gihan Liyanage 2,522


Advertise | Privacy | Mobile
Web01 | 2.8.140916.1 | Last Updated 24 Jan 2013
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100