How to set GUI thread parent window?

How to set GUI thread parent window?

CWinThread* m_pThread = AfxBeginThread(RUNTIME_CLASS
CMyGUIThread),THREAD_PRIORITY_NORMAL,NULL,CREATE_SUSPENDED);
???
m_pThread->ResumeThread();

0
yqin_99 (193)
8/3/2006 10:08:37 PM
vc.mfc 33608 articles. 0 followers. Follow

5 Replies
424 Views

Similar Articles

[PageSpeed] 41

kathy wrote:
> How to set GUI thread parent window?
> 
> CWinThread* m_pThread = AfxBeginThread(RUNTIME_CLASS
> CMyGUIThread),THREAD_PRIORITY_NORMAL,NULL,CREATE_SUSPENDED);
> ???
> m_pThread->ResumeThread();
> 

Sorry, but threads do not have a parent window.  Perhaps if you try and 
explain the problem you are trying to solve you can get more helpful 
answers...

-- 
Scott McPhillips [VC++ MVP]

0
Scott
8/3/2006 11:29:00 PM
My main application is a SDI application which call a dll to display a
Dialog Box. I am only working on the dll part( I do not have the main
application code).

The dialog box must be a modeless dialog which should show in the
following DLL interface:


INT ShowDialog()
{
  //show dialog


  return dialog_box_exit_code



}


For Modal Dialog Box , it is easy:
INT ShowDialog()
{
  CMyDialogBox dlg;

  return dlg.DoModel();



}


