Falling in trouble with CHtmlView when you found the GetWidth() member function not implemented by M$?
Here's a simple way to implement the member function yourself. It takes just a few lines of code.
How to use it in your program? Simply derive your view class from CHtmlViewEx instead of CHtmlView.
(...hmmm, this is my first article, and the article wizard always says "Articles must be at least 100 words".
I really don't know what else I should say about my simple code, only a few short lines.
It's just a little patch for MFC.)
Introduction
Simply create a new class derived from CHtmlView with Class Wizard and following the 2 steps below.
1. Modify the constructor
CHtmlViewEx::CHtmlViewEx() : CHtmlView()
{
}
2. Add a member function called
GetWidth()
long CHtmlViewEx::GetWidth()
{
ASSERT(m_pBrowserApp != NULL);
long result;
m_pBrowserApp->get_Width(&result);
return result;
}