Business Schools - Engineering Colleges - Medical & Nursing Admissions - BEd in Distance mode - Journalism & Media Studies - Forensic Science
| Want to join in a course? Need suggestions? Visit CollegeZones.com |
| Home / Study Guides / Computer Sciences / Visual C++ / Designing a Web Browser in VC++ |
Ask a question Print this page |
|
Designing a Web Browser in VC++
1. Open Microsoft Visual C++ 2. Click on File -> New and choose MFC AppWizard (exe). Give a name at Project Name as "TestProj" and click on Next 3. Choose "Dialog Based" in the type of application and click "Finish". Click on "Ok" in the Pop-up window and you can now see your Project window. 4. Make sure IDD_TESTPROJ_DIALOG is highlighted. To get this, Click on "Resource View" on the left, expand the "Dialog" and double click on IDD_TESTPROJ_DIALOG. 5. Click on Project menu and choose "Add to Project" and then "Components and Controls". Open "Registered ActiveX controls" folder and choose "Microsoft Web Browser.lnk". Click on Ok button to insert the control. Click on "Ok" in the "Confirm Class" dialog box and finally "Close" the "Components and Controls" window. 6. Insert a button. Click and drag a button onto the form and double click on it to give a name. Eg: OnButton1 7. Insert the Control. To insert the Web Browser Control, Click and drag the control to the form and resize it so as to fill the maximum space in the window. 8. Change name of the button. Right on the Button and choose "Properties". In the "Caption" give a name such as "Go". 9. Now add some code to it such as
void CTestProjDlg::OnButton1()
{
m_browser.Navigate("http://www.vizaginfo.com",0,0,0,0);
}
10. Click on View menu and choose Class Wizard. Click on "Member Variables" tab and in "Control Id's" and double click on IDC_EXPLORER1. Give a member variable name such as "m_browser". Make sure that the Class Name is cTestProjDlg (the dialog that we earlier created).
11. Build the Project by pressing F7 and finally run the executable by using Ctrl + F5. Now you can see our 'browser' running. You can click on links to navigate etc. (Make sure you have Internet connected or you are running a web server to demonstrate this step) In Action
|
Business Schools - Engineering Colleges - Medical & Nursing Admissions - BEd in Distance mode - Journalism & Media Studies - Forensic Science
Enter a detailed keyword. Ex: IGNOU MCA Course Eligibility Criteria