Hi all

,
I m tring to use RichEdit control in win32application in VC++ using following code syntax.. I want to display XML file contents in RichEdit Box...But Its displaying in only one line....not properly....Please if anyone knows .....Help...
CODE
int APIENTRY WinMain(HINSTANCE hInstance,
HINSTANCE hPrevInstance,
LPSTR lpCmdLine,
int nCmdShow)
{
// TODO: Place code here.
MSG msg;
HACCEL hAccelTable;
// Initialize global strings
LoadString(hInstance, IDS_APP_TITLE, szTitle, MAX_LOADSTRING);
LoadString(hInstance, IDC_ADOSAMPLE, szWindowClass, MAX_LOADSTRING);
MyRegisterClass(hInstance);
// Perform application initialization:
if (!InitInstance (hInstance, nCmdShow))
{
return FALSE;
}
hAccelTable = LoadAccelerators(hInstance, (LPCTSTR)IDC_ADOSAMPLE);
// Main message loop:
while (GetMessage(&msg, NULL, 0, 0))
{
if (!TranslateAccelerator(msg.hwnd, hAccelTable, &msg))
{
TranslateMessage(&msg);
DispatchMessage(&msg);
}
}
return msg.wParam;
}
ATOM MyRegisterClass(HINSTANCE hInstance)
{
WNDCLASSEX wcex;
wcex.cbSize = sizeof(WNDCLASSEX);
wcex.style = 0;// | CS_VREDRAW;
wcex.lpfnWndProc = (WNDPROC)WndProc;
wcex.cbClsExtra = 0;
wcex.cbWndExtra = 0;
wcex.hInstance = hInstance;
wcex.hIcon = LoadIcon(hInstance, (LPCTSTR)IDI_ADOSAMPLE);
wcex.hCursor = LoadCursor(NULL, IDC_ARROW);
wcex.hbrBackground = (HBRUSH)(COLOR_WINDOW+1);
wcex.lpszMenuName = (LPCSTR)IDC_ADOSAMPLE;
wcex.lpszClassName = szWindowClass;
wcex.hIconSm = LoadIcon(wcex.hInstance, (LPCTSTR)IDI_SMALL);
return RegisterClassEx(&wcex);
}
BOOL InitInstance(HINSTANCE hInstance, int nCmdShow)
{
hInst = hInstance; // Store instance handle in our global variable
hWnd = CreateWindow(szWindowClass, szTitle, WS_OVERLAPPEDWINDOW,
CW_USEDEFAULT, 0, CW_USEDEFAULT, 0, NULL, NULL, hInstance, NULL);
if (!hWnd)
{
return FALSE;
}
ShowWindow(hWnd, nCmdShow);
UpdateWindow(hWnd);
return TRUE;
}
LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
{
int wmId, wmEvent;
PAINTSTRUCT ps;
HDC hdc;
TCHAR szHello[MAX_LOADSTRING];
LoadString(hInst, IDS_HELLO, szHello, MAX_LOADSTRING);
switch (message)
{
case WM_SIZE :
//MoveWindow (hwndEdit, 0, 0, LOWORD (lParam), HIWORD (lParam), TRUE);
InvalidateRect (hwndEdit, &rect,FALSE);
/// UpdateWindow (hwndEdit);
break;
case WM_ACTIVATE:
MoveWindow(hWnd, 0,0, 900, 700,false);
//InvalidateRect (hwndEdit, &rect,FALSE);
//UpdateWindow (hwndEdit);
//::LoadLibrary("Msftedit.dll");
break;
case WM_CREATE:
hwndEdit = CreateWindow(TEXT ("richedit"), NULL,
WS_CHILD | WS_VISIBLE | WS_CLIPSIBLINGS |
WS_VSCROLL | ES_AUTOVSCROLL | WS_HSCROLL |
ES_AUTOHSCROLL | ES_MULTILINE|ES_VERTICAL |WS_THICKFRAME|
LBS_SORT| WS_BORDER|LBS_STANDARD ,
20 , 20,600 , 600 , hWnd, (HMENU)0,
((LPCREATESTRUCT) lParam) -> hInstance, NULL);
break;
case WM_COMMAND:
wmId = LOWORD(wParam);
wmEvent = HIWORD(wParam);
// Parse the menu selections:
switch (wmId)
{
case IDM_VIEWXML:
GetClientRect( hwndEdit,&rect);
InvalidateRect (hwndEdit, &rect,TRUE);
UpdateWindow (hwndEdit);
ViewXMLFile();
break;
default:
return DefWindowProc(hWnd, message, wParam, lParam);
}
break;
case WM_PAINT:
hdc = BeginPaint(hWnd, &ps);
EndPaint(hWnd, &ps);
break;
case WM_DESTROY:
PostQuitMessage(0);
break;
default:
return DefWindowProc(hWnd, message, wParam, lParam);
}
return 0;
}
void ViewXMLFile()
{
HDC hdc1;
//MoveWindow(hwndEdit,400,200,400,210,true);
InvalidateRect (hwndEdit, &rect, FALSE);
try
{
hr = CoInitialize(NULL);
pXMLDOMDoc.CreateInstance(__uuidof(DOMDocument));
hdc1 = GetDC(hwndEdit);
pXMLDOMDoc->load("Account.xml");
TextOut(hdc1 ,10,20,pXMLDOMDoc->Getxml(), strlen(pXMLDOMDoc->Getxml()));
}
catch(_com_error &e)
{
dump_error(e);
}
}