[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

Navigating HTMLView from modal Dialog control

Posted on 2004-04-14
6
Medium Priority
?
436 Views
Last Modified: 2013-11-20
Hi, experts!

I have  CMyHTMLView application and (CDisplayDlg) modal dialog, which pops up
from clicking on button in Docking ToolBar of CMyHTMLView.
CDisplayDlg makes some writing to "C:\\AAA_Text.txt" file a hard drive from user input.
Another button in Docking ToolBar brings "c:\\ReadDataTxt.htm,which displays the content of C:\\AAA_Text.txt in of CMyHTMLView.
I would like to be able to bring "c:\\ReadDataTxt.htm" into  CMyHTMLView by clicking a button on my modal dialog(CDisplayDlg), which would allow me to view the results of input and edit them before CDisplayDlg is destroyed.
All my attempts to get a pointer to CHTMLView from CDisplayDlg in order to invoke
Navigate(....) are resulting in assertion failure.
Maybe i have to use different View architecture for my task.

Plaese, advise. Thank you very much.
Code snippet is appreciated.
 
0
Comment
Question by:khlauster
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
6 Comments
 
LVL 4

Expert Comment

by:caner_elci
ID: 10827756
use Navigate2(), it's supposed to work well.. if you have any assertion failure, please post your calling line and asserting message...
0
 

Author Comment

by:khlauster
ID: 10830362
Hi,

The calling line from DisplayDlg.cpp is:

void CDisplayDlg::OnView()
{
      
      CFile file;
      file.Open(_T("c:\\ReadDataTxt.htm"), CFile::modeReadWrite);

      CHtmlView * pTestRE = (CHtmlView *) CWnd::GetOwner();
      pTestRE->Navigate2(_T("c:\\ReadDataTxt.htm"),NULL,NULL);

}

Which produce: "Unhandled exeption in CMyHTML.exe {MFC42.DLL}:0xC0000005:
                         Access Violation"

Thank you for your help
0
 
LVL 4

Accepted Solution

by:
caner_elci earned 1000 total points
ID: 10830754
Well, there you open the file for reading and writing (that's file gets in use) and afterwards you try to access that file by navigating to it.. Why do you open the file? Can you try without that lines? Like:

void CDisplayDlg::OnView()
{
//     CFile file;
//     file.Open(_T("c:\\ReadDataTxt.htm"), CFile::modeReadWrite);

     CHtmlView * pTestRE = (CHtmlView *) CWnd::GetOwner();
     pTestRE->Navigate2(_T("c:\\ReadDataTxt.htm"),NULL,NULL);
}

One more thing, what's your CDisplayDlg and how do you get a CHtmlView by getting its owner?

Last one, please check http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vccore/html/vchowCreatingWebBrowserstyleApplication.asp for a article by Microsoft...
0
 

Author Comment

by:khlauster
ID: 10833304
I am sorry,

i just forgot to comment out the lines when posting my question
Still the same "Unhandled exeption in CMyHTML.exe {MFC42.DLL}:0xC0000005:
                         Access Violation"

CDisplayDlg is the class for modal pop up dialog, which  can be envoked from CMyHTMLView(my HTMLView application) .

Thank you, caner elci.

I am certainly going to read the article.
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction: Dialogs (1) modal - maintaining the database. Continuing from the ninth article about sudoku.   You might have heard of modal and modeless dialogs.  Here with this Sudoku application will we use one of each type: a modal dialog …
In this post we will learn different types of Android Layout and some basics of an Android App.
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
Sometimes it takes a new vantage point, apart from our everyday security practices, to truly see our Active Directory (AD) vulnerabilities. We get used to implementing the same techniques and checking the same areas for a breach. This pattern can re…
Suggested Courses

656 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question