Click here to Skip to main content
15,898,222 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Getting content from HTML control Pin
Ravi Bhavnani2-Mar-04 8:22
professionalRavi Bhavnani2-Mar-04 8:22 
GeneralRe: Getting content from HTML control Pin
Vikram A Punathambekar2-Mar-04 9:32
Vikram A Punathambekar2-Mar-04 9:32 
GeneralRe: Getting content from HTML control Pin
Ravi Bhavnani2-Mar-04 11:17
professionalRavi Bhavnani2-Mar-04 11:17 
GeneralRe: Getting content from HTML control Pin
David Crow2-Mar-04 7:29
David Crow2-Mar-04 7:29 
GeneralWriting large STL vectors to file Pin
inter8ection2-Mar-04 5:52
inter8ection2-Mar-04 5:52 
GeneralRe: Writing large STL vectors to file Pin
valikac2-Mar-04 18:06
valikac2-Mar-04 18:06 
GeneralRe: Writing large STL vectors to file Pin
inter8ection2-Mar-04 23:51
inter8ection2-Mar-04 23:51 
GeneralRe: Writing large STL vectors to file Pin
Robert A. T. Káldy3-Mar-04 1:18
Robert A. T. Káldy3-Mar-04 1:18 
I had a similar problem, when I read a large vector from ifstream via STL.
It's a sad disadvantage of STL - it's too generic to be efficient. For example the stl::copy of vectors is implemented as a cycle, which applies copy constructor to each member of the vector. If you have a vector of complex objects with nontrivial copy constructors, this approach is fair. But if you have for a vector of int's or char's, the STL implementation is too much slower than a simple memcpy.
I think, that std::vector is internally stored as a continuous array of objects, so the iterators to the first and last members should be pointers to begin and end of a memory block, where the array is stored. Thus using of CFile::Write is simple.
Reading a vector is more complex, I think, that you should write your own allocator, which builds a vector from a memory block. But it's only my opinion, I've never write any allocator Frown | :(
The general solution would be to write a STL extension with containers optimized for special member types. Do anybody know, whether such a library exists?

Robert-Antonio

Love, truth and electric traction must gain victory over hate, lie
and diesel traction.

GeneralQuestion using CHttpFile class. Pin
Chris Meech2-Mar-04 5:51
Chris Meech2-Mar-04 5:51 
GeneralWindows XP Theme Conflict Pin
Jnewg52-Mar-04 5:29
Jnewg52-Mar-04 5:29 
GeneralRe: Windows XP Theme Conflict Pin
Michael Dunn2-Mar-04 9:01
sitebuilderMichael Dunn2-Mar-04 9:01 
GeneralRe: Windows XP Theme Conflict Pin
Jnewg53-Mar-04 5:36
Jnewg53-Mar-04 5:36 
GeneralRe: Windows XP Theme Conflict Pin
Michael Dunn3-Mar-04 6:41
sitebuilderMichael Dunn3-Mar-04 6:41 
GeneralRe: Windows XP Theme Conflict Pin
Jnewg511-Mar-04 3:14
Jnewg511-Mar-04 3:14 
GeneralRe: Windows XP Theme Conflict Pin
Michael Dunn12-Mar-04 4:28
sitebuilderMichael Dunn12-Mar-04 4:28 
GeneralRe: Windows XP Theme Conflict Pin
Jnewg512-Mar-04 15:22
Jnewg512-Mar-04 15:22 
GeneralRe: Windows XP Theme Conflict Pin
Michael Dunn12-Mar-04 16:45
sitebuilderMichael Dunn12-Mar-04 16:45 
Generalprinting your source code Pin
BlackDice2-Mar-04 5:28
BlackDice2-Mar-04 5:28 
GeneralRe: printing your source code Pin
John M. Drescher2-Mar-04 6:05
John M. Drescher2-Mar-04 6:05 
GeneralRe: printing your source code Pin
BlackDice2-Mar-04 6:16
BlackDice2-Mar-04 6:16 
GeneralRe: printing your source code Pin
John M. Drescher2-Mar-04 6:54
John M. Drescher2-Mar-04 6:54 
GeneralRe: printing your source code Pin
BlackDice2-Mar-04 6:58
BlackDice2-Mar-04 6:58 
GeneralRe: printing your source code Pin
John M. Drescher2-Mar-04 8:08
John M. Drescher2-Mar-04 8:08 
GeneralRe: printing your source code Pin
John M. Drescher2-Mar-04 8:20
John M. Drescher2-Mar-04 8:20 
GeneralPassing Data between threads Pin
Tom Wright2-Mar-04 4:19
Tom Wright2-Mar-04 4:19 

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.