0

I am currently on a project where I need to take a video file name from a UI built with C#. After that, I need to pass the file name to my C++ application where the image processing algorithms will be done. After having the results from image processing algorithms, I need to pass the data to C# UI and print them on the screen. To summarize, the workflow will be like this:

1)Get filename from user(In .cs file)

2)Pass filename to CPP(In .cs file)

3)Get the filename(In .cpp file)

4)Do the image processing algorithms(In .cpp file)

5)Pass the video data to .cs(In.cpp file)

6)Get data from .cpp(In .cs file)

7)Print data(In .cs file)

I am not sure if this is doable, so if not, I'm open for any different ideas. Thanks.

1
  • Do you know what a process is? Your question makes me wonder, as you contradict yourself. The title says "CPP file in C# application" (in-process) whereas the second sentence says "C++ application" (so two processes). If you're still struggling with these basic concepts, the whole project may be too complex for you. Commented Nov 10, 2015 at 13:51

2 Answers 2

2

Call the C++ function from C# via PInvoke. You should read up on Pinvoke.

Sign up to request clarification or add additional context in comments.

1 Comment

Compile the C++ to a DLL first. For a more C#-like interface, wrap the functionality in a COM DLL (i. e. a COM interface in a COM object) and call that from C#.
1

You could use the Process class in C# to run a C++ compiler on the .cpp file, execute the compiled C++ program, and then read in the output of the C++ program. How to read the output of the C++ program depends on how the C++ program outputs the data.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.