How to output html of url into a RichTextBox in visual c++ 6

Here you can talk about C++ And C# And Other languages programming.

How to output html of url into a RichTextBox in visual c++ 6

Postby method » Tue Jul 11, 2006 1:57 pm


Hi all. could any one show me how i can get the html of a perticuler url and place that html inside a textbox/editbox for further manipulation. I have done such think in visual basic 6 but i do not know that can be done in visual c++ 6. I be happy if some one show me how i can achive that.Thanks


visual basic 6 method:

RichTextBox1.Text = Inet1.OpenURL(txtURL.Text, icString)
method
imFiles Master
imFiles Master
 
Posts: 686
Joined: Tue Oct 18, 2005 11:12 am

Postby Dody » Wed Jul 12, 2006 8:57 am

oh well, you can do it with many ways.
you can do it with a combination between CInternetSession and CHttpConnection.
or also by using URLDownloadToFile will download the page to a file. You can then open and display the file
URLDownloadToCacheFile will download the page to a cached file where you can access the data (this is what I have been told to do ages ago)
User avatar
Dody
imFiles Senior
imFiles Senior
 
Posts: 177
Joined: Tue Jan 04, 2005 2:44 pm

Postby method » Wed Jul 12, 2006 9:06 am

Dody wrote:oh well, you can do it with many ways.
you can do it with a combination between CInternetSession and CHttpConnection.
or also by using URLDownloadToFile will download the page to a file. You can then open and display the file
URLDownloadToCacheFile will download the page to a cached file where you can access the data (this is what I have been told to do ages ago)


I will be using this url's html code every one min so saving it will not be good idea since it remains in cach and i will be using the old html again and again!!! i have no idea how to use those functions u mentioned to extract my data from webbrowser.My webbrowser has this html and i want to collect the bold data from it and place it in listview!

<html>

<head>
<meta http-equiv="refresh" content="60">
</head>


<p><ul><table border=1 cellpadding=4

<tr><th>Name</th> <th> code </th> <th> code2 </th> </tr>
<tr><td><font color="0800">tony</font></td> <td>123</td> <td>454352</td>

<tr><td><font color="FF0FF">cindy</font></td> <td>45245</td> <td>245245</td>

<tr><td><font color="800FF">sarah</font></td> <td>452454</td> <td>245545</td>

</table>
</body>
</html>


could u just show me how get the bold html data and populate it in listview. I searched all over inernet and i could not find a single example of how to get html using visual c++ 6.!!

Dody u did not respond my other posts about how to color individual listview items!!! i just need to know that.THanks


code that loads the url for me in webbrowser controle:

BOOL CFindUserDlg::OnInitDialog()
{
CDialog::OnInitDialog();

// Add "About..." menu item to system menu.

// IDM_ABOUTBOX must be in the system command range.
ASSERT((IDM_ABOUTBOX & 0xFFF0) == IDM_ABOUTBOX);
ASSERT(IDM_ABOUTBOX < 0xF000);

CMenu* pSysMenu = GetSystemMenu(FALSE);
if (pSysMenu != NULL)
{
CString strAboutMenu;
strAboutMenu.LoadString(IDS_ABOUTBOX);
if (!strAboutMenu.IsEmpty())
{
pSysMenu->AppendMenu(MF_SEPARATOR);
pSysMenu->AppendMenu(MF_STRING, IDM_ABOUTBOX, strAboutMenu);
}
}

// Set the icon for this dialog. The framework does this automatically
// when the application's main window is not a dialog
SetIcon(m_hIcon, TRUE); // Set big icon
SetIcon(m_hIcon, FALSE); // Set small icon

// TODO: Add extra initialization here

COleVariant vtOptional((long)DISP_E_PARAMNOTFOUND,VT_ERROR);
m_wbrow.Navigate2(COleVariant(_T("http://localhost/Display.php")),
vtOptional, vtOptional, vtOptional, vtOptional);




return TRUE; // return TRUE unless you set the focus to a control
}
method
imFiles Master
imFiles Master
 
Posts: 686
Joined: Tue Oct 18, 2005 11:12 am

Postby Dody » Wed Jul 12, 2006 11:56 am

you can point part of the code into a CString, and use the "Find" member to get what you are looking for
User avatar
Dody
imFiles Senior
imFiles Senior
 
