tags:

views:

33

answers:

2

I am taking the URL value from DocumentComplete and try to copy it to testDest[256] Here is my code:

char *p= _com_util::ConvertBSTRToString(url->bstrVal);

for (int i = 0; i <= strlen(p); i++)
{
  testDest[i] = p[i];   
}

My question is, how can I print the testDest value on a messagebox?

A: 

The simplest way to create a message box is this:

MessageBox(NULL, testDest, "some title", 0);

If you already have a window and you want to associate the message box with that window, just change the first parameter from NULL to the window handle.

Also, if you're using Unicode, you should convert your char [] to TCHAR [] or otherwise call the ANSI version (MessageBoxA) explicitly.

casablanca
A: 

You can do this

CString cstring( testDest);
AfxMessageBox(testDest);
ckv