Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. Microsoft Comunications Control

Microsoft Comunications Control

Scheduled Pinned Locked Moved C / C++ / MFC
tutorialquestion
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    ScarberryProd
    wrote on last edited by
    #1

    Can some give me a tutorial, or walk me through how to use the Microsoft Comunications Control to open serial ports and send information through them? thank you --------------------- And Like The Wind Our Hero Vanishes Off Into The Distance...

    B 1 Reply Last reply
    0
    • S ScarberryProd

      Can some give me a tutorial, or walk me through how to use the Microsoft Comunications Control to open serial ports and send information through them? thank you --------------------- And Like The Wind Our Hero Vanishes Off Into The Distance...

      B Offline
      B Offline
      Branislav
      wrote on last edited by
      #2

      I foud this useful explanation using MFC and MSComm32 ActiveX control 2 years ago and give you original text: "Creating the project Make a simple Dialog workspace in MSVC via the MFC App wizard. The options don't really matter, but make sure you check the 'ActiveX Controls' option in when the Wizard prompts you in step 2. Adding CMSComm to your project Open your resource editor so you can change the main dialog. Look on the toolbar, and verify that you don't already have the MSComm control there (someone else may have modified the default workspace). It looks like a little phone. Add the control to your project. Click the Project >> Add To Project >> Components and Controls command from the menu. This command will take a while as MSVC scans the registry for registered controls. Select 'Registered ActiveX Controls' and click insert. Find the object 'Microsoft Communications Control, version 6.0.' (or another version), select it, then click insert, then Ok. At this point MSVC will prompt you for which parts of the ActiveX control you want to add. There should only be one listed, CMSComm, keep it checked. MSVC will generate a wrapper class for the object so you can use it. You can change the file names and class name if you want, but for this purpose, I'll assume you left them as is. Close the add components dialog. Now, look at your dialog toolbar, in it, you should see a new icon for the CMSComm object. Select it, and draw one of these onto your main form. An icon will appear, but don't worry, the control itself is invisible at run time. Initializing the CMSComm control All this can be done at run time, but for now, let's just set the properties at design time. Right click on the icon for the comm control in your dialog resource and pull up the properties dialog. Under the Control, Buffers, and Hardware tabs, set the properties you desire, such as buad rate, parity, port number, etc. Add a member for the control To use the control, you need to create a class member. Open the Class Wizard, and from the Member Variables tab, select the comm control (by default it will be called IDC_MSCOMM1) then click the 'Add Variable...' button. Create a name, I used m_comm. Double check that the variable is a control variable, and that it's of the right class (CMSComm). You can now use this member variable to communitcate with your com port. Using the CMSComm control Here's a quick example of how to use the control. It's important to wait until your OnInitDialog() call (or anytime after) before trying to us

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups