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

C / C++ / MFC

 
GeneralRe: No hwnd, ie hwnd = 00000000 using CMonthCalendar Control Pin
Larry Mills Sr20-Apr-08 11:07
Larry Mills Sr20-Apr-08 11:07 
GeneralRe: No hwnd, ie hwnd = 00000000 using CMonthCalendar Control Pin
David Crow20-Apr-08 16:15
David Crow20-Apr-08 16:15 
GeneralRe: No hwnd, ie hwnd = 00000000 using CMonthCalendar Control Pin
Larry Mills Sr21-Apr-08 3:46
Larry Mills Sr21-Apr-08 3:46 
GeneralRe: No hwnd, ie hwnd = 00000000 using CMonthCalendar Control Pin
David Crow21-Apr-08 3:52
David Crow21-Apr-08 3:52 
GeneralRe: No hwnd, ie hwnd = 00000000 using CMonthCalendar Control Pin
Larry Mills Sr23-Apr-08 10:15
Larry Mills Sr23-Apr-08 10:15 
GeneralText with words in different color Pin
Dj_Lordas13-Apr-08 8:44
Dj_Lordas13-Apr-08 8:44 
GeneralRe: Text with words in different color Pin
Dj_Lordas13-Apr-08 10:46
Dj_Lordas13-Apr-08 10:46 
GeneralSerial Port --> Write Pin
shpid3r13-Apr-08 7:21
shpid3r13-Apr-08 7:21 
Hello every1!

I am ecountering a problem trying to write data to a serial port (COM1).
The thing is, the same code works fine in Visual Studio 5...
Here is the code in problem:

<br />
char[] portName= "com1";<br />
osWrite1.hEvent=CreateEvent(NULL, TRUE, FALSE, NULL);<br />
if(osWrite1.hEvent==NULL)		//error on Creating Event<br />
MessageBoxW(L"Creating Write Event failed...", L"Failure",MB_OK|MB_ICONEXCLAMATION);<br />
	<br />
hComm1= CreateFileA( portName, GENERIC_WRITE ,0,0,OPEN_EXISTING,FILE_FLAG_OVERLAPPED,0);                  <br />
(CreateFile in VS5.0 was in fact CreateFileA, while in VS8 is CreateFileW, which takes another type for the first parameter)<br />
if (hComm1 == INVALID_HANDLE_VALUE)	// error opening port; abort<br />
MessageBoxW(L"CreateFile failed!Aborting...",L"Failure",MB_OK|MB_ICONEXCLAMATION);<br />
<br />
else {<setting baud="" rate,="" parity="" etc="">}<br />
</setting>


When running the code, the messageBox with "CreateFile failed! aborting..." appears. Any ideas what to do ?

Meanwhile I`m studying ways to do this using the modern way: using classes
Thanks!
Shpid3r
GeneralRe: Serial Port --&gt; Write Pin
Ed.Poore13-Apr-08 7:45
Ed.Poore13-Apr-08 7:45 
GeneralRe: Serial Port --&gt; Write Pin
shpid3r13-Apr-08 8:05
shpid3r13-Apr-08 8:05 
GeneralRe: Serial Port --&gt; Write Pin
ERLN13-Apr-08 21:00
ERLN13-Apr-08 21:00 
QuestionRe: Serial Port --&gt; Write Pin
bob1697213-Apr-08 8:19
bob1697213-Apr-08 8:19 
GeneralRe: Serial Port --&gt; Write Pin
shpid3r13-Apr-08 11:15
shpid3r13-Apr-08 11:15 
GeneralRe: Serial Port --&gt; Write [modified] Pin
CPallini13-Apr-08 10:26
mveCPallini13-Apr-08 10:26 
GeneralRe: Serial Port --&gt; Write Pin
shpid3r13-Apr-08 11:21
shpid3r13-Apr-08 11:21 
GeneralRe: Serial Port --&gt; Write Pin
CPallini13-Apr-08 12:13
mveCPallini13-Apr-08 12:13 
GeneralRe: Serial Port --&gt; Write Pin
shpid3r13-Apr-08 11:32
shpid3r13-Apr-08 11:32 
QuestionRe: Serial Port --&gt; Write Pin
David Crow14-Apr-08 4:32
David Crow14-Apr-08 4:32 
QuestionEncryption using AES Pin
Strategic_Thinker13-Apr-08 5:06
Strategic_Thinker13-Apr-08 5:06 
GeneralRe: Encryption using AES Pin
Randor 13-Apr-08 7:21
professional Randor 13-Apr-08 7:21 
GeneralRe: Encryption using AES Pin
Strategic_Thinker13-Apr-08 10:56
Strategic_Thinker13-Apr-08 10:56 
GeneralCStringW to CStringA Pin
Joseph Marzbani13-Apr-08 4:14
Joseph Marzbani13-Apr-08 4:14 
GeneralRe: CStringW to CStringA Pin
CPallini13-Apr-08 5:08
mveCPallini13-Apr-08 5:08 
GeneralCEdit Control Pin
john563213-Apr-08 1:50
john563213-Apr-08 1:50 
GeneralRe: CEdit Control Pin
Joseph Marzbani13-Apr-08 2:12
Joseph Marzbani13-Apr-08 2:12 

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.