Solved

Modeless Dialog from OLE server

Posted on 1998-05-28
4
212 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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
repeatSeparator  java  challenge 13 58
lucky13 challenge 11 154
post4 challenge 28 104
withoutTen challenge 14 131
This is to be the first in a series of articles demonstrating the development of a complete windows based application using the MFC classes.  I’ll try to keep each article focused on one (or a couple) of the tasks that one may meet.   Introductio…
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…
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 video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.

861 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