Click here to Skip to main content
15,908,901 members
Home / Discussions / C#
   

C#

 
GeneralRe: IPC Implementation for sending an integer from C++ exe to C# exe Pin
LokeshVarman23-Apr-21 0:06
LokeshVarman23-Apr-21 0:06 
i tried using namedpipes it just sends and receives but, My goal is to pass the elements from C++ and get that Elements at runtime in C# and process them. Like, Get n inputs in c++ and process that n elements in C#.
Eg: I am entering 5 inputs, say 1,2,3,4,5 in C++
where c# should get that inputs and process ( eg: inputelement + 1 )
the output would be 2,3,4,5,6.

C++ file

#include <windows.h>
#include <iostream>

HANDLE fileHandle;

int main()
{

fileHandle = CreateFileW(TEXT("\\\\.\\pipe\\pipesample"), GENERIC_READ | GENERIC_WRITE, FILE_SHARE_WRITE, NULL, OPEN_EXISTING, 0, NULL);

const char* msg = "hello from c++\r\n";
WriteFile(fileHandle, msg, strlen(msg), nullptr, NULL);
}


C# File


static void Main(string[] args)
{
var namedPipeServer = new NamedPipeServerStream("pipesample", PipeDirection.InOut, 1, PipeTransmissionMode.Byte);
var streamReader = new StreamReader(namedPipeServer);
namedPipeServer.WaitForConnection();



Console.WriteLine($"read from pipe client: {streamReader.ReadLine()}");
namedPipeServer.Dispose();
}

modified 23-Apr-21 6:19am.

QuestionHow to access incrementing ID number in SQL CE? Pin
Alex Dunlop22-Apr-21 5:49
Alex Dunlop22-Apr-21 5:49 
AnswerRe: How to access incrementing ID number in SQL CE? Pin
OriginalGriff22-Apr-21 6:08
mveOriginalGriff22-Apr-21 6:08 
AnswerRe: How to access incrementing ID number in SQL CE? Pin
Dave Kreskowiak22-Apr-21 6:23
mveDave Kreskowiak22-Apr-21 6:23 
AnswerRe: How to access incrementing ID number in SQL CE? Pin
SeanChupas22-Apr-21 6:43
SeanChupas22-Apr-21 6:43 
QuestionHow to preserve DataGridView row and text color when using column filters? Pin
Alex Dunlop21-Apr-21 4:49
Alex Dunlop21-Apr-21 4:49 
AnswerRe: How to preserve DataGridView row and text color when using column filters? Pin
Gerry Schmitz21-Apr-21 6:22
mveGerry Schmitz21-Apr-21 6:22 
GeneralRe: How to preserve DataGridView row and text color when using column filters? Pin
Alex Dunlop21-Apr-21 6:34
Alex Dunlop21-Apr-21 6:34 
GeneralRe: How to preserve DataGridView row and text color when using column filters? Pin
Gerry Schmitz21-Apr-21 6:45
mveGerry Schmitz21-Apr-21 6:45 
GeneralRe: How to preserve DataGridView row and text color when using column filters? Pin
Alex Dunlop21-Apr-21 16:53
Alex Dunlop21-Apr-21 16:53 
GeneralRe: How to preserve DataGridView row and text color when using column filters? Pin
Dave Kreskowiak21-Apr-21 17:27
mveDave Kreskowiak21-Apr-21 17:27 
Questionrecord list access Pin
Frank-Cziryek19-Apr-21 12:16
Frank-Cziryek19-Apr-21 12:16 
AnswerRe: record list access Pin
Dave Kreskowiak19-Apr-21 17:51
mveDave Kreskowiak19-Apr-21 17:51 
GeneralRe: record list access Pin
Frank-Cziryek19-Apr-21 19:43
Frank-Cziryek19-Apr-21 19:43 
GeneralRe: record list access Pin
Pete O'Hanlon20-Apr-21 20:55
mvePete O'Hanlon20-Apr-21 20:55 
Questionc# How to access data in an other object Pin
Frank-Cziryek19-Apr-21 2:29
Frank-Cziryek19-Apr-21 2:29 
AnswerRe: c# How to access data in an other object Pin
OriginalGriff19-Apr-21 2:58
mveOriginalGriff19-Apr-21 2:58 
Question.net passive mvp implementation w unity novice questions Pin
Romar Nicholas Mandap18-Apr-21 15:26
Romar Nicholas Mandap18-Apr-21 15:26 
QuestionRecordlist in object blocked by error Pin
Frank-Cziryek18-Apr-21 10:57
Frank-Cziryek18-Apr-21 10:57 
AnswerRe: Recordlist in object blocked by error Pin
Mycroft Holmes18-Apr-21 11:25
professionalMycroft Holmes18-Apr-21 11:25 
AnswerRe: Recordlist in object blocked by error Pin
Dave Kreskowiak18-Apr-21 11:34
mveDave Kreskowiak18-Apr-21 11:34 
AnswerRe: Recordlist in object blocked by error Pin
James Curran20-Apr-21 3:37
James Curran20-Apr-21 3:37 
QuestionWhy BeginGetContext of HTTPListener within Window's Service didn't react or trigger? Pin
razzqc16-Apr-21 5:19
razzqc16-Apr-21 5:19 
AnswerRe: Why BeginGetContext of HTTPListener within Window's Service didn't react or trigger? Pin
Gerry Schmitz16-Apr-21 8:37
mveGerry Schmitz16-Apr-21 8:37 
GeneralRe: Why BeginGetContext of HTTPListener within Window's Service didn't react or trigger? Pin
razzqc16-Apr-21 10:06
razzqc16-Apr-21 10:06 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.