BUT for Modaless Dialog, How to do this?
INT ShowDialog()
{
  //Create a Modaless dialog box;
  CMyDialogBox *pDlg = new CMyDialogBox;
  pDlg = Create (IDD_MyDIALOG);
  pDlg->ShowWindow (SW_SHOW);

  //Wait for pDlg_Exit_Code. What to do here?


  return pDlg_Exit_Code;

0
yqin_99 (193)
8/4/2006 2:49:40 PM
kathy wrote:
> My main application is a SDI application which call a dll to display a
> Dialog Box. I am only working on the dll part( I do not have the main
> application code).
> 
> The dialog box must be a modeless dialog which should show in the
> following DLL interface:
> 
> 
> INT ShowDialog()
> {
>   //show dialog
> 
> 
>   return dialog_box_exit_code
> 
> 
> 
> }
> 
> 
> For Modal Dialog Box , it is easy:
> INT ShowDialog()
> {
>   CMyDialogBox dlg;
> 
>   return dlg.DoModel();
> 
> 
> 
> }

In the modal case the function does not return and the calling 
application GUI is disabled while the dialog is displayed.  That is the 
way modal dialogs are supposed to work.

In the modeless case the function must return immediately after creating 
  the dialog so the calling application GUI can continue to operate. 
Your desire to return an exit code from the modeless dialog creation 
function is inconsistent with the behavior of modeless dialogs.  You 
can't do that if you want modeless behavior.  You should, instead, 
generate an event to the application when the modeless dialog is closed.

-- 
Scott McPhillips [VC++ MVP]

0
Scott
8/4/2006 3:38:23 PM
I have tried:

 INT ShowDialog()
 {
   //Create a Modaless dialog box;
   CMyDialogBox *pDlg = new CMyDialogBox;
   pDlg = Create (IDD_MyDIALOG);
   pDlg->ShowWindow (SW_SHOW);


  Dlg_Done_Event = ::CreateEvent(NULL,TRUE,FALSE,NULL);
  ::WaitForSingleObject(Dlg_Done_Event,INFINITE);


   return pDlg_Exit_Code;
 } 


But this even block the dialog to show up. How to do that?

0
yqin_99 (193)
8/4/2006 4:59:20 PM
kathy wrote:
> I have tried:
> 
>  INT ShowDialog()
>  {
>    //Create a Modaless dialog box;
>    CMyDialogBox *pDlg = new CMyDialogBox;
>    pDlg = Create (IDD_MyDIALOG);
>    pDlg->ShowWindow (SW_SHOW);
> 
> 
>   Dlg_Done_Event = ::CreateEvent(NULL,TRUE,FALSE,NULL);
>   ::WaitForSingleObject(Dlg_Done_Event,INFINITE);
> 
> 
>    return pDlg_Exit_Code;
>  } 
> 
> 
> But this even block the dialog to show up. How to do that?

You keep asking how to do something that is illogical and 
self-contradictory.  You have to change the goal, not the method.

-- 
Scott McPhillips [VC++ MVP]

0
Scott
8/4/2006 5:53:46 PM
Reply:

Similar Artilces:

WM_QUERYENDSESSION and saving data through a worker thread
Hello I have an application that uses a worker thread to save/load data. I'm wondering what is the best reaction to WM_QUERYENDSESSION in my case. I have to possible scenarios: 1. When WM_QUERYENDSESSION comes fire the thread and wait for it to end. Only then return TRUE from WM_QUERYENDSESSION handler. The problem is that I will get nusty dialog that my application "is not responding". 2. When WM_QUERYENDSESSION comes fire the thread and return FALSE from the handler. When thread is done force application to end. But this way I will probably prevent Windows from closing,...

How to Hide Left Panel of Folder Window?
I'm well behind the Windows curve and I'm just now learning to use Windows XP Home. Up to now I've been using Windows 2000 Pro. On my XP desktop I have a shortcut to my music folder which containins my MP3 files. When I double click on the shortcut, a window opens on the desktop displaying the contents of my music folder. This window has a panel along the left side containing items like "File and Folder Tasks" and "Other Places." I can't figure out how to close, hide or otherwise delete this panel. This panel takes up a lot of prec...

New message opens up behind outlook window
Everytime I click new in my inbox to open a new message, the new message pops up behind the main oulook window. does anyone know how to make this stop? ...

Can't install windows updates on SBS 2003
I have a SBS 2003 server that has not been updated in a couple years. It has SP2 installed but when I run Microsoft Update it needs to download and install 96 updates. When I try to get them installed it comes back with an error saying not enough disk space. I have tried to just install 1 update at a time and get the same error. The C:\ drive has over 14GB of free space and the other drives have plenty of space as well. I restarted the server and also ran Disk Cleanup, as the error message reccomends, but am still having the same problem. Anyone run across this problem befo...

how can i set up my pop and smtp account using proxy server in ou.
"Abhishek" <Abhishek@discussions.microsoft.com> wrote in message news:90EE645B-97D9-4145-A368-E26743C547F9@microsoft.com... You'll need instructions from your ISP. -- Aloha, -Ben- Ben M. Schorr, OneNote-MVP Stockholm Consulting Group/KSG http://www.scgab.com Microsoft OneNote FAQ: http://home.hawaii.rr.com/schorr/computers/onenotefaq.htm **I apologize but I am unable to respond to direct requests for assistance. Please post questions and replies here in the newsgroup. Mahalo! ...

Outlook and Windows Integrated Authentication
Hello All, Does anyone know if Outlook (not OWA) can use Windows Integrated Authentication (like IE) to automatically log onto Intranet Web sites to retrieve graphics in HTML messages? Right now we get a logon dialog and have to manually log in. Thanks. if you paste the url into a browser, does it work as desired? -- Diane Poremsky [MVP - Outlook] Author, Teach Yourself Outlook 2003 in 24 Hours Coauthor, OneNote 2003 for Windows (Visual QuickStart Guide) Need Help with Common Tasks? http://www.outlook-tips.net/beginner/ Outlook 2007: http://www.slipstick.com/outlook/ol2007/ Outloo...

Setting Outlook settings to new server
We are in the process of moving mailboxes to a new server. Is there a utility or ad policy to automatically configure outlook to point to the new exchange server? Instead of manually configuring the users outlook profile. On Tue, 21 Nov 2006 11:15:01 -0800, Rich <Rich@discussions.microsoft.com> wrote: >We are in the process of moving mailboxes to a new server. Is there a utility >or ad policy to automatically configure outlook to point to the new exchange >server? Instead of manually configuring the users outlook profile. If you are moving the mailboxes in the same org vi...

Integrating Great Plains 8.0 and CRM 1.2 and Windows Small Busines
Integrating Great Plains 8.0 and CRM 1.2 I run a Windows Small Business Server 2003 Premium box along with a Windows Server 2003 Standard box used for my Great Plains 8.0 and SQL 2000. I’m considering introducing CRM 1.2 Professional into the mix. From a hardware stand point I know I’m fine all around. I’ve been researching how I should configure CRM and am a bit confused. The info I’ve found in KB887153 states “When you install Microsoft Business Solutions CRM Integrations for Great Plains 7.0, 7.5, or 8.0, Microsoft BizTalk Server is also installed. However, BizTalk Server 2000 and B...

Can Outlook 2003 use MSN Messenger INSTEAD of Windows Messenger?
I didn't get an answer to this question last week so I'm re-posting... I recently purchased a new computer (Windows XP Home Edition w/SP2) and loaded up all of the available updates to the OS, Internet Explorer, etc. Next, I installed Office 2003 Professional. I disabled Messenger integration with Outlook 2003 as discussed in other posts here. Next I installed MSN Messenger 6.2 and it seemed to run properly as a stand-alone application. So I re-enabled Messenger integration on Outlook 2003. The next time I booted up and ran Outlook, the Messenger icon appeared in the taskbar...

Windows media player
Why does windows media player keep popping up? David wrote: > Why does windows media player keep popping up? OK, I give up. Why does Windows Media Player keep popping up ? How to ask a question http://support.microsoft.com/kb/555375 Windows Media Player General Discussion http://www.microsoft.com/communities/newsgroups/en-us/default.aspx?dg=microsoft.public.windowsmedia.player&cat=en_US_44d7101f-71dd-4f9a-b6b9-45215557dd35&lang=en&cr=US MowGreen ================ *-343-* FDNY Never Forgotten ================ banthecheck.com "Security update...

Task Manager window only CPU
Vista Ultimate SP2 When I launch Windows Task Manager, only a CPU meter opens. When I right click icon in task bar, I only get Close & Always on top options. How do I restore task manager? Happy New Year -- ***************** John Lenz JohnLenz@comcast.net Double click on the white frame of the task manager window. That should do it. -- whs THX - it worked Happy New Year -- ***************** John Lenz JohnLenz@comcast.net "whs" <guest@unknown-email.com> wrote in message news:89eee91dbeee8173c55e0008be25b622@nntp-gateway....

URGENT: WINDOWS 8 ANNOUNCEMENT for July 2011!
Think Windows7 just came out & too young? Welcome to the brave future: Windows8! 1) Windows 8 To Contain New Anti-Ha*king Software (antipir*cy). Some may consider anti-pir*cy measures similar to whistling in the wind, but that's certainly not the case. George has posts in Windows7NewsDOTcom, and ConnectedInternet showing how in many cases Microsoft has foiled anti-pir*cy efforts. Many believe that piracy is relegated to just illegal copying or theft. But that is not the case. V*rus distribution and embedded malw*re, and privacy intrusion are typical features that result from...

