How to add webbrowser controle to visual c++ 6 MFC project

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

How to add webbrowser controle to visual c++ 6 MFC project

Postby method » Tue Jul 11, 2006 11:07 am


Hi all. could any one tell me how i can add webbrowser controle to my visual c++ 6 MFC project? I already have project made by MFC AppWizard which has a few conroles such as buttons an textbox/editbox and i want to add to it a webbrowser controle just like visual basic 6.Thanks
method
imFiles Master
imFiles Master
 
Posts: 686
Joined: Tue Oct 18, 2005 11:12 am

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

Project -> Add To Project -> Components and controls -> Microsoft Web Browser
User avatar
Dody
imFiles Senior
imFiles Senior
 
Posts: 177
Joined: Tue Jan 04, 2005 2:44 pm

Postby method » Wed Jul 12, 2006 8:43 am

Dody wrote:Project -> Add To Project -> Components and controls -> Microsoft Web Browser


Thanks man . i already found solution for that but do not know how to extract data from webbrowser!!
method
imFiles Master
imFiles Master
 
Posts: 686
Joined: Tue Oct 18, 2005 11:12 am

Postby BattleStar-Galactica » Wed Jul 12, 2006 9:09 am

You have to create a variable for that control and in the procedure DoDataExchange, link your variable to your control and know you can access all properties of you control by nameofyourcontrol.propertieofyourcontrol


like vb6 :lol:
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 9:18 am

nanomachine007 wrote:You have to create a variable for that control and in the procedure DoDataExchange, link your variable to your control and know you can access all properties of you control by nameofyourcontrol.propertieofyourcontrol


like vb6 :lol:


i have no idea how to use those functions u mentioned to be able 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.!!THanks


Here the code for loading url:


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


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