I have a exe in c++ where i have created CreateIPCQueue function and i am creating another exe in c# where i want to use this method.then how i should proceed for this.pls help me
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Powershell (.NET) and Piping
You might be able to make use of Windows Powershell to pipe between classic program output and cmdlets built in .NET. Because it pipes objects instead of raw text between programs,
I’m unsure it’s compatibility with piping classic strings, although you might find a unique solution here so I’ll post it now and update later if a more specific variation is found…Update:
In Powershell, I tested and found that classic text output can be piped into .NET cmdlets. For example, I took the standard text output from the C# compiler help screen and piped it into the ForEach-Object construct – in this case each object is a .NET String because the classic output is represented textually.
It produced the following output that proves the concept – indeed it prepended the phrase "LINE: " to each line of text.
Any other .exe that produces text output can be used in this example.
Next Steps
Based on that proof of concept showing classic text and .NET objects interoperating through Powershell piping, the next step might be expose your .NET program as a cmdlet (to substitute in place of the For-Each construct in the example). I looked for a useful article about exposing your existing .NET code as a cmdlet and found: Creating a Windows PowerShell CmdLet using the Visual Studio Windows PowerShell Templates
Basically you can expose a piece of your existing .NET logic as a cmdlet and then rely on the natural piping ability inherent in Powershell. The bonus is you’ll be compatible with Powershell and other programs can reap the benefits of using your cmdlet.
Update 2
Additional Resources