Click here to Skip to main content
15,904,503 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: How to Get the path of Internet Explorer using C++ Pin
tns_ranjith11-Jul-09 1:13
tns_ranjith11-Jul-09 1:13 
GeneralRe: How to Get the path of Internet Explorer using C++ Pin
Stuart Dootson11-Jul-09 1:19
professionalStuart Dootson11-Jul-09 1:19 
AnswerRe: How to Get the path of Internet Explorer using C++ Pin
David Crow11-Jul-09 15:54
David Crow11-Jul-09 15:54 
QuestionData population Pin
Chiman110-Jul-09 20:21
Chiman110-Jul-09 20:21 
AnswerRe: Data population Pin
Rajesh R Subramanian10-Jul-09 22:07
professionalRajesh R Subramanian10-Jul-09 22:07 
QuestionVector elements and the heap...or the stack... Pin
Mike the Red10-Jul-09 14:16
Mike the Red10-Jul-09 14:16 
AnswerRe: Vector elements and the heap...or the stack... Pin
«_Superman_»10-Jul-09 16:06
professional«_Superman_»10-Jul-09 16:06 
AnswerRe: Vector elements and the heap...or the stack... Pin
Stuart Dootson10-Jul-09 23:10
professionalStuart Dootson10-Jul-09 23:10 
Mike the Red wrote:
OR if there is a way to make a sub-array of an array, where the sub-array points to an address within the array but has a length shorter than the distance from the address within the source array to its end. This way would avoid the stack and the heap and the addresses would be valid so long as the source LPBYTE data was valid. It isn't good code, but to better explain what I mean:


Arrays==pointers. The size of an array is not (repeat NOT) stored with the pointer. So, you could store pointers into the original array in the vector, but you'd need to store some way of knowing what the end ot the part was. You could do it like this:

void split(vector<std::pair<LPBYTE, LPBYTE> >& vect, const LPBYTE& lpbData)
{
   LPBYTE start = lpbData;    // first part starts at beginning of lpbData
   LPBYTE end = lpbData + (size_t) 2;  // This is normally calculated by finding a separating sequence within lpbData
   vect.push_back(std::make_pair(start, end));
}


and you'd have to declare parts as

vector<std::pair<LPBYTE, LPBYTE> > parts;


This concept is known as an iterator range and is supported within some[^] libraries[^].

The iterator range is what is known as a half-open range. What this means is that the start of the range is part of the range, but the end of the range actually points to the first element AFTER the range. Sounds odd? Well, it's the way that all the STL iterators and algorithms work, so these ranges have compatibility with those, which is a good thing, IMO.

HTH!

Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p

GeneralRe: Vector elements and the heap...or the stack... Pin
Mike the Red11-Jul-09 8:53
Mike the Red11-Jul-09 8:53 
GeneralRe: Vector elements and the heap...or the stack... Pin
Stuart Dootson11-Jul-09 8:56
professionalStuart Dootson11-Jul-09 8:56 
QuestionDialogBox function Pin
dipuks10-Jul-09 12:36
dipuks10-Jul-09 12:36 
AnswerRe: DialogBox function Pin
«_Superman_»10-Jul-09 15:59
professional«_Superman_»10-Jul-09 15:59 
QuestionToolbar-like custom draw buttons Pin
tiresias210-Jul-09 10:00
tiresias210-Jul-09 10:00 
QuestionAdding BigInt's Pin
TannerB10-Jul-09 9:35
TannerB10-Jul-09 9:35 
AnswerRe: Adding BigInt's Pin
josda100010-Jul-09 9:57
josda100010-Jul-09 9:57 
Question"Debug Assert Error" in VC++.NET Pin
james_bond10-Jul-09 8:00
james_bond10-Jul-09 8:00 
AnswerRe: "Debug Assert Error" in VC++.NET Pin
josda100010-Jul-09 8:33
josda100010-Jul-09 8:33 
GeneralRe: "Debug Assert Error" in VC++.NET Pin
james_bond10-Jul-09 10:56
james_bond10-Jul-09 10:56 
AnswerRe: "Debug Assert Error" in VC++.NET Pin
josda100010-Jul-09 11:07
josda100010-Jul-09 11:07 
GeneralRe: "Debug Assert Error" in VC++.NET Pin
james_bond10-Jul-09 14:05
james_bond10-Jul-09 14:05 
GeneralRe: "Debug Assert Error" in VC++.NET Pin
josda100010-Jul-09 16:02
josda100010-Jul-09 16:02 
AnswerRe: "Debug Assert Error" in VC++.NET Pin
Stuart Dootson10-Jul-09 8:35
professionalStuart Dootson10-Jul-09 8:35 
QuestionRelease Mode issue Pin
dipuks10-Jul-09 7:30
dipuks10-Jul-09 7:30 
AnswerRe: Release Mode issue Pin
Stuart Dootson10-Jul-09 8:31
professionalStuart Dootson10-Jul-09 8:31 
AnswerRe: Release Mode issue Pin
Cyrilix10-Jul-09 11:29
Cyrilix10-Jul-09 11:29 

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.