Solved

CScrollView in Modal Dialog Box

Posted on 2000-04-02
2
671 Views
Last Modified: 2013-11-20
I have a static dialogbox that contains a dynamically allocated CScrollView class. After calling DoModal the dialog box and View appear fine but when I click inside the view, it crashes. I traced it down to CView::OnMouseActivate
It fails on the following line:
// eat it if this will cause activation
            ASSERT(pParentFrame == pDesktopWnd || pDesktopWnd->IsChild(pParentFrame));

Any suggestion as to how to overcome this problem. Thanks.
0
Comment
Question by:HVDC
[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 Comments
 
LVL 10

Accepted Solution

by:
RONSLOW earned 100 total points
ID: 2678619
You need to do some trickery to make a CView fit in a dialog.

CViews are made to only work within a CFrameWnd-derived class, not a CDialog. Also they require a document (hope you created one of those).

MSJ (jan 2000, C++ Q&A) is about embedding a view in a dialog (in particular a CHtmlView).  That may give you the info you need on how to tweak a CView-derived class so it will work inside a CDialog.

see http://www.microsoft.com/msj/0100/c++/c++0100.asp

0
 

Author Comment

by:HVDC
ID: 2682317
Thanks. This could have taken a while.
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

In this article, I'll describe -- and show pictures of -- some of the significant additions that have been made available to programmers in the MFC Feature Pack for Visual C++ 2008.  These same feature are in the MFC libraries that come with Visual …
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 …
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.
If you’ve ever visited a web page and noticed a cool font that you really liked the look of, but couldn’t figure out which font it was so that you could use it for your own work, then this video is for you! In this Micro Tutorial, you'll learn yo…

690 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