Click here to Skip to main content
16,007,885 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionProblem when declare CArray? Pin
ooosawaddee328-Oct-02 7:18
ooosawaddee328-Oct-02 7:18 
AnswerRe: Problem when declare CArray? Pin
Shog928-Oct-02 7:49
sitebuilderShog928-Oct-02 7:49 
GeneralRe: Problem when declare CArray? Pin
ooosawaddee328-Oct-02 8:31
ooosawaddee328-Oct-02 8:31 
AnswerRe: Problem when declare CArray? Pin
30-Oct-02 17:59
suss30-Oct-02 17:59 
GeneralCustom Calendar Control Pin
JennyP28-Oct-02 6:57
JennyP28-Oct-02 6:57 
GeneralRe: Custom Calendar Control Pin
alex.barylski28-Oct-02 12:13
alex.barylski28-Oct-02 12:13 
GeneralPlease, help... STUCK Pin
Xeena28-Oct-02 6:44
Xeena28-Oct-02 6:44 
GeneralRe: Please, help... STUCK Pin
ian mariano28-Oct-02 17:59
ian mariano28-Oct-02 17:59 
The SDK reference for IStorage::CreateStream[^] is quite clear that pwcsName must not exceed 31 characters. Just use a short version of the file name (<= 31 chars long,) and put the real file name length as the first thing in your stream, and the actual name right after. When "walking" the streams in your storage, you can always read in the length and the actual file name from each stream.

Assuming your file name, strFileName, is an STL string, you can:

//  pIMyStream is an open stream...error checking not included!
ULONG  nLen = strFileName.length();
ULONG  cbWritten = 0;
pIMyStream->Write(reinterpret_cast<void*>(&nLen), sizeof(ULONG), &cbWritten);
pIMyStream->Write(reinterpret_cast<void*>(strFileName.c_str()), nLen, &cbWritten);

And
ULONG  nLen = 0;
ULONG  cbRead = 0;
pIMyStream->Read(reinterpret_cast<void*>(&nLen), sizeof(ULONG), &cbRead);
char*  pszBuf = new char[nLen + 1];
memset(pszBuf, 0, nLen + 1);
pIMyStream->Read(reinterpret_cast<void*>(pszBuf), nLen, &cbRead);
strFileName = pszBuf;
delete [] pszBuf;


Or something like that...

-- ian



http://www.ian-space.com/
GeneralOnKeyDown().. How to determine simultaneous key presses. Pin
clintsinger28-Oct-02 6:19
clintsinger28-Oct-02 6:19 
GeneralRe: OnKeyDown().. How to determine simultaneous key presses. Pin
Paul M Watt28-Oct-02 6:48
mentorPaul M Watt28-Oct-02 6:48 
GeneralRe: OnKeyDown().. How to determine simultaneous key presses. Pin
Chris Richardson28-Oct-02 14:20
Chris Richardson28-Oct-02 14:20 
GeneralCListCtrl image format Pin
rrrado28-Oct-02 5:31
rrrado28-Oct-02 5:31 
GeneralRe: CListCtrl image format Pin
Shog928-Oct-02 16:52
sitebuilderShog928-Oct-02 16:52 
GeneralRe: CListCtrl image format Pin
rrrado28-Oct-02 21:20
rrrado28-Oct-02 21:20 
QuestionIs pipe an effiecient way for communication between threads? Pin
Wenrich28-Oct-02 4:38
Wenrich28-Oct-02 4:38 
AnswerRe: Is pipe an effiecient way for communication between threads? Pin
Carlos Antollini28-Oct-02 4:45
Carlos Antollini28-Oct-02 4:45 
AnswerRe: Is pipe an effiecient way for communication between threads? Pin
Joe Woodbury28-Oct-02 6:01
professionalJoe Woodbury28-Oct-02 6:01 
AnswerRe: Is pipe an effiecient way for communication between threads? Pin
valikac28-Oct-02 11:49
valikac28-Oct-02 11:49 
GeneralMDI Application Pin
act_x28-Oct-02 4:02
act_x28-Oct-02 4:02 
GeneralRe: MDI Application Pin
Alexander Wiseman28-Oct-02 4:54
Alexander Wiseman28-Oct-02 4:54 
GeneralComplex class question. Pin
Michael Liu28-Oct-02 3:43
Michael Liu28-Oct-02 3:43 
GeneralRe: Complex class question. Pin
Paul M Watt28-Oct-02 6:51
mentorPaul M Watt28-Oct-02 6:51 
GeneralHelppppppppppppppppp Pin
Renjith Ramachandran28-Oct-02 3:28
Renjith Ramachandran28-Oct-02 3:28 
GeneralRe: Helppppppppppppppppp Pin
AOL-user28-Oct-02 8:45
sussAOL-user28-Oct-02 8:45 
GeneralSelect directory in CFileDialog Pin
Ola Carlsson28-Oct-02 3:16
Ola Carlsson28-Oct-02 3:16 

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.