Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

MFC-DLL State

Posted on 1998-09-08
2
Medium Priority
?
291 Views
Last Modified: 2013-11-20
I created an MFC DLL which will be launched on a thread from a Driver. The Window of the DLL is made Modal by using RunModalLoop().

But the following chunk of code is giving Access Violation

CMainFrm::OnClose()
{
  //My Processing
  EndModalLoop(0);
  CFrameWnd::OnClose()
}

The access violation is due to the DestroyWindow() in       CFrameWnd::OnClose(). The function ContinueModal is failing because the MainFrame exists no more.

Can anyone help me?
0
Comment
Question by:ysbhushan
[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 Comments
 
LVL 1

Accepted Solution

by:
Andy_Keys earned 200 total points
ID: 1321919
I assume you tried swapping the lines of code!
i.e. CFrame::OnClose(); before EndModalLoop(0);
0
 
LVL 1

Expert Comment

by:Andy_Keys
ID: 1321920
Sorry, Should have posted this as a comment not an answer
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

Introduction: Dynamic window placements and drawing on a form, simple usage of windows registry as a storage place for information. Continuing from the first article about sudoku.  There we have designed the application and put a lot of user int…
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.
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…

660 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