×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Web browser functions using CHtmlView

Web browser functions using CHtmlView

Web browser functions using CHtmlView

(OP)
I have created a HTML resource but I am not getting the web browser functions. Also how to modify OnInitialUpdate() so that its derived from CHtmlView.

Zulfi

RE: Web browser functions using CHtmlView

Dear Zulfi,

Well to start, you can't derive from anything in OnIntialUpdate(). Actually you can't derive from any function since derivation is a C++ compile time feature not a runtime feature.

So either you need to brush up on your C++ or your question is confusing.

If you wanted your view class to be derived from CHtmlView you should have done that in the 'App Wizard' steps. It can be done manually by creating a new class derived from CHtmlView and replacing it with your original view in the document template constructor in your application class's InitInstance(). If that last sentence is confusing then you probably are not ready to try that method yet, so hopefully you just started the project and you can start over and select CHtmlView in the App Wizard step.

Hope this helps
-pete


RE: Web browser functions using CHtmlView

(OP)
I want something like that
void CIEAppView::OnInitialUpdate()
{
CHtmlView::OnInitialUpdate();

// Load initial HTML content from resource.
//LoadFromResource(IDR_HTML1);(Please ignore it)
}

BOOL CIEAppView::PreCreateWindow(CREATESTRUCT& cs)
{
// TODO: Modify the Window class or styles here by modifying
//  the CREATESTRUCT cs

return CView::PreCreateWindow(cs);
}

but I am getting

void CIEAppView::OnInitialUpdate()
{
CView::OnInitialUpdate();

// Load initial HTML content from resource.
LoadFromResource(IDR_HTML1);
}

BOOL CIEAppView::PreCreateWindow(CREATESTRUCT& cs)
{
// TODO: Modify the Window class or styles here by modifying
//  the CREATESTRUCT cs

return CView::PreCreateWindow(cs);
}



I have added a HTML resource .
I also want the browser functionality i.e
void CIEAppView::OnViewRefresh()
{
// Defer to base function
Refresh();
}

void CIEAppView::OnViewStop()
{
// Defer to base function
Stop();
}

void CIEAppView::OnGoBack()
{
// Defer to base function
GoBack();
}

void CIEAppView::OnGoForward()
{
// Defer to base function
GoForward();
}

void CIEAppView::OnGoHome()
{
// Defer to base function
GoHome();
}

Will  the above functions & the toolbar similar to IE would be coming implicitly
just by adding the HTML resource or I have to do something more.

Zulfi.

RE: Web browser functions using CHtmlView

Same question... Is CIEAppView derived from CHtmlView?

-pete

RE: Web browser functions using CHtmlView

(OP)
Sorry I wrongly used the word derive:
Actually I am looking for browser functions & the toolbar similar to IE. I think I can get it simply by adding the HTML resource
void CIEAppView::OnViewRefresh()
{
// Defer to base function
Refresh();
}

void CIEAppView::OnViewStop()
{
// Defer to base function
Stop();
}

void CIEAppView::OnGoBack()
{
// Defer to base function
GoBack();
}

void CIEAppView::OnGoForward()
{
// Defer to base function
GoForward();
}

void CIEAppView::OnGoHome()
{
// Defer to base function
GoHome();
}

RE: Web browser functions using CHtmlView

zulfi1234 try looking at this from microsoft:
http://msdn.microsoft.com/library/devprods/vs6/visualc/vcsample/_sample_mfc_mfcie.htm

It has examples of what you are looking for, though from the look of 'your' sample code above you might have already found it.

....

I have a question that you might be able to help with palbano. Do you know a way of trapping when a user Right mouse clicks on a HTML page and clicks Refresh. Or presses F5 to refresh.

The problem i have is that i don't want specific pages to refresh, or refresh in some specific way and when a user clicks on RMB then chooses refresh it seems that it doesn't call any event handlers.

Know any way around this?

Thanks,

keelwan



Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close