> Can somebody give me simple example using pointers to return 2 values of CString type

This is the kind of thing you asked for (yuk!):

void GetStrings(CString* pStr1, CString* pStr2)
{
if (pStr1)
*pStr1 = "Replaced existing string 1";
else
pStr1 = new CString("Allocated new string 1");

if (pStr2)
*pStr2 = "Replaced existing string 2";
else
pStr2 = new CString("Allocated new string 2");
}

As you can see, how you handle the CString pointers depends on whether they already point to CStrings or not. If you allocate new CStrings, you must remember to delete them when you've finished with them. If you decide to do it this way (I think it's a big mistake), you should *never* mix heap-based and stack-based CStrings as arguments, and *always* initialize your pointers.

I would strongly recommended you *not* to use CString pointers as arguments. If you pass references instead, the function will be simpler, safer, and clearer:

void GetStrings(CString& str1, CString& str2)
{
str1 = "Replaced existing string 1";
str2 = "Replaced existing string 2";
}

Dave