Solved

Modeless Dialog from OLE server

Posted on 1998-05-28
4
201 Views
Last Modified: 2013-11-19
I want to create a modeless dialog with a progress bar and a cancel button to be used in an OLE server. The ole server is a simulation engine. the progress indicator will display simulation time and the cancel button needs to end the simulation loop. I have seen modeless dialog examples similar to this but require the owner to be of a CWND baseclass. where my ole server is of base class ctarget. I think the biggest problem is how to handle  the oncancel message.
0
Comment
Question by:chrisSchell
4 Comments
 
LVL 2

Expert Comment

by:lucidity
ID: 1315676
A modeless dialog is essentially a seperate thread, when your dialog gets the WM_CLOSE it should PostMessage() to your main app then terminate. I have some code for a modeless dialog but it uses the CWnd base class, sorry.
0
 

Author Comment

by:chrisSchell
ID: 1315677
The server is not running a message pump, it is the client.
0
 

Expert Comment

by:t004024
ID: 1315678
As far as I can think U should have a CWinApp derived class which is basically a Thread, So choosing cancel in the dialog box, would basically have to terminate the other thread. So maybe U could create a user message and call PostThreadMessage from the DialogBox to U'r main thread and call ExitThread in the Message handler...
0
 
LVL 3

Accepted Solution

by:
Norbert earned 50 total points
ID: 1315679
who holds  the dialog the server or the client ?
If the server creates the dialog it also has the window so all what you want to do should be possible because you have a CWnd based class. If the Client holds the dialog the server has to provide properties methods and events so the client can update the dialog. In that case  it should not be a big problem to call a property or method of the server when the client recived an OnCancel message.
0

Featured Post

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

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: Hints for the grid button.  Nested classes, templated collections.  Squash that darned bug! Continuing from the sixth article about sudoku.   Open the project in visual studio. First we will finish with the SUD_SETVALUE messa…
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.
This tutorial demonstrates a quick way of adding group price to multiple Magento products.

758 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

23 Experts available now in Live!

Get 1:1 Help Now