Hi,

I am a total noob at c++.

I have the following code:
Code:
   CoInitialize (NULL);

   HRESULT hr;
   IActiveDesktop *pActiveDesktop;
   char* wpurl;

   wpurl = GrabTextFromEdit(IDE_WPURL);
   hr = CoCreateInstance(CLSID_ActiveDesktop, NULL, CLSCTX_INPROC_SERVER, IID_IActiveDesktop, (void**)&pActiveDesktop);
   //OLECHAR szFile [] = OLESTR(wpurl);
   hr = pActiveDesktop->SetWallpaper(wpurl, 0);

   pActiveDesktop->ApplyChanges(AD_APPLY_ALL);
   pActiveDesktop->Release();

   MessageBox(m_hWnd, "The wallpaper has been changed", "",MB_OK);
   return true;
When i run this code i get this error:
error C2664: 'IActiveDesktop::SetWallpaper' : cannot convert parameter 1 from 'char *' to 'LPCWSTR'

So i have tried to covert the wpurl variable to a LPCWSTR with the mbstowcs function but couldnt figure out how to implement it.

Can anyone help me to covert the character?

Thanks alot i advnance