Chandra, If you're using Visual C++ I can't understand why you're doing things the hard way??????????? This is probably why you're getting errors, etc. - you should let VC++ handle all that behind-the-scenes technical stuff.
Create a dialog in the resource editor. Add an edit control to it. In the class wizard, give the edit control a member variable and a name (eg. m_myEditCtrl).
If you want to set the text in the edit control before the dialog is displayed, use class wizard to add a member function for the dialog which responds to the WM_INITDIALOG message. In that function, you can use:
m_myEditCtrl.SetWindowText("Hello World"

;
to set the text before the dialog is seen.
You can use the same method to set the text in the edit control at any time. To retrieve the text from the edit control at any time, simply use:
CString myString;
m_myEditCtrl.GetWindowText(myString);
the text from the edit control is now stored in 'myString'.
You can treat edit controls and buttons and other controls just like CWnd objects (because they are all derived from CWnd). Therefore, you can use the methods:
ShowWindow();
MoveWindow();
etc, etc, etc, to set the position and state of the controls. For example,
m_myEditCtrl.MoveWindow(0,0,50,20,TRUE);
will move your edit box to the top left corner of your dialog. It will be 50 pixels wide and 20 tall.
Chandra, if you're using VC++ you should take advantage of the fact and let VC++ do all the hard niggly work for you wherever possible. That's the whole point of using VC++ - to make programmer's lives easier so it leaves you more time to do the fun stuff that sets your app apart from everyone elses.