Solved

CScrollView in Modal Dialog Box

Posted on 2000-04-02
2
657 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
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

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

Suggested Solutions

Here is how to use MFC's automatic Radio Button handling in your dialog boxes and forms.  Beginner programmers usually start with a OnClick handler for each radio button and that's just not the right way to go.  MFC has a very cool system for handli…
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.
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.

747 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now