Click here to Skip to main content
15,886,137 members
Home / Discussions / C#
   

C#

 
AnswerRe: how can i create a moveable object Pin
Gerry Schmitz29-Oct-22 7:05
mveGerry Schmitz29-Oct-22 7:05 
QuestionC++ Pin
Mathooanyane Khoeli28-Oct-22 10:06
Mathooanyane Khoeli28-Oct-22 10:06 
AnswerRe: C++ Pin
Dave Kreskowiak28-Oct-22 11:47
mveDave Kreskowiak28-Oct-22 11:47 
AnswerRe: C++ Pin
OriginalGriff28-Oct-22 18:49
mveOriginalGriff28-Oct-22 18:49 
QuestionC++ Pin
Mathooanyane Khoeli28-Oct-22 10:02
Mathooanyane Khoeli28-Oct-22 10:02 
AnswerRe: C++ Pin
Dave Kreskowiak28-Oct-22 11:46
mveDave Kreskowiak28-Oct-22 11:46 
AnswerRe: C++ Pin
OriginalGriff28-Oct-22 18:47
mveOriginalGriff28-Oct-22 18:47 
QuestionC# vs C++ process standard out redirection differences Pin
Member 1490333523-Oct-22 7:52
Member 1490333523-Oct-22 7:52 
I am trying to run a process which is invoked from either a C# or C++ program. The process has its standard output and standard input redirected to the program which invoked it. In this way, the calling program can control the child process programmatically. (The child process happens to be the MAME arcade emulator so I can run commands through the Lua console.)
Things look about how I would expect them from the C++ program. I can read the output from the child process with the PeekNamedPipe() function. The characters are identical to what I see when I just run the process from the command line and observe the console.

But when I run a similar C# program, the console output is not quite right. There are at least two issues. Using the Streamread read() method (the child process's stdout is directed to a stream), there are always about 30 "junk" characters that are read back before I see the characters I expect. Additionally, it appears that the characters at 16-bits (not 8-bit chars). (I can live with this, and I think I can convert them into 8-bit chars if I need to.)

I have a strong suspicion that these characters are actually some low-level "under the hood" info about the string itself, like some kind of reflection data - maybe details about how it's encoded, length, etc.
I just can't seems to figure out how to cleanly extract the "real" data out of the stream using C#.

Can anyone make sense of this and give a hint of how I can get ASCII character data from the child process in C#?

Thanks!
AnswerRe: C# vs C++ process standard out redirection differences Pin
OriginalGriff23-Oct-22 8:16
mveOriginalGriff23-Oct-22 8:16 
QuestionLoading a Data Table form a DataGrid view but still no joy. Pin
Ozzie Mozzie22-Oct-22 23:59
Ozzie Mozzie22-Oct-22 23:59 
AnswerRe: Loading a Data Table form a DataGrid view but still no joy. Pin
OriginalGriff23-Oct-22 0:51
mveOriginalGriff23-Oct-22 0:51 
GeneralRe: Loading a Data Table form a DataGrid view but still no joy. Pin
Ozzie Mozzie23-Oct-22 1:19
Ozzie Mozzie23-Oct-22 1:19 
GeneralRe: Loading a Data Table form a DataGrid view but still no joy. Pin
OriginalGriff23-Oct-22 1:46
mveOriginalGriff23-Oct-22 1:46 
GeneralRe: Loading a Data Table form a DataGrid view but still no joy. Pin
Ozzie Mozzie23-Oct-22 2:05
Ozzie Mozzie23-Oct-22 2:05 
GeneralRe: Loading a Data Table form a DataGrid view but still no joy. Pin
OriginalGriff23-Oct-22 2:37
mveOriginalGriff23-Oct-22 2:37 
GeneralRe: Loading a Data Table form a DataGrid view but still no joy. Pin
Ozzie Mozzie23-Oct-22 14:36
Ozzie Mozzie23-Oct-22 14:36 
GeneralRe: Loading a Data Table form a DataGrid view but still no joy. Pin
Ozzie Mozzie23-Oct-22 16:03
Ozzie Mozzie23-Oct-22 16:03 
GeneralRe: Loading a Data Table form a DataGrid view but still no joy. Pin
OriginalGriff23-Oct-22 21:35
mveOriginalGriff23-Oct-22 21:35 
QuestionC# Save DataGrid Only MultiSelected Rows to File Pin
CodaNV22-Oct-22 17:03
CodaNV22-Oct-22 17:03 
AnswerRe: C# Save DataGrid Only MultiSelected Rows to File Pin
Dave Kreskowiak22-Oct-22 17:50
mveDave Kreskowiak22-Oct-22 17:50 
GeneralRe: C# Save DataGrid Only MultiSelected Rows to File Pin
CodaNV22-Oct-22 18:11
CodaNV22-Oct-22 18:11 
GeneralRe: C# Save DataGrid Only MultiSelected Rows to File Pin
Dave Kreskowiak22-Oct-22 18:24
mveDave Kreskowiak22-Oct-22 18:24 
GeneralRe: C# Save DataGrid Only MultiSelected Rows to File Pin
CodaNV22-Oct-22 18:47
CodaNV22-Oct-22 18:47 
QuestionArduino canot control computer. Pin
Member 1549382322-Oct-22 10:38
Member 1549382322-Oct-22 10:38 
AnswerRe: Arduino canot control computer. Pin
OriginalGriff22-Oct-22 10:53
mveOriginalGriff22-Oct-22 10:53 

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.