email address on Service Call Entry window
Add an email address field to the Service Call Entry window for the customer contact on the service call. Even if it is not pulled from the email address of the address id on the service call, at least the dispatcher could enter an email address on the service call in order to communicate with the customer regarding the call. It is common to take email address as part of contact information. ---------------- This post is a suggestion for Microsoft, and Microsoft responds to the suggestions with the most votes. To vote for this suggestion, click the "I Agree" button in the m...

Paper settings change for specific printer
I just installed access 2007 and my application uses reports to print labels. Specifically a Dymo turbo 400 and 30252 address labels. when i was using acess 2003 i specified to use a specific printer and everything was great. and when i copied updated FrontEnds to my networked computers every thing transfered and the labels printed fine however with 07 the "Specifc printer" has a different page size.. i fixed all the reports on my master FE but the changes didnt stay when i copied FE to other computers and im not sure where to go. i installed all the printers from the s...

outlook in sub-domain to set use root-domain question!!!
Dear Sir Please see below more details,(We are using special railway line between Head office in Taipei and branch office in Tao-Yuan) Head office in Taipei: aaa.com(Root domain) Dc server * 2(One of it is GC Server), Front-End Exchange 2003 *1, Back-End Exchange 2003 * 2(One is named mail1, another is named mail2 ) Branch office in Tao-Yuan: bbb.aaa.com(sub-domain) Dc Server *1(No GC Server,No Exchange Server) After using ADMT v3 Tool, when I transfer an account from root named aaa.com(ou) to bbb.aaa.com. After I ins...

Setting the default font and font size for Excel comments
Hi, Do you know how to set the default font and font size in Excel for the cell 'Comments'? I have looked in Options as well as in the registry to see if I can change the default from Tahoma (size 8) to another (i.e. Arial size 12). Your help would really be appreciated. Thanks, Clint - UK ...

Windows Update Office 2007 Converter confusion
On my desktop I have Office 2003 (laptop has Office 2007). I recently received an attachment in .docx format (2007). I downloaded the converter to my desktop and opened the document. Now on my desktop (which has Office 2003) I receive update notices for Office 2007. Should I ignore these? Hide them? Install them? Will I still be notified re updates needed for Office 2003? Thank you for whatever insight you can provide. If you can give me some of the background explanation as to why this is happening (I presume related to the 2007 converter viewer install), I can understand bett...

