Archived Forum Post

Index of archived forum posts

Question:

save file does not work in windows 7

Jan 09 '13 at 18:45

Hi,

I am using 9.3.2 version of chilkat.My appl,ication is on VC++ 2010 I am calling ckByteData::encryptedData.saveFile((const char*)strFileName); to save the file. strFileName is of const CString& type. In our application we are trying to export a file into the directory for whick we are calling the above function. It works fine on XP.But in Windows 7, I cannot see the saved file and dont even get the exceptions or error.It shows everything is successful.

Can anyone please let me know if I have to use something different for Windows 7.

It would be of great help to us as we are running out of time.

Thanks,

Jyothi


Answer

Are you perhaps saving to a protected location (for example "Program Files")? Vista and later do not make that easy. Try to run your program "as administrator".


Answer

Given that you are a C++ programmer using VC++, you should be capable of writing (non-Chilkat) code that opens/creates a file, writes bytes to it, and closes it. Therefore, given that you can access the byte data via CkByteData::getData(), and you can get the number of bytes via CkByteData::getSize(), you should be able to write the file using the ordinary file I/O methods provided by the Windows Platform SDK, or even fopen/fwrite if you wish.

The CkByteData::saveFile method is purely for convenience. It returns a success/failure status, but unfortunately you can't get more information than that. To get more information, write the file using non-Chilkat means. (Please don't ask for help with that..)

All Chilkat objects, EXCEPT for CkByteData and CkString, have a LastErrorText property that can be used to get detailed information. However, CkByteData and CkString are considered more "lightweight" objects and do not have it.