Solved

MFC-DLL State

Posted on 1998-09-08
2
286 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
  • 2
2 Comments
 
LVL 1

Accepted Solution

by:
Andy_Keys earned 100 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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

Suggested Solutions

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: Displaying information on the statusbar.   Continuing from the third article about sudoku.   Open the project in visual studio. Status bar – let’s display the timestamp there.  We need to get the timestamp from the document s…
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.
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…

815 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

8 Experts available now in Live!

Get 1:1 Help Now