popup dialogs in mfc activeX

Hi,
I tried using PreModalDialog() and it didn't help.

Let me attempt to explaining the scenario better.
I am writing an ActiveX control. Class A is the control class that creates a
socket and listens asynchronously. The message handler function for this
Socket is a member function of Dialog A.

So when there is a connection request from a client, the message handler
function is invoked.

I basically want to

1. accept the conection request.
2. read the incoming message.
3. popup a yes/no Dialog B
4. based on yes/no send true/false back to the client and disconnect the
client.
5. Start asynchronous listening again.

I am able to do 1,2,4 and 5. Am not able to do 3.

I am able to popup Dialog B from a member function of the control class
(Class A) if that member function is invoked directly from the webpage
through an interface function.

But when DoModal() on Dialog B is called from this message handler function
(which is a function of Dialog A class), it just doesn't do it.

Please help.

Regards,
Satheesh

"Scott McPhillips" <scottmcp@mvps.org> wrote in message
news:3F3958B1.FF873AB2@mvps.org...
> Satheesh wrote:
> >
> > Hi All,
> > Here is the scenario.
> >
> > There is an ActiveX control called the Listener. This is embedded in a
web
> > page
> > There is a web service say ClientWS
> >
> > The ActiveX when loaded creates a server socket and listens for incoming
> > connections. I am using WSAAsysncSelect and thus it is a non-blovking
server
> > socket.
> >
> > Say the class representing the ActiveXcontrol is CListenerCtrl. The
> > above-mentioned server socket is created in a function called
> > StartListening() of this class.
> >
> > I have created a dialog from the VC++ 6.0 resource tab. I use this to
handle
> > the Async messages. Lets say the class representing this is
> > CMsgHandlerDialog. There is a function called MessageHandler in this
class.
> > When there is an incoming request from a client (in my case, the web
> > service), an asynchronous message is received and control goes to the
> > MessageHandler() function of the CMsgHandlerDialog. That in turn calls
the
> > HandleAsyncAccept() method of the CListenerCtrl class.
> >
> > HandleAsyncAccept() basically calls the accept() fucntion and reads from
the
> > socket.
> >
> > Everything until this point happens fine.
> >
> > At this point, I want to pop up a window with an yes/ no option.Lets say
> > that dialog is CAcceptDlg.
> >
> > In HandleAsyncAccept(), I do the following\
> > CAcceptDlg acceptDlg;
> >  acceptDlg.DoModal();
> >
> > IT DOES NOT POPUP THE DIALOG
> > Why am I not able to pop up this dialog???
> >
> > But if I am able to popup this dialog from StartListening().
> >
> > Any pointer would be appreciated.
> >
> > My thinking is that this could be something to do with opening a dialog
from
> > a message handler dialog.
> >
> > Regards,
> > Satheesh
>
> It could be something to do with ActiveX.  Have a look at
> PreModalDialog()
>
> --
> Scott McPhillips [VC++ MVP]



0
satheesh (5)
8/13/2003 8:54:40 PM
vc.mfc 33608 articles. 0 followers. Follow

0 Replies
778 Views

Similar Articles

[PageSpeed] 11

Reply:

Similar Artilces:

A very stranger problem about MFC
This is a multi-part message in MIME format. ------=_NextPart_000_0043_01C61C51.EAC8BA70 Content-Type: text/plain; charset="gb2312" Content-Transfer-Encoding: quoted-printable I use Timer in Clistview , But I find the timer only timeout once ? = why ? I have test vc6,vc6+sp6, vs2003 . But At last I find the timer = only timeout once .=20 It is very easy to find out the problem . USE MFC wizard to create a = project with the 'exlplore style' , you add a wm_create and wm_timer on = the right view class and add some code to test like following . int CDelete0051View...

