0

I am trying to convert a const char pointer to a constant wide string pointer. Here is my code.

double ret;
const wchar_t* file;
file = const wchar_t* (file_old);

I get something that says this: "Error, type name not allowed." over the const.

Any help is greatly appreciated!

null
  • 548
  • 2
  • 6
  • 17

1 Answers1

0

You need to actually convert the contents to which the pointer points to wide characters. The easiest way to do that is probably to put the narrow version into a string and convert using wstring_convert as detailed in this answer: https://stackoverflow.com/a/18374698/82320

Community
  • 1
  • 1
Billy ONeal
  • 104,103
  • 58
  • 317
  • 552
  • Ok, I got it figured by replacing all the wchar_t stuff with LPCWSTR, but now I get this error: 1>dllmnain.obj : error LNK2001: unresolved external symbol __imp__PlaySoundW@12, do you know of that error? I would rate your answer up, but I don't have enough rep. – null Oct 18 '14 at 00:09