Posts: 177
Joined: Tue Jan 04, 2005 2:44 pm

Postby method » Wed Jul 12, 2006 12:08 pm

Dody wrote:you can point part of the code into a CString, and use the "Find" member to get what you are looking for


not good idea!!!
method
imFiles Master
imFiles Master
 
Posts: 686
Joined: Tue Oct 18, 2005 11:12 am

Postby BattleStar-Galactica » Wed Jul 12, 2006 4:16 pm

oh what about get text like get paltalk text chat :?:

how to get text like paltalk chat room in ie is using the same technic like get yahoo text chat


with that methode you are free of html tag. if you dont want to do that, the only way you can do is trim your data but if i'm in your place i'll use get text like get paltalk text chat and store each line to listview
Last edited by BattleStar-Galactica on Wed Jul 12, 2006 4:24 pm, edited 1 time in total.
User avatar
BattleStar-Galactica
imFiles Master
imFiles Master
 
Posts: 565
Joined: Tue Sep 20, 2005 12:19 am
Location: safest place to hide

Postby method » Wed Jul 12, 2006 4:19 pm

nanomachine007 wrote:oh what about get text like get paltalk text chat :?:

how to get text like paltalk chat room in ie is using the same technic like get yahoo text chat


man i want to get some data from webbrowser controle and place it in listview. Life is easy in visual basic but not in visual c++ 6.

The html behind the webbrowser is showne below and i be happy nano if u show me how i can get the data shown in bold in visual c++ 6.Thanks

<html>

<head>
<meta http-equiv="refresh" content="60">
</head>


<p><ul><table border=1 cellpadding=4

<tr><th>Name</th> <th> code </th> <th> code2 </th> </tr>
<tr><td><font color="0800">tony</font></td> <td>123</td> <td>454352</td>

<tr><td><font color="FF0FF">cindy</font></td> <td>45245</td> <td>245245</td>

<tr><td><font color="800FF">sarah</font></td> <td>452454</td> <td>245545</td>

</table>
</body>
</html>
method
imFiles Master
imFiles Master
 
Posts: 686
Joined: Tue Oct 18, 2005 11:12 am

Postby BattleStar-Galactica » Wed Jul 12, 2006 4:29 pm

why you dont display your data with internet explore like this

tony 123 xxxx
Candy 123 xxxx
Bob 123 xxxxxx


and use api like you use to get yahoo text and stuck each like in listview :?:
User avatar
BattleStar-Galactica
imFiles Master
imFiles Master
 
Posts: 565
Joined: Tue Sep 20, 2005 12:19 am
Location: safest place to hide

Postby method » Wed Jul 12, 2006 4:36 pm

nanomachine007 wrote:why you dont display your data with internet explore like this

tony 123 xxxx
Candy 123 xxxx
Bob 123 xxxxxx


and use api like you use to get yahoo text and stuck each like in listview :?:


well the data is tables to make it look good. You mentioned a good trick but how i be able to place names in one column and the rest of integers in second and 3th columns of listview? Furthermore, could u tell me how to add a listiview with 3 columns in visual studio 6 and show me how to add add the data u show from textbox to listview.Thanks
method
imFiles Master
imFiles Master
 
Posts: 686
Joined: Tue Oct 18, 2005 11:12 am

Postby BattleStar-Galactica » Wed Jul 12, 2006 4:52 pm

a table or not is not matter, when you get text like get yahoo text chat is just getting the text
User avatar
BattleStar-Galactica
imFiles Master
imFiles Master
 
Posts: 565
Joined: Tue Sep 20, 2005 12:19 am
Location: safest place to hide

Postby method » Wed Jul 12, 2006 4:55 pm

nanomachine007 wrote:a table or not is not matter, when you get text like get yahoo text chat is just getting the text


oh then show me how to get the text from my webbrowser controle. my webbrowser controle is not external also show me how to make listview with 3 columns and populate them with data from webbrowser.Thanks
method
imFiles Master
imFiles Master
 
Posts: 686
Joined: Tue Oct 18, 2005 11:12 am


Return to C++, C# And Others Programming

 


  • Related topics
    Replies
    Views
    Last post

Who is online

Users browsing this forum: No registered users and 0 guests