Questions on MFC, DirectShow issues
Hi all Plz can any1 let me know the solution to any of these isssue 1. ChildFrameWnd (having 3 CView-derived classes) in a MDI-based application flickers. How do I avoid it? .. yes, I have tried returning TRUE in OnEraseBkgnd function 2. I have a avi player with a slider control (seek bar) which does not get updated as the avi file plays i.e; say a movie file is played, the seek bar does not traverse in time. I have the following code embedded void PlayerView::OnTimer(UINT nIDEvent) { PlayerDoc* pDoc = GetDocument() LONGLONG lPosition = 0 LONGLONG lDuration = 0 pDoc->m_pMediaSeek...

Handling Popup Menu Commands in Parent ?
Hi guys, I have a CWnd-derived child window that has a popup menu (when you right click), I want to handle some (not all) of those menu commands in the parent. I can get the parent to handle them by using GetParent() in TrackPopupMenu() but then the child can't handle any. If it's a big pain I can handle them all in either the child or the parent but maybe it's pretty easy to do ? Thanks. R. I did it like this: // My Cwnd-derived custom view BOOL CLayoutView::OnCmdMsg(UINT nID,int nCode,void* pExtra,AFX_CMDHANDLERINFO* pHandlerInfo) { // let child have first crack at ...

password popup
HI, I'm using Outlook 2002 and every time i open it password window pops up. I tried everything. I changed my password with ISP, i went to the settings and verified name,password and every imaginable combination i could think of. i even went to security settings and set my privacy to low and i still get the same password pop up.Any help would be appreciated. Thanks Check you connection settings. Are they set to manual? If so, it will prompt you for your password. Check under tools email accounts and be sure the connection type is set to automatic Vickie >-----Original Messa...

How To: copy dialogs from one project to another ?
Do you know how to copy a dialog used in one project to a new project, can I do this from outside IDE just copy files from one directory to another ? or do I need to copy manually inside IDE. Thanks in advance for your help, Eduardo Tom Serface wrote: > > don't mess up the original. I do this all the time and it works really > well. Do you do it with VS .NET 2003? If you do, great, because it just means my installation is broken in some way. If you don't, I suspect that if you migrate to .NET 2003, you'll swear at it and stamp your foot as much as I did when I fo...

Paint problem with child dialogs and tab control
Hi, I have a main dialog that has a tab control. For each tab, I have a child dialog. The problem is that the tab control's color isn't solid (with XP styles), so if I use COLOR_WINDOW for the child window, it will not take the gradient pattern of the tab control. How can I manage to make this work? Thanks! :) U�ytkownik "Luc" <l_vandal@hotmail.com> napisa� w wiadomo�ci news:yKEnb.2971$Nm6.194226@news20.bellglobal.com... > Hi, > > I have a main dialog that has a tab control. For each tab, I have a child > dialog. The problem is that the tab control...

GetWindowRect on Embedded Dialog
I have a main dialog and an embedded dialog whose parent is a frame on the main dialog. I have a simple tree view control on the embedded dialog. When I do a GetWindowRect( &rect ) on the tree control, I get the rect of the control in reference to the MAIN dialog and I use the "Top" and "Left" values so I can resize the control in proportion to the frame on the main dialog while leaving the top and left position the same. Here is my question: When I do SetWindowPos(x,x,x,x,SWP_SHOWWINDOW) on the tree control, it appears to use the "Top" and "Left"...

File Dialog in access 2007 01-11-10
Im having problems with the following code in access 2007. I'm trying to open a file dialog to place an image into a form. Any help would be appreciated Reghards Rob. Sub getFileName() ' Displays the Office File Open dialog to choose a file name ' for the current id record. If the user selects a file ' display it in the image control. Dim fileName As String Dim result As Integer With Application.FileDialog(MsoFileDialogOpen) .Title = "Select Picture" .AllowMultiSelect = False .Filters.Clear...

How to support clickable URL in the balloon popup from systray icon
Hi, I am working on a project which creates a sys tray icon and occasioanlly pop up ballooon message. The project is in VC++. As per our product requirement, this pop up should support clickable URLs as well, to which I am facing difficulty. I tried adding href tags to the URL, but it is showing up as plain text. Is there any way by which I can support this feature. It would be of great help, if anyone can suggest me a solution to this. Thanks in advance, Anu You will have to display the balloon yourself. Here is a an example that does have link capabilities built-in http://www.codeprojec...

Popup required
For a longish macro (made up of a few smaller macros), what is a simple way of displaying a message box saying "operation in progress, etc", and then when the macro has finished, another message box with an OK button saying "operation completed"? For the first requirement, just create a UserForm with the appropriate message on it (I use one called 'frmWaitMsg' that just says "Building Document - Please wait...") and make sure its ShowModal property is set to false. This will allow code to run while the UserForm is displayed. Show the f...

