Edit:: or, better yet, a std::string to std::wstring?
Okay, I've gotten that working.
The program compiles fine, runs with no errors, yet again, nothing happens.
This is the code that I currenly have:
// create a wstring object because that is what the setwallpaper func takes std::wstring s; // convert between string and wstring for(i=0; i < fname.size(); i++) s += fname; CoInitialize(NULL); HRESULT hr; IActiveDesktop *pActiveDesktop; //Create an instance of the Active Desktop hr = CoCreateInstance(CLSID_ActiveDesktop, NULL, CLSCTX_INPROC_SERVER, IID_IActiveDesktop, (void**)&pActiveDesktop); if( hr != S_OK ) MessageBox(NULL, "ERROR", "ERROR", MB_OK); // change the wallpaper pActiveDesktop->SetWallpaper(s.c_str(), 0); // Call the Release method pActiveDesktop->Release(); CoUninitialize () ;
And, I've tried calling GetLastError after every single statement there. After every single one, and the only error I get, is after the 'CoUninit..' call. The error is "Class does not exist.". Which is fairly confusing, because, if it didn't wouldn't every function call there generate a fit? (fit, as in crazy fit)
[Edited by - Endar on December 20, 2005 8:40:37 AM]