actually i m allocating memory with heapalloc
the program crashes access violation
but works if used malloc and free
Espen Harlinn and john i tried in both ways ..works if used malloc and crashes if used heapalloc
WCHAR *buff=(WCHAR*)HeapAlloc(GetProcessHeap(),0,100);
wcscpy(buff,L"rajesh");
CString cbuff;
cbuff=CString(buff);
HeapDestroy(buff);