I keep getting dialog box is open error in Word 2003.
Everytime I go into MS Word I get an error that says my dialog box is open. I have to click ok then I can go in. How can I get rid of this error? Disable the Office Plug-in option in Norton Antivirus (or other AV that you may be using). -- Terry Farrell - MSWord MVP "Tracey F" <Tracey F@discussions.microsoft.com> wrote in message news:01911FF2-10AB-43A6-9BBB-4E630A886D38@microsoft.com... > Everytime I go into MS Word I get an error that says my dialog box is > open. > I have to click ok then I can go in. How can I get rid of this error? ...

Migrating an mfc application
Hi, I am developing a tool in C# for the Project "Migrating an mfc application from windows 2000 to Windows 2003" in which if you are giving your application developed in windows 2000 as input then it will scan through the code in your application and find out the functions which are changed (parameter changes or deprecated) for the windows 2003 and list those functions. For that I would like to know the list of mfc function's that have obsolete and also changed in Windows 2003(but present in Windows 2000). Could you please furnish Additional URL's for our reference...

how to set a window to back in vc6
Hi Folks, I am currently looking for a solution to set a windows processor to back. Basically the window (child processor)is careated by its pararent process and by default it sits in front of of its parent window. However, I want to set it in the back of the parent window after launch. Any suggestion and comments? Thanks very much in advance! Bing If you are using a Dialog, then try modeless dialog. i.e Call Create method and then ShowWindow. If it is not then you can use SetWindowPos HTH -- _____________________ Ashok K Kumar ashokkal at gmail dot com "Bing Wu" <bing@biop....

Progress Dialog, Worker Thread Problem
Hi, In my Document I have a lengthy process, which I try to run in a worker thread, with a modal dialog box showing progress. Like this: void CFDocument::OnExportXXX() { if( m_cExportXXXDialog.DoModal() == IDOK ){ m_bExporting = TRUE; THREADPARMS* ptp = new THREADPARMS; ptp->pMainFrame = (CMainFrame*)AfxGetMainWnd(); ptp->pDoc = this; ptp->pProgCtrl = &(m_cProgressDialog.m_ctlProgress); AfxBeginThread(RunExportXXX, ptp); m_cProgressDialog.m_sProgressText = "Exporting to XXX..."; m_cProgressDialog.DoModal(); } } UINT RunExportXX...

popup
The following shutdown script calls up an .hta correctly. Then the script correctly pops a requester in front of the .hta seeking a response, or will time out. The second popup resulting from timing out or the user interacting, pops UNDER the .hta instead of in front. I want that second popup in front. Help? =-=-=-=-=-=-=-=-=-=- begin .vbs =-=-=-=-=-=-=-=-=-=- Option Explicit Const gcVERBOSE = FALSE ' ### TRUE for testing Dim objShell Set objShell = Wscript.CreateObject( "Wscript.Shell" ) Sub sTerminate( strReason ) If gcVERBOSE Then Wscript.Echo no...

Dialog-Editor Control zur�ckholen
Hallo NG, ich hab ausversehen meinen Edit Control in der Toolbar im Dialog-Editor gel�scht. Jetzt krieg ich ihn nicht wieder. Rechte Maustaste->Men�punkt "Elemente hinzuf�gen" hilft mir leider nicht weiter, da passiert nichts, wenn ich dann was ausw�hle. Wie krieg ich meinen Edit Control wieder? Danke f�r Hilfe, Guido Franzke > ich hab ausversehen meinen Edit Control in der Toolbar im Dialog-Editor > gel=F6scht. Jetzt krieg ich ihn nicht wieder. Rechte Maustaste->Men=FCpun= kt > "Elemente hinzuf=FCgen" hilft mir leider nicht weiter, da passiert nichts, &...

Implementing 3-Tabs to Existing Dialog Project
I have an application (MFC dialog type) that needs to be modified. The current app provides the customer a type of "Test" to be performed. As part of an Add-On, I want to add a 3-tab control (CPropertySheet & CPropertyPage) where the existing "Test 1" is done on tab 1. Then I will add a "Test 2" & "Test 3" on Tab 2 and Tab 3. The user can choose which "Test" to do based on selecting the proper Tab. I created the CMyPropertySheet along with the 3-Tabs (CTab1, CTab2, CTab3). The problem is this. Right now the 3-tab di...

