CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 12 of 12
  1. #1
    Join Date
    May 2014
    Posts
    17

    Exclamation MFC GUI-setting COMPort and read hex data from pic (ASCII)

    I want to setup my MFC-based dialogue "IDD_LOADCELL" with serial communication so that when that dialogue is pop up, the data from PIC (external device) which is in hex file format is display on the edit control box on the dialogue. The variable name of the edit control box is "m_loadP "and "m_loadT1". type of variable for both are string. I want to get the code for the COMPort setting and reading the data from pic and finally display it on the edit control box created on the dialogue

  2. #2
    VictorN's Avatar
    VictorN is offline Super Moderator Power Poster
    Join Date
    Jan 2003
    Location
    Hanover Germany
    Posts
    20,395

    Re: MFC GUI-setting COMPort and read hex data from pic (ASCII)

    Well, you have to read/understand how serial communications work in Windows.
    Then implementing something similar to Serial Port I/O would be a good start!
    Victor Nijegorodov

  3. #3
    Join Date
    May 2014
    Posts
    17

    Re: MFC GUI-setting COMPort and read hex data from pic (ASCII)

    Its there any class developed specifically for COMPort function setup in MFC application wizard? or I have to develop my own code wothout depending on any classes?

  4. #4
    VictorN's Avatar
    VictorN is offline Super Moderator Power Poster
    Join Date
    Jan 2003
    Location
    Hanover Germany
    Posts
    20,395

    Re: MFC GUI-setting COMPort and read hex data from pic (ASCII)

    Did you read the Serial Port I/O essay?
    Victor Nijegorodov

  5. #5
    Join Date
    May 2014
    Posts
    17

    Re: MFC GUI-setting COMPort and read hex data from pic (ASCII)

    yes. I have read it. Why?

  6. #6
    VictorN's Avatar
    VictorN is offline Super Moderator Power Poster
    Join Date
    Jan 2003
    Location
    Hanover Germany
    Posts
    20,395

    Re: MFC GUI-setting COMPort and read hex data from pic (ASCII)

    Quote Originally Posted by newborn2 View Post
    yes. I have read it. Why?
    What "why"?
    Just add the classes from this essay to your project...

    Note that you also will need to properly set the DCB and Timeouts, See SetCommState function, SetCommTimeouts function
    Victor Nijegorodov

  7. #7
    Join Date
    May 2014
    Posts
    17

    Re: MFC GUI-setting COMPort and read hex data from pic (ASCII)

    I'm still confusing about DCB setting... is it like a variable that need to add up in the front line of the name of the COMPort configuration? example like m_dcb.Baudrate..m_dcb.Parity..? what is the usage? I have see a lot of COMPort configuration wwithout the DCB term... Is it specialize for reading hex file?

  8. #8
    VictorN's Avatar
    VictorN is offline Super Moderator Power Poster
    Join Date
    Jan 2003
    Location
    Hanover Germany
    Posts
    20,395

    Re: MFC GUI-setting COMPort and read hex data from pic (ASCII)

    Please, read the documentation in MSDN!
    Victor Nijegorodov

  9. #9
    Join Date
    May 2014
    Posts
    17

    Re: MFC GUI-setting COMPort and read hex data from pic (ASCII)

    I know that it is device control block... but still confusing... I need a more understanding explanation...

  10. #10
    Join Date
    May 2014
    Posts
    17

    Re: MFC GUI-setting COMPort and read hex data from pic (ASCII)

    HuH... when I see the Kernel.lib and Kernel.dll... I noticed that i heve try this before.. when I debugging my code..they cannot define both... how I want to include both (Kernel.lib and Kernel.dl)

  11. #11
    VictorN's Avatar
    VictorN is offline Super Moderator Power Poster
    Join Date
    Jan 2003
    Location
    Hanover Germany
    Posts
    20,395

    Re: MFC GUI-setting COMPort and read hex data from pic (ASCII)

    Are they not included by default?
    Besides, please read About Communications Resources in MSDN.
    Victor Nijegorodov

  12. #12
    Join Date
    May 2014
    Posts
    17

    Re: MFC GUI-setting COMPort and read hex data from pic (ASCII)

    thank you for linking me step by step to the necessary topic.. is it the About Communications Resources is the first step for the program that I want to develop? I just want to make sure that I was not overlook... I need time to understand this... I will ask later if I'm facing another problem regarding this topic..

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured