how to exchange values between severaly projects types ?

Posted on 2004-04-23
Last Modified: 2010-04-17
Hi every body ; i created a new soluation and add a new Console project using vc  like this :

class r
    int x,y;

int main()

then i created anew windows application project using  c# in the same soluation  ; my question is how to create instance of this class created in vc project to use them in c# application ; thanks
Question by:raed2003

Expert Comment

ID: 10905320
you will have to include the .cpp file of the class r into your new project.

Expert Comment

ID: 10906353
You will either need to declare the new class in the new project's main .cs file and refer to it by [Namespace].[Class_name].  Or you could simply include the .cs file from your other project.  Be sure to comment out the main function as you can't have multiple entry points in one application.

Make sure you reference the namespace if they are different.

Author Comment

ID: 10907310
how to include cpp file in c# windows application !!! ; also  i tried namespace.classname but it doesn,t work  ....

Expert Comment

ID: 10914157
i think you have to compile the vc project and then add a reference to it in the other project

Accepted Solution

games0802 earned 100 total points
ID: 10914746
You cannot directly add c++ files to a C# application (that I am aware of).  Instead, you can make a dll from your c++ files and then call the dll in C#.  If you need more details on the process of either making the dll or calling it in C#, just say the word.

Featured Post

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
linearIn  challenge 23 65
Batch file output 20 77
c# combobox autocomplete behavior 6 92
Fibonacci challenge 11 82
Purpose To explain how to place a textual stamp on a PDF document.  This is commonly referred to as an annotation, or possibly a watermark, but a watermark is generally different in that it is somewhat translucent.  Watermark’s may be text or graph…
RIA (Rich Internet Application) tools are interactive internet applications which have many of the characteristics of desktop applications. The RIA tools typically deliver output either by the way of a site-specific browser or via browser plug-in. T…
An introduction to basic programming syntax in Java by creating a simple program. Viewers can follow the tutorial as they create their first class in Java. Definitions and explanations about each element are given to help prepare viewers for future …
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …

707 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now