adding a date popup box
Hi, is it possible: instead of writing a date manualy in a cell, to open combo box (pop up) and choose the date ? can i do that in excel ? -- Message posted from http://www.ExcelForum.com Hi see: http://www.rondebruin.nl/calendar.htm -- Regards Frank Kabel Frankfurt, Germany > Hi, > > is it possible: instead of writing a date manualy in a cell, to open a > combo box (pop up) and choose the date ? can i do that in excel ?? > > > --- > Message posted from http://www.ExcelForum.com/ Frank, I've used your website in the past & it is extremely helpful. Ho...

Visual Studio 2003 MFC extention dll with VC6 Extention Dlls. #3
I have MDI application compiled in VC6 (MFC42). It dynamically loads MFC extention dlls (plug-ins), so every dll can add it's own menu to main window, create toolbars..... I want to give support to my customers to develop plug-ins in Visual Studio 2003, but I have to keep backward competability to plug-ins compiled in VC6. Once I added MFC extention Dll compiled with 2003 that creates dockable window, i got lot of ASSERTs and it could work. ASSERT(pBar->m_pDockSite != NULL); is one of them. Is it possible to have 2 MFC extention dlls from different MFC versions in same MDI application...

popup menu
hi, i finally tryied with a popup menu but i have a problem. i popup it with TrackMenuPopup and i create it from a ressource. but it doesn't look as it should. i d'ont have the names of the menu categories, only a small rect appears but with nothing wrote in. when i pass on with the cursor, it popup the sub-menu quite far from the small rect, but the submenu is good looking. if someone knows what can causes that, it would help a lot, thanks, -- Lucas "ouech" <loucs_93@nospamhotmail.com> wrote in message news:opsohwh1fhozxxof@loucs... > > hi, > > i fi...

CPropertySheet create failing when adding to dialog box
Hi all, I am having problems with a class that I made that inherits from CPropertySheet. I need to add this class to a dialog box with the following code: m_appPropSheet.AddPage(m_saleIllustrationPropPageClientOne); m_appPropSheet.AddPage(m_saleIllustrationPropPageClientTwo); m_appPropSheet.Create(this, WS_CHILD | WS_VISIBLE, 0); m_appPropSheet.EnableStackedTabs(FALSE); m_appPropSheet.ModifyStyleEx (0, WS_EX_CONTROLPARENT); m_appPropSheet->ModifyStyle(0, WS_TABSTOP); m_appPropSheet.SetWindowPos(NULL, 0, 25, 0, 0, SWP_NOZORDER | SWP_NOSIZE | SWP_NOACTIVATE); ...

Popup a message when query finished
I have a form that has a command button with code that updates 7 tables by a series of 7 queries. Is there any way to popup a message box to indicate to the user that all the queries have run successfully and they can move on? Although it happens very quickly there is no visual evidence to the user that the query is running or finished. Thanks Tony -- Why don't my grey cells communicate with each as fast as they used to? I hate getting old! Message posted via AccessMonster.com http://www.accessmonster.com/Uwe/Forums.aspx/access-modules/201002/1 Yes, you can put a Msgbox...

Popup when opening Outlook
When I open Outlook I get a popup that says, "A program is trying to access e-mail addresses you have stored in Outlook. Do you want to allow this?" Whether I click Yes or No the popup just stays there and keeps repeating itself. I can't put anything into access. How do I make it go away? -- Slimpicks Youve scanned your PC for malaware, trojans & viruses? Not all AV apps detect malaware/trojans, for these you need specific apps "Slimpicks" <Slimpicks@discussions.microsoft.com> wrote in message news:C3DE15EC-10E9-4297-BAB8-EE3CE44CF4AF@microsoft.com... ...

Is there a way to send a user message to any of app's active dialogs?
I have an app that receives external HW-driven events, and I need to pass that information along to any of a number of dialogs that may be active when the event occurs (there can only be one active at any given time). I thought some version of PostMessage would work, but I can't get it to work. It does work if the dialog, on initializing, passes back to the app its hWnd, and the app then uses that hWnd in PostMessage. I can use that technique if I need to, but I'm hoping there's a way for an app to post a message to an active dialog without first knowing its hWnd. Sorry if this...

How do I fix "ActiveX can't create object" in access 2003 query wi
When I try to use the query wizzard in access 2003 an error message pops up "Activex can't create object" I have already reinstalled the original program. How do I fix it? ...