Can I set SQL mirroring across WAN?
We have a 100 Mb dedicated DR link to another data center. Want to set up a SQL 2008 database to use mirroring from primary to a standby server at the remote data center. I did a ping test and here is the result. ping -n 100 -l 5120 <target IP> Ping statistics for <target IP> Packets: Sent = 100, Received = 99, Lost = 1 (1% loss), Approximate round trip times in milli-seconds: Minimum = 8ms, Maximum = 19ms, Average = 11ms is the network latency good enough for database mirroring? Does anyone know the min. requirement? Field experience will be fine too....

Windows XP SP2
Has anyone else noticed that after installed Windows XP SP2, emails in Outlook sit in the Outbox for several "noticable" seconds before sending. Sam <anonymous@discussions.microsoft.com> wrote: > Has anyone else noticed that after installed Windows XP > SP2, emails in Outlook sit in the Outbox for > several "noticable" seconds before sending. I believe I saw this documented on the Microsoft web site. -- Brian Tillman ...

Code about setting Y Axes scale.
I couldn't understand the lines between 35-42, why he thought the dbMinScale after the change is the one he want. What the logic of this code section. Any one who could understand please help me. thanks in advance!:) Private Sub USP_SetYAxesScal(ByVal i_strWSName As String, ByVal i_strChartName As String, Optional ByVal i_intDecimal As Integer = 2) Dim dbMaxScale As Double, dbMinScale As Double, i As Integer, j As Integer Dim xTargetChart As Chart, vTemp() As Variant, blnInit As Boolean, dbMax As Double, dbMin As Double 1 On Error Resume Next 'get max/m...

Office 2007 on Windows 7
I just purchased a new laptop with Windows 7. I also purchased Office 2007 but I notice that Windows 7 is not shown on the Office package. Can I install Office 2007 without any propblems? Answered your first posting. apensa wrote: > I just purchased a new laptop with Windows 7. I also purchased Office 2007 > but I notice that Windows 7 is not shown on the Office package. Can I > install Office 2007 without any propblems? ...

How do I set up mixed page orientations in Publisher 2003?
I'm trying to create a duplex publication where one side is in portrait and the reverse is in landscape. I've tried looking in the halp and through all the menus but it seems that I can only have one or the other. Can anybody help? Publisher (any version) does not support this. The workaround most frequently offered is to design your landscape page, group the all the objects, then rotate 90 degrees. -- Brian Kvalheim Microsoft Publisher MVP http://www.publishermvps.com This posting is provided "AS IS" with no warranties, and confers no rights. "T. Mitchell"...

Volume License copy of Windows Server
Gurus, Is there anyway anymore to get a full Volume License copy of Windows Server (e.g., version 2008) which does NOT require Internet activation? -- Spin Start with Vista/Windows 2008, your options to activate are by Internet or Phone. I believe the command that kicks it off is: slui.exe 4 "Spin" <Spin@invalid.com> wrote in message news:84nk89Far1U1@mid.individual.net... > Gurus, > > Is there anyway anymore to get a full Volume License copy of Windows > Server (e.g., version 2008) which does NOT require Internet activation? > ...

Setting Text in a ComboBox
Hi, Does anybody know why I cannot set the text in the edit control of a CBS_DROPDOWN style CombBox control using SetWindowText()? I was able to change the text in the edit control part of the ComboBox manually. Thanks, Vincent. I don't know why can't you? Post some code. You should be able to m_MyCombo.SetWindowText("The Text"); Ali R. "Vincent Yu" <anonymous@discussions.microsoft.com> wrote in message news:5e2b01c3ad48$5309d630$a601280a@phx.gbl... > Hi, Does anybody know why I cannot set the text in the > edit control of a CBS_DROPDOWN style ...

setting up a book cover?
I've been reading about this, the only directions I could find for doing it is how to set up a book (for pubish on demand, mainly) in WORD. This has a very brief discription of how to to set up the cover design (if one has no choice) in Word. Since I have Publisher (2000) I'm thinking that would be better, of course. I don't have a specific book and cover in mind, just would like to learn to do it. The directions for Word has how to set up the measurments, with extra on the edges for "bleed" and figuring the space for the spine (going by pages in the book...