Click here to Skip to main content
15,883,843 members
Home / Discussions / C#
   

C#

 
GeneralRe: how to calculate in c# Pin
OriginalGriff9-Jun-18 2:40
mveOriginalGriff9-Jun-18 2:40 
QuestionConvert C++ code, with calls to ATL, into C# to quickly get com ports and their friendly names? Pin
arnold_w5-Jun-18 5:13
arnold_w5-Jun-18 5:13 
AnswerRe: Convert C++ code, with calls to ATL, into C# to quickly get com ports and their friendly names? Pin
Gerry Schmitz5-Jun-18 5:26
mveGerry Schmitz5-Jun-18 5:26 
GeneralRe: Convert C++ code, with calls to ATL, into C# to quickly get com ports and their friendly names? Pin
arnold_w5-Jun-18 7:15
arnold_w5-Jun-18 7:15 
GeneralRe: Convert C++ code, with calls to ATL, into C# to quickly get com ports and their friendly names? Pin
Gerry Schmitz5-Jun-18 7:51
mveGerry Schmitz5-Jun-18 7:51 
GeneralRe: Convert C++ code, with calls to ATL, into C# to quickly get com ports and their friendly names? Pin
arnold_w5-Jun-18 10:16
arnold_w5-Jun-18 10:16 
GeneralRe: Convert C++ code, with calls to ATL, into C# to quickly get com ports and their friendly names? Pin
Gerry Schmitz6-Jun-18 5:31
mveGerry Schmitz6-Jun-18 5:31 
AnswerRe: Convert C++ code, with calls to ATL, into C# to quickly get com ports and their friendly names? Pin
Jochen Arndt5-Jun-18 21:24
professionalJochen Arndt5-Jun-18 21:24 
The first part of the C++ code is enumerating the port names like SerialPort.GetPortNames() does. So there is no need to convert that. It is also not recommended to use the registry directly because it may change with the used Windows version while SerialPort.GetPortNames() is guaranteed to provide the correct information.

I don't know why your WMI query is so slow. Maybe you have used an improper search query (should be "SELECT * FROM Win32_SerialPort").

If you want to use the SetupApi with C# see Enumerate All COM Ports and Find Their Name and Description in C#.

Note also that you only need to update the list when a port has been added or removed. This can be handled by registering for device change events.
GeneralRe: Convert C++ code, with calls to ATL, into C# to quickly get com ports and their friendly names? Pin
arnold_w6-Jun-18 0:39
arnold_w6-Jun-18 0:39 
QuestionIN DESPERATE NEED OF IDEAS FOR NEW PROJECTS IN C# .NET Pin
KFC MANAGER 694-Jun-18 6:25
KFC MANAGER 694-Jun-18 6:25 
AnswerRe: IN DESPERATE NEED OF IDEAS FOR NEW PROJECTS IN C# .NET Pin
OriginalGriff4-Jun-18 6:34
mveOriginalGriff4-Jun-18 6:34 
Answerre: in desperate need of ideas for new projects in c# .net Pin
BillWoodruff4-Jun-18 6:48
professionalBillWoodruff4-Jun-18 6:48 
AnswerRe: IN DESPERATE NEED OF IDEAS FOR NEW PROJECTS IN C# .NET Pin
Gerry Schmitz5-Jun-18 5:18
mveGerry Schmitz5-Jun-18 5:18 
AnswerRe: IN DESPERATE NEED OF IDEAS FOR NEW PROJECTS IN C# .NET Pin
#realJSOP6-Jun-18 3:32
mve#realJSOP6-Jun-18 3:32 
QuestionJSON problem with backslash through REST service Pin
Member 90507314-Jun-18 5:30
Member 90507314-Jun-18 5:30 
AnswerRe: JSON problem with backslash through REST service Pin
Richard Deeming4-Jun-18 5:53
mveRichard Deeming4-Jun-18 5:53 
Questionsend sms from c# windows application Pin
Mohamed Fahad M2-Jun-18 21:53
Mohamed Fahad M2-Jun-18 21:53 
AnswerRe: send sms from c# windows application Pin
OriginalGriff2-Jun-18 22:14
mveOriginalGriff2-Jun-18 22:14 
QuestionC sharp code for Objective and subjective CBT Exam Pin
Member 1293991431-May-18 0:39
Member 1293991431-May-18 0:39 
AnswerRe: C sharp code for Objective and subjective CBT Exam Pin
Richard MacCutchan31-May-18 0:47
mveRichard MacCutchan31-May-18 0:47 
AnswerRe: C sharp code for Objective and subjective CBT Exam Pin
OriginalGriff31-May-18 2:24
mveOriginalGriff31-May-18 2:24 
AnswerRe: C sharp code for Objective and subjective CBT Exam Pin
Gerry Schmitz31-May-18 11:43
mveGerry Schmitz31-May-18 11:43 
QuestionSERIAL MONITOR IN C#, DataReceivedHandler problem Pin
Member 1368881630-May-18 22:19
Member 1368881630-May-18 22:19 
QuestionRe: SERIAL MONITOR IN C#, DataReceivedHandler problem Pin
Richard MacCutchan30-May-18 23:00
mveRichard MacCutchan30-May-18 23:00 
AnswerRe: SERIAL MONITOR IN C#, DataReceivedHandler problem Pin
Member 1368881630-May-18 23:29
Member 1368881630-May-18 23:29 

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.