WM_SETTEXT fills in controls but data is not valid
===

I have written a program in c# that controls another program.  The "other program" is a standard Windows application written in Microfocus COBOL.  Thus I can use SendMessage to enter data into the edit controls and combo boxes in the COBOL application.  Code that does this is below:

        public unsafe void setData(string strData)
      {
      IntPtr iMem = ClsMemory.StringToHLocalA(strData);
      if (ctlType == eType.Edit)
        {
        SendMessageA(iHandle, (uint)WindowsMessages.WM_SETTEXT, UIntPtr.Zero, iMem);//???        SetWindowTextA(iHandle, iMem);
        }
      else if (ctlType == eType.ComboBox)
        {
        SendMessageA(iHandle, (uint)WindowsMessages.CB_SELECTSTRING, UIntPtr.Zero, iMem);
        }
      ClsMemory.FreeHLocal(iMem);
      }


The problem is that the data shows up in the controls.  Everything appears to be correct.  The screen in the COBOL program looks exactly as if it would look if I had entered the data from the keyboard.  However, when the controlling program pushes the COBOL program's Submit button, the COBOL program complains that none of the data is valid.  That is, if I have entered a birth date of 06/01/1982, that isn't a valid date.  When I hand-enter 06/01/1982, it is.  I have tried ASCII and Unicode variants.  I have made sure that the unsafe string has a zero terminator.  

What is also mysterious is that the commented-out SetWindowText function does not work at all.  Nothing shows up in the controls.  The operating system is Windows XP Pro wth the latest patches.  The programming environment is Visual Studio 2010.  

Any help will be greatly appreciated.