Click here to Skip to main content
16,014,892 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
Questionspawn ActiveX controls in new UI thread ??? Pin
daa skirdneh3-Feb-01 1:42
daa skirdneh3-Feb-01 1:42 
General"Opening a Web Page in default browser?" Pin
3-Feb-01 1:35
suss3-Feb-01 1:35 
GeneralRe: Pin
Michael Dunn3-Feb-01 8:12
sitebuilderMichael Dunn3-Feb-01 8:12 
GeneralHTML Parser in C++ Pin
Vickie2-Feb-01 20:56
Vickie2-Feb-01 20:56 
GeneralRe: HTML Parser in C++ Pin
NormDroid3-Feb-01 0:27
professionalNormDroid3-Feb-01 0:27 
GeneralRe: HTML Parser in C++ Pin
NormDroid3-Feb-01 0:29
professionalNormDroid3-Feb-01 0:29 
GeneralRe: HTML Parser in C++ Pin
Vickie3-Feb-01 4:38
Vickie3-Feb-01 4:38 
GeneralRe: HTML Parser in C++ Pin
Tim Deveaux3-Feb-01 11:04
Tim Deveaux3-Feb-01 11:04 
If you don't need to format text, this might not be too difficult.

Hmmm... lets say you can load the whole page into, say, a CString. Work directly with the file stream if you like, but a CString or string might allow less code for a prototype.

Every item you're interested in will start with a '<' character. As you travel through the string Finding this character, you examine the chars that follow (perhaps using Compare and Left(position, strlen(tag)) (remember to discard initial white space) to see if they match one of the keywords you're interested in (H1, H2, href etc.) and take action. If the chars after the the '<' don't match anything you need, just go back to looking for the next '<'.

This is very much 'context free' parsing, and is something that HTML lends itself well to - writing a browser gets a lot more complicated, but for what you want to do this might be a good start. Probably only 'context' you have to deal with is remembering you have seen a <tag> when you encouner a </tag>

There are certainly some details to work out as to how you store and parse the tags you're looking for, but start small and you'll probably find a reasonably efficient setup. I bet you could do something quite elegant with the STL containers, if that's your cup of tea.

You might also search for some web spider code - there's bound to be some link parsing you can borrow in that type of app.
GeneralRe: HTML Parser in C++ Pin
Vickie9-Feb-01 17:30
Vickie9-Feb-01 17:30 
GeneralRe: HTML Parser in C++ Pin
Tim Deveaux12-Feb-01 3:45
Tim Deveaux12-Feb-01 3:45 
GeneralTitle Bar Icon Pin
2-Feb-01 8:39
suss2-Feb-01 8:39 
GeneralRe: Title Bar Icon Pin
AlexMarbus2-Feb-01 12:13
AlexMarbus2-Feb-01 12:13 
QuestionHow to view (use) XIFF files? Pin
2-Feb-01 6:39
suss2-Feb-01 6:39 
Generalvariable template parameter Pin
2-Feb-01 2:59
suss2-Feb-01 2:59 
QuestionWinLogon notification? Pin
Mathias Tunared2-Feb-01 1:54
Mathias Tunared2-Feb-01 1:54 
AnswerRe: WinLogon notification? Pin
3-Feb-01 12:42
suss3-Feb-01 12:42 
GeneralRe: WinLogon notification? Pin
Mathias Tunared4-Feb-01 21:50
Mathias Tunared4-Feb-01 21:50 
GeneralGood Ad-ware System Pin
Colin J Davies1-Feb-01 23:25
Colin J Davies1-Feb-01 23:25 
QuestionHow do they do anti-alias ??? Pin
Danoo1-Feb-01 20:21
Danoo1-Feb-01 20:21 
AnswerRe: How do they do anti-alias ??? Pin
Chris Losinger2-Feb-01 4:23
professionalChris Losinger2-Feb-01 4:23 
GeneralATL Com progamming - needed help !!! Pin
1-Feb-01 18:52
suss1-Feb-01 18:52 
GeneralDebugging VB COM Components from a C++ Client Pin
Chris Paulse1-Feb-01 16:49
Chris Paulse1-Feb-01 16:49 
GeneralRe: Debugging VB COM Components from a C++ Client Pin
Chris Paulse2-Feb-01 15:32
Chris Paulse2-Feb-01 15:32 
GeneralThe old mouse recorder Pin
1-Feb-01 12:53
suss1-Feb-01 12:53 
GeneralRe: The old mouse recorder Pin
Michael Dunn1-Feb-01 13:14
sitebuilderMichael Dunn1-Feb-01 13:14 

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.