wifstream fin(_wfopen(L"test.txt",L"rb"));What I really need to do though is declare the wifstream earlier, like a member of a class, and then pass it the file pointer returned from _wfopen to open the stream. I spent an hour or two looking up various ways to do this, but obviously I failed. Does anyone know how I can achieve this? I'm thinking of creating a class that inherits from wifstream, but I don't know if I can achieve what I want this way. I can't use the normal open function of wifstream because it doesn't take in a unicode string. Any help, appreciated as always.