Click here to Skip to main content
15,797,960 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Play a movie clip Pin
Hamid_RT12-Jul-06 21:10
Hamid_RT12-Jul-06 21:10 
Questionmodulus operator Pin
thathvamsi12-Jul-06 17:25
thathvamsi12-Jul-06 17:25 
AnswerRe: modulus operator Pin
nguyenvhn12-Jul-06 18:29
nguyenvhn12-Jul-06 18:29 
GeneralRe: modulus operator Pin
thathvamsi12-Jul-06 18:36
thathvamsi12-Jul-06 18:36 
AnswerRe: modulus operator Pin
Naveen12-Jul-06 18:41
Naveen12-Jul-06 18:41 
GeneralRe: modulus operator Pin
thathvamsi12-Jul-06 19:06
thathvamsi12-Jul-06 19:06 
GeneralRe: modulus operator Pin
Naveen12-Jul-06 19:17
Naveen12-Jul-06 19:17 
Questionhelp useing Microsoft HTML Object Library in visual c++ 6 Pin
method00712-Jul-06 13:14
method00712-Jul-06 13:14 
Hi all . could any one show me how to use [B]Microsoft HTML Object Library [/B] in visual c++ 6 to extract data from html and populate it in listview. I have done this in visual basic 6 and i posted the code below . I be happy if an expert help me convert it to visual c++ 6 since i need it for a project that has to be done in visual c++ 6. My current visual c++ code retrives html of url and all now i need to be able to do extract the data i wanted from html and populate the listview with that data. I shown a picture of output in the pic.Thanks

code that retrives the html for me in visual c++ 6:

<br />
void CFindUserDlg::OnButton4() <br />
{<br />
	// TODO: Add your control notification handler code here<br />
	<br />
HINTERNET hNet = ::InternetOpen("MSDN SurfBear",PRE_CONFIG_INTERNET_ACCESS,NULL,INTERNET_INVALID_PORT_NUMBER,0) ;<br />
HINTERNET hUrlFile = ::InternetOpenUrl(hNet,"http://www.mysite.com/Display.php",NULL,0,INTERNET_FLAG_RELOAD,0) ;<br />
<br />
char buffer[10*1024] ;<br />
<br />
DWORD dwBytesRead = 0;<br />
BOOL bRead = ::InternetReadFile(hUrlFile,buffer,sizeof(buffer),&dwBytesRead);<br />
<br />
SetDlgItemText(IDC_EDIT2,buffer);<br />
<br />
::InternetCloseHandle(hUrlFile) ;<br />
::InternetCloseHandle(hNet) ;<br />
<br />
<br />
	<br />
}



visual basic 6 code:
<br />
<br />
Private Sub Command3_Click()<br />
  'this function places data into listview<br />
  ' requires that you add a reference to the Microsoft HTML Object Library<br />
    Dim mydoc As HTMLDocument<br />
    Dim wombat As IHTMLElementCollection<br />
    Dim lp As Long<br />
    <br />
    Set mydoc = New HTMLDocument<br />
    <br />
    'mydoc.body.innerHTML = "<html><head><p><ul><table border=1 cellpadding=4> " & _<br />
                          '  "<tr><th>Name</th> > <th> color </th> </tr> " & _<br />
                           ' "<tr><td>tony</td> <td>33023</td> " & _<br />
                           ' "<tr><td>cindy</td> <td>16711935</td> " & _<br />
                           ' "<tr><td>sarah</td> <td>3434343</td> " & _<br />
                           ' "</table> </body></html>"<br />
                            <br />
    mydoc.body.innerHTML = RichTextBox1.Text<br />
    <br />
 Set wombat = mydoc.getElementsByTagName("TR") ' Get the rows<br />
    For lp = 1 To wombat.length - 1 ' Ignore first row<br />
        Set LI = ListView1.ListItems.Add(lp, , wombat.Item(lp).All.Item(0).innerText)<br />
        ListView1.ListItems(lp).ForeColor = wombat.Item(lp).All.Item(1).innerText<br />
        LI.ListSubItems.Add , , wombat.Item(lp).All.Item(1).innerText<br />
        <br />
    Next<br />
End Sub


picuture of the output:

[IMG]http://i5.photobucket.com/albums/y180/method007/ListViewPop.jpg[/IMG]
AnswerRe: help useing Microsoft HTML Object Library in visual c++ 6 Pin
nguyenvhn12-Jul-06 18:32
nguyenvhn12-Jul-06 18:32 
GeneralRe: help useing Microsoft HTML Object Library in visual c++ 6 Pin
method00712-Jul-06 18:47
method00712-Jul-06 18:47 
QuestionC++ memory question Pin
mdexch12-Jul-06 12:59
mdexch12-Jul-06 12:59 
AnswerRe: C++ memory question [modified] Pin
earl12-Jul-06 14:11
earl12-Jul-06 14:11 
GeneralRe: C++ memory question Pin
mdexch14-Jul-06 8:58
mdexch14-Jul-06 8:58 
AnswerRe: C++ memory question Pin
Joe Woodbury12-Jul-06 15:11
professionalJoe Woodbury12-Jul-06 15:11 
GeneralRe: C++ memory question Pin
kanduripavan12-Jul-06 21:46
kanduripavan12-Jul-06 21:46 
GeneralRe: C++ memory question Pin
Joe Woodbury13-Jul-06 1:11
professionalJoe Woodbury13-Jul-06 1:11 
Questionsscanf will only put value in first variable Pin
Evilpixie12-Jul-06 12:32
Evilpixie12-Jul-06 12:32 
AnswerRe: sscanf will only put value in first variable [modified] Pin
earl12-Jul-06 13:46
earl12-Jul-06 13:46 
GeneralRe: sscanf will only put value in first variable Pin
Evilpixie12-Jul-06 14:11
Evilpixie12-Jul-06 14:11 
GeneralRe: sscanf will only put value in first variable Pin
earl12-Jul-06 14:14
earl12-Jul-06 14:14 
GeneralRe: sscanf will only put value in first variable Pin
Evilpixie12-Jul-06 14:17
Evilpixie12-Jul-06 14:17 
AnswerRe: sscanf will only put value in first variable Pin
Stephen Hewitt12-Jul-06 15:08
Stephen Hewitt12-Jul-06 15:08 
QuestionColor management in CDC Pin
TchouTchou Project12-Jul-06 12:23
TchouTchou Project12-Jul-06 12:23 
AnswerRe: Color management in CDC Pin
A_Fa12-Jul-06 21:09
A_Fa12-Jul-06 21:09 
QuestionHow can I convert to TIFF file format? [modified] Pin
Cris12-Jul-06 10:47
Cris12-Jul-06 10:47 

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.