|
Try AfxPostQuitMessage(0) before you call DestroyWindow.
You may even not need to call the latter.
And I recommend you to call CDialog::onClose/OnOK instead of DestroyWindow (if u debug into it, you see the framework does more work just destrywindow). If you use SDI/MDI, try to use the mainframe to intercept the exit message, and after u tidy up things, call the baseclass onclose().
|
|
|
|
|
What is the ID of the Exit menu option? Do you have a handler in place for that ID? If so, what are you doing in that handler function?
"One must learn from the bite of the fire to leave it alone." - Native American Proverb
|
|
|
|
|
I tried AfxPostQuitMessage(0) but didn't work.
Basically, i have put a WM_COMMAND handler function where i check if the ID is TRAY_EXIT (thats the id of the Exit Menu option) and try to call AfxPostQuitMessage() there. But nothing happens.
I ran DebugView to capture win32 and ran the app. But DebugView says:
>>routing command id 0x8003 sent to app
>>IGNORING command id 0x8003 sent to Cdialog Dialog
(0x8003 is the TRAY_EXIT number)
Is there a better way to handle creating a menu and providing exit option and then handling it??????
Looks like i am missing something here............
Pritam
|
|
|
|
|
pritamkd wrote:
I tried AfxPostQuitMessage(0) but didn't work.
If you are simply wanting to exit your application, just send it a WM_CLOSE message. If it is a dialog-based application, call EndDialog() .
"One must learn from the bite of the fire to leave it alone." - Native American Proverb
|
|
|
|
|
Hey Folks!, i got the idea!
i didn't have a proper handler in place for the TRAY_EXIT message. My bad!!!
Anyway , thanks a lot for your help!!!!
Pritam
|
|
|
|
|
hi
I am tejaswi . I wanted to read the contents from editboxes of a dialog window. am able to do so except for one edit box. That is apperaring on the screen as if it is read only. but not even able to copy the contents of that one manually. The caret is not coming there even if i click on the box with mouse. please tell how to read contents of it. any property is to be set or what.
Thank you. Tejaswi
|
|
|
|
|
Did you check the edit box 'read-only' setting?
Did you check the DDX_Control has its entry?
Did you call UpdateData(FALSE) at the wrong time?
|
|
|
|
|
y not u delete the control and place a new one?
V
|
|
|
|
|
What does the code look like that is attempting to read from that edit control? Is this an MFC application?
"One must learn from the bite of the fire to leave it alone." - Native American Proverb
|
|
|
|
|
yes yes it is an MFC application using the Cwnd Class. first of all , the application that has created that edit control is a different one. not under our control. i am j ust trying to read from the window "Histograms" generated by that application( Vims Configuration Tool). I am trying to do this by using available functinos like FindWindow("Histogram"),GetTopWindow(),GetNextWindow().. like that getting all controls and then using SendMessage(WM_GETTEXT...). and now the problem is for the window that is disabled(seems to be i dont know exatly) but data is visible.
i am not even getting a handle to it .some other windows that are disabled i found using a function sth like CSnd:: isEnabled .but in that list also the one i am talking about is not there.
-- modified at 3:27 Friday 23rd September, 2005
|
|
|
|
|
tejaswi_teja wrote:
...now the problem is for the window that is disabled(seems to be i dont know exatly) but data is visible.
Whether a window is disabled or not, you can still read text from it. If you really need to know its enabled state, use IsWindowEnabled() .
"One must learn from the bite of the fire to leave it alone." - Native American Proverb
|
|
|
|
|
Hello best programmers,
I coded an application wich can display imagestream from a simple webcam. I found a good class (I guess) for capturing AVI from webcam to perform several functions etc... I found it here in Codeproject, some Russian dude encapsulated the functions of VFW class.
Anyway, I tried to find a lot of useful information how to capture from webcam, but unfortunatly I found only descriptions of wich functions it has.
And believe me there is a lot of functions, and a lot os useless functions for me.
What I tried to do is making a simple dialogbox with a startbutton, when you click on start, the webcam is turned on and you'll see yourself on the dialogbox.
I coded it as follows:
void CCamSampDlg::OnStart()
{
CRect rect; // Here I try to display the imagestream
WebCam.Create(WS_CHILD|WS_VISIBLE|WS_CLIPSIBLINGS,rect,this,TRUE);
WebCam.ConnectWithDriver(-1);
WebCam.SetPreviewRate(100);
WebCam.StartPreview(TRUE);
}
It's actually very easy, but the PROBLEM is, when you click on start, the camera turns on (cause I see the activation LED blinking), but it shows nothing on the dialogbox. So I think there something missing in the part of Create-function.
Can somebody please help me??
Thank you very very much!!!
If my application works, I forget all my problems.
|
|
|
|
|
Hello boyz,
I see nobody replied on my question , can somebody please help me??
If my application works, I forget all my problems.
|
|
|
|
|
I wish to remove Host Protected Area (HPA) on ATA Hard Disk in Windows...I don't want to write driver i.e, it should be done through API call...Please send me the solution asap.....
Best Regards,
mohan
|
|
|
|
|
Hi, does anyone know how i can save a PIDL to disk or registry so that i can easily read it back in again? I need to store the last directory that the user was looking at, obviously this can be a virtual directory such as "My Network Places", so storing a path isnt a suitable option.
Any help much appreciated,
Thanks
Skute
-- modified at 10:41 Thursday 22nd September, 2005
Also, i need it to get around the following:
Parsing the virtual item "Desktop"'s pidl, results in the following path:
C:\Documents And Settings\username\Desktop
when using
SHGetPathFromIDList
or
IShellFolder->GetDisplayNameOf
I would like it to return the GUID of the desktop, or some other way of identifying it, without going to the actual location on disk (in my eyes they should be 2 different entities, the real one on disk lists just files and folders, the virtual one lists my computer, recycle bin etc).
|
|
|
|
|
Skute wrote:
Hi, does anyone know how i can save a PIDL to disk or registry so that i can easily read it back in again?
You can store it as REG_BINARY or REG_DWORD .
"One must learn from the bite of the fire to leave it alone." - Native American Proverb
|
|
|
|
|
your service needed
ATL
V
|
|
|
|
|
It is unclear to me what you are asking or commenting about?
"One must learn from the bite of the fire to leave it alone." - Native American Proverb
|
|
|
|
|
I have been trying to test a sample project, but when I try and run it in Debug mode I get the message:-
'MySmaple.exe' does not contain debugging information. (No symbols loaded.)
Click OK to debug anyway.
Any suggestions as how to be able to set breakpoints etc again.
Many thanks,
|
|
|
|
|
Running it in Debug mode (F5) is not the same as compiling it with Debug symbols.
"One must learn from the bite of the fire to leave it alone." - Native American Proverb
|
|
|
|
|
how can I obtain data bits excluding header of an jpeg
dlfkgj lsdfkglfkgjlfgl jldfk fldkk jk
|
|
|
|
|
|
Anybody ever seen this:
Using VS.NET 2003 to compile C++ code.
App 1
double freq = 6;
double newFreq = abs( freq + 0.5 ) + 4;
App 2
double freq = 6;
double newFreq = abs( freq + 0.5 ) + 4;
When compiled
App 1 = 0 errors, o warnings
App 2 = Warning C4244 conversion from 'double' to 'int', possible loss of data
Strange ? But wait there is more !
App 1
Value of newFreq = 10.5
App 2
Value of newFreq = 10
Why does 'App 1' not produce the warning and a different answer ?
I am confused.
Users.
Can't live with 'em, can't kill em!
|
|
|
|
|
Are the compiler settings for each exactly the same?
"One must learn from the bite of the fire to leave it alone." - Native American Proverb
|
|
|
|
|
Yes, the compiler settings are exactly the same for both apps.
Wierd eh ?
Users.
Can't live with 'em, can't kill em!
|
|
|
|