How you display webpage in VC++

You have to create a browser manager to display webpage within your vc++ application. Then you call functions to display any webpage based on url. You have to write following code in your dialog:

BOOL VMCLEScannerGameBookDlg::OnInitDialog()
{
CDialog::OnInitDialog();
// Initialize Browser window Size
m_nBrowserWindowLeft = rect.left + (rect.right – rect.left) /2 – 300;
m_nBrowserWindowRight = rect.left + (rect.right – rect.left) /2 + 300;
m_nBrowserWindowTop = rect.top + (rect.bottom – rect.top) /2 – 300;
m_nBrowserWindowBottom = rect.top + (rect.bottom – rect.top) /2 + 300;

// Create Browser Window
if( TRUE == m_BrowserManager.createHTMLBrowserWindow(this,
IDC_STATIC_BROWSER,
m_nBrowserWindowLeft,
m_nBrowserWindowTop,
m_nBrowserWindowRight,
m_nBrowserWindowBottom))
{
//Hide Paint Canvas
m_staticCanvas.ShowWindow(SW_HIDE);

CString strURL = m_strCSVUrlPath + m_strCurrentLanguage + “open\\openning.html”;
// Load URL
m_BrowserManager.loadURL(strURL);

}
return TRUE; // return TRUE unless you set the focus to a control
}

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: