Click here to Skip to main content
14,605,622 members

ATL / WTL / STL

 
AnswerRe: problem with sprintf_s() on win 7 Pin
H.Brydon26-Nov-12 19:36
professionalH.Brydon26-Nov-12 19:36 
Questionwsageterror() Pin
bkelly131-Nov-12 15:28
Memberbkelly131-Nov-12 15:28 
AnswerRe: wsageterror() Pin
Richard MacCutchan1-Nov-12 22:48
mveRichard MacCutchan1-Nov-12 22:48 
QuestionSTL map issue in VS2010 Pin
Subhash Madhukar30-Oct-12 3:47
MemberSubhash Madhukar30-Oct-12 3:47 
AnswerRe: STL map issue in VS2010 Pin
Richard MacCutchan30-Oct-12 6:04
mveRichard MacCutchan30-Oct-12 6:04 
Questionhow do i copy a CImage DIB to clipboard Pin
Member 951640015-Oct-12 11:15
MemberMember 951640015-Oct-12 11:15 
AnswerRe: how do i copy a CImage DIB to clipboard Pin
chaau15-Oct-12 11:41
Memberchaau15-Oct-12 11:41 
QuestionWhy does this fail - CFile / SeekToEnd? Pin
charlieg10-Oct-12 6:43
Membercharlieg10-Oct-12 6:43 
Code snippet below. The SeekToBegin fails because the CFile object has an invalid file handle. But the open returns true, so the code proceeds to die an ugly death. The code is called within a tight loop passing through a couple of hundred files. It feels like I'm overrunning the hard drive or file system, but I have no idea how I might do that... any thoughts are greatly appreciated.

// in a loop of many files....
// do some compression.
// now open a temp file to dump raw data into:

FilePath = (CString)directoryBuf;
FilePath += (CString)"\\uncompressed.unc";
CFileException fe;

if(UncompFile.Open(FilePath, CFile::shareExclusive | CFile::modeCreate | CFile::modeReadWrite), &fe)
{
  UncompFile.SeekToBegin();
  UncompFile.Write(outBuf, c_stream.total_out);
  UncompFile.SeekToBegin();
  UncompFile.Write(outBuf, c_stream.total_out);
  UncompFile.Close();

  cmpCRC = helper.ComputeFileCRC( FilePath );

  UncompFile.Remove((LPCTSTR)FilePath);

  if(uncCRC != cmpCRC)
  {
    ErrorString = (CString)infoStruct->sourceFileName  + "\n failed CRC test.";
    return ErrorString;
  }

Charlie Gilley
<italic>You're going to tell me what I want to know, or I'm going to beat you to death in your own house.

"Where liberty dwells, there is my country." B. Franklin, 1783
“They who can give up essential liberty to obtain a little temporary safety deserve neither liberty nor safety.” BF, 1759



modified 10-Oct-12 13:11pm.

AnswerRe: Why does this fail - CFile / SeekToEnd? Pin
charlieg10-Oct-12 9:31
Membercharlieg10-Oct-12 9:31 
AnswerRe: Why does this fail - CFile / SeekToEnd? Pin
chaau10-Oct-12 11:23
Memberchaau10-Oct-12 11:23 
GeneralRe: Why does this fail - CFile / SeekToEnd? Pin
charlieg11-Oct-12 2:20
Membercharlieg11-Oct-12 2:20 
AnswerRe: Why does this fail - CFile / SeekToEnd? Pin
Richard MacCutchan10-Oct-12 21:45
mveRichard MacCutchan10-Oct-12 21:45 
GeneralRe: Why does this fail - CFile / SeekToEnd? Pin
charlieg11-Oct-12 2:30
Membercharlieg11-Oct-12 2:30 
GeneralRe: Why does this fail - CFile / SeekToEnd? Pin
charlieg11-Oct-12 4:53
Membercharlieg11-Oct-12 4:53 
GeneralRe: Why does this fail - CFile / SeekToEnd? Pin
Richard MacCutchan11-Oct-12 11:19
mveRichard MacCutchan11-Oct-12 11:19 
GeneralRe: Why does this fail - CFile / SeekToEnd? Pin
charlieg11-Oct-12 11:34
Membercharlieg11-Oct-12 11:34 
GeneralRe: Why does this fail - CFile / SeekToEnd? Pin
Richard MacCutchan11-Oct-12 12:01
mveRichard MacCutchan11-Oct-12 12:01 
GeneralRe: Why does this fail - CFile / SeekToEnd? Pin
charlieg12-Oct-12 5:54
Membercharlieg12-Oct-12 5:54 
AnswerRe: Why does this fail - CFile / SeekToEnd? Pin
Stephen Hewitt11-Oct-12 12:58
MemberStephen Hewitt11-Oct-12 12:58 
AnswerRe: Why does this fail - CFile / SeekToEnd? Pin
charlieg18-Jan-13 1:47
Membercharlieg18-Jan-13 1:47 
QuestionKeep program open and running Pin
Lucidation8-Oct-12 11:23
MemberLucidation8-Oct-12 11:23 
AnswerRe: Keep program open and running Pin
Richard MacCutchan8-Oct-12 22:14
mveRichard MacCutchan8-Oct-12 22:14 
GeneralRe: Keep program open and running Pin
Lucidation9-Oct-12 11:14
MemberLucidation9-Oct-12 11:14 
GeneralRe: Keep program open and running Pin
Richard MacCutchan9-Oct-12 11:19
mveRichard MacCutchan9-Oct-12 11:19 
AnswerRe: Keep program open and running Pin
Stephen Hewitt11-Oct-12 21:45
MemberStephen Hewitt11-Oct-12 21:45 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.