Click here to Skip to main content
15,895,084 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: CMenu with Bitmap icon Pin
Drakesal2-Sep-14 3:01
Drakesal2-Sep-14 3:01 
GeneralRe: CMenu with Bitmap icon Pin
Richard MacCutchan2-Sep-14 4:00
mveRichard MacCutchan2-Sep-14 4:00 
GeneralRe: CMenu with Bitmap icon Pin
_Flaviu2-Sep-14 4:58
_Flaviu2-Sep-14 4:58 
AnswerRe: CMenu with Bitmap icon Pin
Maximilien2-Sep-14 5:31
Maximilien2-Sep-14 5:31 
GeneralRe: CMenu with Bitmap icon Pin
Drakesal2-Sep-14 6:59
Drakesal2-Sep-14 6:59 
GeneralRe: CMenu with Bitmap icon Pin
Maximilien2-Sep-14 7:56
Maximilien2-Sep-14 7:56 
GeneralRe: CMenu with Bitmap icon Pin
Drakesal2-Sep-14 20:54
Drakesal2-Sep-14 20:54 
QuestionC++ Open the COM Port on Windows CE Device Pin
baranils1-Sep-14 9:27
baranils1-Sep-14 9:27 
Hello

I'm trying to open the COM Port on a Windows CE Device in C++ but without any success
I'm sure that the port exist and available becaus I can use it from cSharp

To do it with C++ I'm trying to use the CreateFile method

The first issue was that CreateFile needs a LPCWSTR
And as it is a long time that I did'nt work with C++ in Windows I had to find ho to assign a LPCWSTR Pointer


So here is my attempt
But it give an Error 2 during execution

NB : I've also tryed different declaration of the Com port but with the same bad result



wchar_t tt[]=L"COM5";
wchar_t tt[]=L"COM5\0";
wchar_t tt[]=L"COM5:";
wchar_t tt[]=L"COM5:\0";}


I can't believe that there is no way to open the Com port on Win CE in cSharp

Thanks for any help


wchar_t tt[]=L"COM5";
 int len=0;
 int result=0;
 char *buffer;
 DWORD dw;

 hComm = CreateFile( tt,
       GENERIC_READ | GENERIC_WRITE,
       0,
       0,
       OPEN_EXISTING,
       NULL,
       NULL);
   if (hComm == INVALID_HANDLE_VALUE)
   {
         dw=GetLastError();
   }

GeneralRe: C++ Open the COM Port on Windows CE Device Pin
CPallini1-Sep-14 9:52
mveCPallini1-Sep-14 9:52 
GeneralRe: C++ Open the COM Port on Windows CE Device Pin
baranils1-Sep-14 19:06
baranils1-Sep-14 19:06 
GeneralRe: C++ Open the COM Port on Windows CE Device Pin
CPallini1-Sep-14 19:43
mveCPallini1-Sep-14 19:43 
GeneralRe: C++ Open the COM Port on Windows CE Device Pin
Randor 2-Sep-14 12:14
professional Randor 2-Sep-14 12:14 
QuestionRe: C++ Open the COM Port on Windows CE Device Pin
CPallini2-Sep-14 20:25
mveCPallini2-Sep-14 20:25 
AnswerRe: C++ Open the COM Port on Windows CE Device Pin
leon de boer2-Sep-14 21:53
leon de boer2-Sep-14 21:53 
GeneralRe: C++ Open the COM Port on Windows CE Device Pin
CPallini2-Sep-14 21:59
mveCPallini2-Sep-14 21:59 
QuestionHow to fix the first column of a CListView in MFC Pin
sma123#31-Aug-14 23:57
sma123#31-Aug-14 23:57 
AnswerRe: How to fix the first column of a CListView in MFC Pin
David Crow2-Sep-14 3:50
David Crow2-Sep-14 3:50 
QuestionAnother academic question - ANSI C standard on optional function parameters Pin
Vaclav_31-Aug-14 8:01
Vaclav_31-Aug-14 8:01 
AnswerRe: Another academic question - ANSI C standard on optional function parameters Pin
Richard MacCutchan31-Aug-14 20:47
mveRichard MacCutchan31-Aug-14 20:47 
AnswerRe: Another academic question - ANSI C standard on optional function parameters Pin
CPallini1-Sep-14 4:24
mveCPallini1-Sep-14 4:24 
GeneralRe: Another academic question - ANSI C standard on optional function parameters Pin
Vaclav_1-Sep-14 5:33
Vaclav_1-Sep-14 5:33 
GeneralRe: Another academic question - ANSI C standard on optional function parameters Pin
Richard MacCutchan1-Sep-14 6:52
mveRichard MacCutchan1-Sep-14 6:52 
GeneralRe: Another academic question - ANSI C standard on optional function parameters Pin
Vaclav_1-Sep-14 7:55
Vaclav_1-Sep-14 7:55 
GeneralRe: Another academic question - ANSI C standard on optional function parameters Pin
CPallini1-Sep-14 9:39
mveCPallini1-Sep-14 9:39 
GeneralRe: Another academic question - ANSI C standard on optional function parameters Pin
Richard MacCutchan1-Sep-14 21:23
mveRichard MacCutchan1-Sep-14 21:23 

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.