Rename file c++
Im using MFC to create my application and im stuck with the whole 'save as' function.
Im stuck with renaming an existing file to what the user keyed in the dialog box of 'save as'.
for example i got a file new.bmp.
so after editing the image and all that, the user wants to save it as 'john'
i already have this code:
it gives me a filename called 'filename' with an unknown type of file but with the same size as 'new.bmp'. and then there's another file called john in BMP format BUT its empty. why is this so? where have i go wrong in this? if u need my full codes for the 'save as' function pls do let me know. help will be appreciated.
Re: Rename file c++
It's not at all clear what you are doing, but why the wcstombs_s? Just use _wfopen_s, or better yet, open a CFile and avoid all the string conversion nonsense; fopen_s is going to have to convert it back to wide char before calling the API internally anyway. Also, the windows API call to MoveFile is probably a better way to rename files in MFC and _UNICODE.
|All times are GMT +5.5. The time now is 01:46.|