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. CString

CString

Scheduled Pinned Locked Moved C / C++ / MFC
question
5 Posts 4 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.
  • B Offline
    B Offline
    Bravoone_2006
    wrote on last edited by
    #1

    i want to Broadcast a message to multiple instances of an application ! I have CEdit m_edit1; CButton IDC_SEND //// m_send; //////////////////////////////// CString sText; m_edit1.GetWindowText(sText); i want to diplay the massege from m_edit1 when i press the button m_send to all m_edit1 to instances of aplication. how can i do that? :confused:

    Bravoone

    P D 2 Replies Last reply
    0
    • B Bravoone_2006

      i want to Broadcast a message to multiple instances of an application ! I have CEdit m_edit1; CButton IDC_SEND //// m_send; //////////////////////////////// CString sText; m_edit1.GetWindowText(sText); i want to diplay the massege from m_edit1 when i press the button m_send to all m_edit1 to instances of aplication. how can i do that? :confused:

      Bravoone

      P Offline
      P Offline
      Peter Weyzen
      wrote on last edited by
      #2

      If the strings aren't too long, you can turn your string into an "ATOM". GlobalAddAtom stores the string and gives you a handle to it. GlobalGetAtomName does the reverse.

      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Peter Weyzen Staff Engineer [SoonR Inc.](http://www.soonr.com)

      B 1 Reply Last reply
      0
      • P Peter Weyzen

        If the strings aren't too long, you can turn your string into an "ATOM". GlobalAddAtom stores the string and gives you a handle to it. GlobalGetAtomName does the reverse.

        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Peter Weyzen Staff Engineer [SoonR Inc.](http://www.soonr.com)

        B Offline
        B Offline
        Bravoone_2006
        wrote on last edited by
        #3

        i have CDialog base aplication and i want to display the posibility to transfer data from one dialog to another,but the base dialog is the same , something like broadcast a message to multiple instances of an application : void CTestFindWindowDlg::OnButton() { // Send message in broadcasr mode BOOL a = ::SendNotifyMessage(HWND_BROADCAST,WM_MYMESSAGE ,0,lpString); } void CTestFindWindowDlg::OnTestMyMessage(WPARAM wParam,LPARAM lParam) { int a =(int)lParam; CString strValue; strValue.Format("%d",a); AfxMessageBox("broadcast :"+strValue); } now all i want is to display the text into CEdit m_edit1 lets say... how can i do that ? and the text must be from the m_edit1! :confused:

        Bravoone

        S 1 Reply Last reply
        0
        • B Bravoone_2006

          i have CDialog base aplication and i want to display the posibility to transfer data from one dialog to another,but the base dialog is the same , something like broadcast a message to multiple instances of an application : void CTestFindWindowDlg::OnButton() { // Send message in broadcasr mode BOOL a = ::SendNotifyMessage(HWND_BROADCAST,WM_MYMESSAGE ,0,lpString); } void CTestFindWindowDlg::OnTestMyMessage(WPARAM wParam,LPARAM lParam) { int a =(int)lParam; CString strValue; strValue.Format("%d",a); AfxMessageBox("broadcast :"+strValue); } now all i want is to display the text into CEdit m_edit1 lets say... how can i do that ? and the text must be from the m_edit1! :confused:

          Bravoone

          S Offline
          S Offline
          S Douglas
          wrote on last edited by
          #4

          I’m not sure what exactly you’re really trying to do, but for information on sending messages here is an excellent article http://www.codeproject.com/dialog/messagemgmt.asp[^]


          I'd love to help, but unfortunatley I have prior commitments monitoring the length of my grass. :Andrew Bleakley:

          1 Reply Last reply
          0
          • B Bravoone_2006

            i want to Broadcast a message to multiple instances of an application ! I have CEdit m_edit1; CButton IDC_SEND //// m_send; //////////////////////////////// CString sText; m_edit1.GetWindowText(sText); i want to diplay the massege from m_edit1 when i press the button m_send to all m_edit1 to instances of aplication. how can i do that? :confused:

            Bravoone

            D Offline
            D Offline
            David Crow
            wrote on last edited by
            #5

            Bravoone_2006 wrote:

            i want to Broadcast a message to multiple instances of an application !

            Use WM_COPYDATA.


            "Approved Workmen Are Not Ashamed" - 2 Timothy 2:15

            "Judge not by the eye but by the heart." - Native American Proverb

            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