Click here to Skip to main content
16,011,608 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Setting an edit controls style Pin
monrobot1319-May-04 9:33
monrobot1319-May-04 9:33 
GeneralRe: Setting an edit controls style Pin
grigsoft19-May-04 9:04
grigsoft19-May-04 9:04 
GeneralRe: Setting an edit controls style Pin
David Crow19-May-04 9:19
David Crow19-May-04 9:19 
GeneralRe: Setting an edit controls style Pin
David Crow19-May-04 9:24
David Crow19-May-04 9:24 
GeneralRe: Setting an edit controls style Pin
monrobot1319-May-04 9:30
monrobot1319-May-04 9:30 
GeneralRe: Got It Working Pin
monrobot1319-May-04 9:40
monrobot1319-May-04 9:40 
GeneralWaitCommEvent and GetCommMask (and overlapping) Pin
AnotherProgrammer19-May-04 7:51
AnotherProgrammer19-May-04 7:51 
GeneralQuick Follow up - way simpler question Pin
AnotherProgrammer19-May-04 8:11
AnotherProgrammer19-May-04 8:11 
From this link: Configuring a communications resource:

#include <windows.h><br />
<br />
int main(int argc, char *argv[])<br />
{<br />
   DCB dcb;<br />
   HANDLE hCom;<br />
   BOOL fSuccess;<br />
   char *pcCommPort = "COM2";<br />
<br />
   hCom = CreateFile( pcCommPort,<br />
                    GENERIC_READ | GENERIC_WRITE,<br />
                    0,    // must be opened with exclusive-access<br />
                    NULL, // no security attributes<br />
                    OPEN_EXISTING, // must use OPEN_EXISTING<br />
                    0,    // not overlapped I/O<br />
                    NULL  // hTemplate must be NULL for comm devices<br />
                    );


pcCommPort is declared as a pointer to a character, which is assigned "COM2". How does this make sense? A char cannot be more than one character in length, right? Upon testing, trying to do *pcCommPort = "COM3" later in the program does indeed yield "error C2440: '=' : cannot convert from 'char [5]' to 'char'" which actually makes sense. So why is that same assignment statement allowed upon declaration?

Also, if at some point, I need to change the COM port to say, COM3, how would I accomplish that? *pcCommPort = "COM3" did not work, as I mentioned.

Thanks in advance.
GeneralRe: Quick Follow up - way simpler question Pin
Paul Ranson19-May-04 8:48
Paul Ranson19-May-04 8:48 
GeneralRe: Quick Follow up - way simpler question Pin
AnotherProgrammer20-May-04 3:30
AnotherProgrammer20-May-04 3:30 
GeneralRe: WaitCommEvent and GetCommMask (and overlapping) Pin
AnotherProgrammer20-May-04 6:23
AnotherProgrammer20-May-04 6:23 
GeneralCheck if application is running Pin
Mathias S.19-May-04 7:42
Mathias S.19-May-04 7:42 
GeneralRe: Check if application is running Pin
Renjith Ramachandran19-May-04 8:04
Renjith Ramachandran19-May-04 8:04 
GeneralRe: Check if application is running Pin
David Crow19-May-04 8:15
David Crow19-May-04 8:15 
GeneralExe Wrapper Pin
Anthony988719-May-04 6:48
Anthony988719-May-04 6:48 
GeneralRe: Exe Wrapper Pin
David Crow19-May-04 7:00
David Crow19-May-04 7:00 
GeneralRe: Exe Wrapper Pin
jmkhael19-May-04 7:03
jmkhael19-May-04 7:03 
GeneralBoundsChecker errors Pin
Deian19-May-04 6:08
Deian19-May-04 6:08 
GeneralRe: BoundsChecker errors Pin
David Crow19-May-04 7:07
David Crow19-May-04 7:07 
GeneralRe: BoundsChecker errors Pin
Deian19-May-04 10:13
Deian19-May-04 10:13 
GeneralRe: BoundsChecker errors Pin
Deian19-May-04 10:18
Deian19-May-04 10:18 
GeneralRe: BoundsChecker errors Pin
David Crow19-May-04 10:28
David Crow19-May-04 10:28 
GeneralRe: BoundsChecker errors Pin
Deian19-May-04 10:36
Deian19-May-04 10:36 
GeneralRe: BoundsChecker errors Pin
John R. Shaw19-May-04 12:30
John R. Shaw19-May-04 12:30 
GeneralRe: BoundsChecker errors Pin
Kelly Herald19-May-04 16:56
Kelly Herald19-May-04 16:56 

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.