Solved

MFC-DLL State

Posted on 1998-09-08
2
282 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
Comment Utility
I assume you tried swapping the lines of code!
i.e. CFrame::OnClose(); before EndModalLoop(0);
0
 
LVL 1

Expert Comment

by:Andy_Keys
Comment Utility
Sorry, Should have posted this as a comment not an answer
0

Featured Post

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
if loop in java 3 114
isEverywhere  challenge 19 62
Window placement 17 64
Making an alias 7 51
Introduction: Ownerdraw of the grid button.  A singleton class implentation and usage. Continuing from the fifth article about sudoku.   Open the project in visual studio. Go to the class view – CGridButton should be visible as a class.  R…
Introduction: Database storage, where is the exe actually on the disc? Playing a game selected randomly (how to generate random numbers).  Error trapping with try..catch to help the code run even if something goes wrong. Continuing from the seve…
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.
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

771 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

10 Experts available now in Live!

Get 1:1 Help Now