|
|
If you are using the document/view architecture, look up CDocument::SaveModified() in MSDN.
|
|
|
|
|
|
WM_QUIT is not passed to any window proc (MFC or otherwise). When GetMessage() pulls a WM_QUIT out of the queue, it returns 0 to terminate the window's message loop.
--Mike--
Just released - RightClick-Encrypt v1.3 - Adds fast & easy file encryption to Explorer
My really out-of-date homepage
Sonork-100.19012 Acid_Helm
|
|
|
|
|
Greetings, coders of the world. I've come because I'm quite at the end of my rope with an MFC bug, and need help. It's the most untraceable thing I've ever come across...
Anyway, I hope I can provide enough information about it (without giving the whole program's source away) to get a solution.
I'm using VC++ 6.0 (rather than .net because of compatibility issues), and have based my program off the MDI structure. Now, _sometimes_ when I create floating modal dialog boxes, the program locks up. It only happens when the dialogs are ownerless (parent = NULL), and when they're called with the DoModal() function. It appears to vary by dialog. For a while, anything I brought up was freezing. Since then (I don't know why) the standard About dialog and various custom settings windows have begun to work. Others still don't. One baffling thing is that I override the exact same methods in two dialogs (derived from CDialog, of course), and one works while the other doesn't. I implemented, as a test, a little message responder and had it try to call one, then another, in separate compiles. No difference in calling environments that I could spot, and still only one worked.
As we're all more than familiar with, there are many ways for things to not work. What baffles me is where this one shows up... in the middle of MFC's message loop. The dialog object construct fine, but when I call DoModal(), it locks up the message loop. Specifically, this callstack:
USER32! 77e1325c()
CWinThread::PumpMessage() line 814 + 19 bytes
CWnd::RunModalLoop(unsigned long 4) line 3478 + 19 bytes
CDialog::DoModal() line 536 + 12 bytes
This is the culprit line in PumpMessage():
if (!::GetMessage(&m_msgCur, NULL, NULL, NULL))
and the program screeches to a halt (strangely) right on this assembler instruction in USER32:
ret 10h
Obviously, this doesn't help much. I can't figure out what I did elsewhere in my program that would cause the message loop to break like that. I did have a fairly large OpenGL section that messed with windows pretty heavily, but that wasn't the culprit. At first, I wrote routines that would completely shut down the OpenGL windows' message pumps whenever a modal dialog was called. It was ugly, but it worked... or so I thought. Since then, it's popped up again with different dialogs, and after ripping out the 3D system altogether (well, commenting out) to try to isolate this bug, still no change.
One last thing that might be helpful. I stepped through my dialog routines from DoModal(), but couldn't tell specifically where in the construction/display cycle the error occurred. The message loop appears to run fine for a while, but stops before the windows get around to calling PreCreateWindow().
The CDC thanks you in advance for any help you can provide.
-Christian Miller
|
|
|
|
|
I think I remember seeing somewhere that there are special message-loop considerations when using OpenGL with MFC. I'm sorry I can't be more specific, but I saw it this weekend somwehere.
------- signature starts
"...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
Please review the Legal Disclaimer in my bio.
------- signature ends
|
|
|
|
|
Okay, so it's a big bug. I squelched the OGL portion of my app, same problem. I did manage to find a program source that manages MDI OpenGL windows nicely, but there are two big 'ol problems with it:
A) It's slow.
B) It's 18000+ lines.
Not exactly ideal, especially considering the time constraints I'm under. Any other ideas?
|
|
|
|
|
Greetings, coders of the world. I've come because I'm quite at the end of my rope with an MFC bug, and need help. It's the most untraceable thing I've ever come across...
Anyway, I hope I can provide enough information about it (without giving the whole program's source away) to get a solution.
I'm using VC++ 6.0 (rather than .net because of compatibility issues), and have based my program off the MDI structure. Now, _sometimes_ when I create floating modal dialog boxes, the program locks up. It only happens when the dialogs are ownerless (parent = NULL), and when they're called with the DoModal() function. It appears to vary by dialog. For a while, anything I brought up was freezing. Since then (I don't know why) the standard About dialog and various custom settings windows have begun to work. Others still don't. One baffling thing is that I override the exact same methods in two dialogs (derived from CDialog, of course), and one works while the other doesn't. I implemented, as a test, a little message responder and had it try to call one, then another, in separate compiles. No difference in calling environments that I could spot, and still only one worked.
As we're all more than familiar with, there are many ways for things to not work. What baffles me is where this one shows up... in the middle of MFC's message loop. The dialog object construct fine, but when I call DoModal(), it locks up the message loop. Specifically, this callstack:
USER32! 77e1325c()
CWinThread::PumpMessage() line 814 + 19 bytes
CWnd::RunModalLoop(unsigned long 4) line 3478 + 19 bytes
CDialog::DoModal() line 536 + 12 bytes
This is the culprit line in PumpMessage():
if (!::GetMessage(&m_msgCur, NULL, NULL, NULL))
and the program screeches to a halt (strangely) right on this assembler instruction in USER32:
ret 10h
Obviously, this doesn't help much. I can't figure out what I did elsewhere in my program that would cause the message loop to break like that. I did have a fairly large OpenGL section that messed with windows pretty heavily, but that wasn't the culprit. At first, I wrote routines that would completely shut down the OpenGL windows' message pumps whenever a modal dialog was called. It was ugly, but it worked... or so I thought. Since then, it's popped up again with different dialogs, and after ripping out the 3D system altogether (well, commenting out) to try to isolate this bug, still no change.
One last thing that might be helpful. I stepped through my dialog routines from DoModal(), but couldn't tell specifically where in the construction/display cycle the error occurred. The message loop appears to run fine for a while, but stops before the windows get around to calling PreCreateWindow().
The CDC thanks you in advance for any help you can provide.
-Christian Miller
|
|
|
|
|
No text here, move along.
|
|
|
|
|
Hello friends,
on the bottom (z-axis) i have a CView (Fullscreen), he create a CDialog (Fullscreen), and then he (the CView) create a CDialog (quarder-screen, bottom, y-axis).
I would like to operate with the Fullscreen-dialog and the quarder-screen-dialog. I can operate with the fullscreen-dialog, but not with the quarder-screen-dialog.
At the creation of the dialogs i use this:
ASSERT(m_DlgPFkt3Zeile->SetWindowPos(NULL
, a
, b
, c
, d
, SWP_HIDEWINDOW | SWP_NOACTIVATE | SWP_NOZORDER));
I have try all parameters of SetWindowPos, but with nothing parameter i can operate with the fullscreen-dialog and the quarder-screen-dialog.
Why i don't can operate with the quarder-screen-dialog?
Thank you for your help!
PS: Sorry for my bad english.
|
|
|
|
|
This doesn't solve your z-order problems, but you should replace ASSERT with VERIFY.
Tomasz Sowinski -- http://www.shooltz.com
- It's for protection - Protection from what? Zee Germans?
|
|
|
|
|
I want to create a simple word
processor with a page break. Any
ideas on how to do this? Anyone
know of any sample projects with
this feature?
Please, any response any one can
give me will be greatly appreciated.
Sincerely,
Danielle (an overworked graduate student)
|
|
|
|
|
ms ships the source code to wordpad i think on the vstudio disks ... might be as a good a place as any to look
"... and so i said to him ... if it don't dance (or code) and you can't eat it either f**k it or throw it away" sonork: 100.18128 8028finder.com
|
|
|
|
|
I have to develop an user interface that must be shown in monitor
with different resolutions (800 X 600 or 1024 X 768).
How can I do to let this interface automatically resize in order to
avoid the use of scroll bars (in case of small monitor size)
and to avoid leaving free space (in case of big monitor size)???
Thanks a lot
|
|
|
|
|
depends on the type of app ... am assuming a dialog app so you could maybe simply make two dialog box templates and load whichever one was reqd ... that way u could avoid all the icky movable layout stuff
"... and so i said to him ... if it don't dance (or code) and you can't eat it either f**k it or throw it away" sonork: 100.18128 8028finder.com
|
|
|
|
|
You can make your app to handle WM_DISPLAYCHANGE message and use GetSystemMetrics() to get the screen size.
To resize your window, either you can maximize it, or in a dialog base app, use CResizeCtrl by Herbert Menke http://www.codeproject.com/dialog/resizectrl.asp[^]
Hope this will help
Allen
|
|
|
|
|
Thanks a lot!! But what about if I have a MDI or a SDI app ???
Is it the same ???
|
|
|
|
|
You can handle the WM_SIZE message and move your dialog controls to fit the space defined by GetClientRect.
Michael
Time flies like an arrow. Fruit flies like a banana
|
|
|
|
|
I know it's not supported with the Classwizard, but is there a way to tie a class function to several objects, and have a pointer to the "clicked" object passed to the function?
I have ten rows (exact copies) on a dialog form, and i'd like to have one univeral function for each column, instead of ten seperate functions for each object. If a pointer to this object was passed, I could easily do everything I need within this one function.
I've had this ability in other GUI packages. Maybe I'm just spoiled and this can't be done here. I'm just trying to streamline my code.
Any help is appreciated.
Todd Krzeminski
tkrzeminski@nlxcorp.com
|
|
|
|
|
Try ON_CONTROL_RANGE.
Tomasz Sowinski -- http://www.shooltz.com
- It's for protection - Protection from what? Zee Germans?
|
|
|
|
|
i have a socket client-server. some users are paid, some not.
i want to divide them into 2 group and give paid cust higher priority, can u give me some suggestions in tech?
thx
includeh10
|
|
|
|
|
presumably you are storing user_id type data in a db somewhere if people are paying to use the service so just include a field in the db that they paid and at logon set the priorities / act on the priorities when they connect
"... and so i said to him ... if it don't dance (or code) and you can't eat it either f**k it or throw it away" sonork: 100.18128 8028finder.com
|
|
|
|
|
I already asked there, but here it goes again:
I'm trying to use a link like
[a href="\\intranetfileserver\mailarchive\mymail.eml"]mymail[/a]
to open a mail saved as .eml in Outlook Express.
double-clicking the .eml file in Windows explorer does as it should (start OE, and open the .eml for viewing, the command line is msimn.exe /eml:%1)
Using a link in a web page (as given above) displays the mail body directly in IE (however, I can't access attachments etc.)
Where/how can I change this, to open the file directly in OE?
Currently, I can do that by registering "msimn.exe /eml:%1" as open command for a new file type .emlx, and reanming the e-mails (and links) accordingly. However this is tedious to setup at each PC and downloads the mail to a local folder (which I do not want)
TIA
Peter
You don't need to sleep to see a nightmare Anne Clark [sighist]
|
|
|
|
|
hello everybody
my requirements are as follows...
1) I want to run a C program in Vc++ so that it looks GUI
2) the output generated by my program is an excel file and i want to open thru my (which has to be made) in Vc++
3) I want to create Find files or folders with similar options in windows in my application...I can create a new one or can use the id of Find files which is ::{e17d4fc0-5564-11d1-83f2-00a0c90dc849}
plz tell me how to implement find in the application
can anyone plz help me to perform all these three functions in one application?? plz explain step wise as i am new to VC++
thanks
bye
|
|
|
|
|
hi,
To start with u can create a simple Dialog based application. You'll have to read MSDN for more information, for how to:Create a dialog based app". Then u can use Windows SDK funtions and MFC to do the rest. Like use CreateProcess / WinExec to open the .xls file. MFC provies a Find dialog class which is easy to use. Its very difficult to explain a step-by-step process. It would be better if u read MSDN on the said lines.
hope this helps,
Sharad Ganesh
|
|
|
|
|