|
My header files( stdafx.h, stdafx.cpp, some routine files) are in a different folder than the project folders I usually work on. Does that tend to cause problem?
|
|
|
|
|
No, as long as you don't get a 'file not found' error you're good. You could put any file anywhere as long as you provide the neccessary paths where to look for them. And you'll notice if something is missing as soon as you try to compile (or link).
|
|
|
|
|
When debugging my App, my VC always steps into disassemble file list and never gets back to my cpp file.It's very annoying How to turn off it?
|
|
|
|
|
If you close the disassembly window it should return to the .cpp file. This usually happens when you press F11 or click on Step Into during the debugging session.
The best things in life are not things.
|
|
|
|
|
The disassembly window will be hidden by default. I think you must have enabled the "Show disassembly if source code is not available" option. Turn it off, and the disassembly won't show up.
"Real men drive manual transmission" - Rajesh.
|
|
|
|
|
You can find the option at Tools -> Option -> Debugging -> General -> Enable Address-level debugging -> Show disassembly if source is not available .
|
|
|
|
|
Thanks, it's been a while since I visited the VS options.
Watched code never compiles.
|
|
|
|
|
I have a dialog box that pops up in my application. But the popup box is
very large. How can I programmatically set the size of that popup box?
Please any response any one can give me will be greatly appreciated.
Sincerely,
Danielle Brina
|
|
|
|
|
There's a few ways:
- Set the size when you call Create() on the dialog.
- Change the size using SetWindowPos()
- Change the size using MoveWindow()
|
|
|
|
|
I need to right-click on the windows taskbar on the button of a particular application and then select one of the actions in the menu (maximize,restore,close/exit).
Have been trying to get a handle to the taskbar as follows:
HWND hDesktop = GetDesktopWindow();
HWND hTray = FindWindowEx( hDesktop, NULL, _T("Shell_TrayWnd"), NULL );
HWND hReBar = FindWindowEx( hTray, NULL, _T("ReBarWindow32") , NULL );
HWND hTask = FindWindowEx( hReBar, NULL, _T("MSTaskSwWClass") , NULL );
HWND hToolbar = FindWindowEx( hTask, NULL, _T("ToolbarWindow32") , NULL );
But I dont know what to do beyond that or if I am actually getting the correct handle.
|
|
|
|
|
To do this you can find the Window that you need to work on.
Then send it the WM_SYSCOMMAND[^] message.
For example to send the restore command -
SendMessage(hWnd, WM_SYSCOMMAND, SC_RESTORE, 0);
Here hWnd is the handle returned by FindWindow .
|
|
|
|
|
What I want to do is to right-click on a Button on the TaskBar corresponding to a particular running application and then select one of the actions from the Menu that shows.
Any suggestions?
|
|
|
|
|
Try this[^] sample app , you may able to right click on the menu items
HTH
|
|
|
|
|
Hello,
I am writing a program using VC++ with MFC,
I added some dialog boxes and I want that once one of the dialog is opened by DoModal()
all the buttons on the parent dialog will be disabled,
How can I do it?
thanks
Avishag
|
|
|
|
|
In the dialog's OnInitDialog[^] function, you can call EnableWindow[^] on each control.
This is assuming you want the greyed look of the controls; a modal dialog with a parent window automatically disables the parent window until the dialog is closed.
modified 13-Sep-18 21:01pm.
|
|
|
|
|
Just a query: Why do you want to disable the controls on the parent dialog i.e. only for the look and feel?. Since the dialog being popped up is a result of the DoModal thing, the hit on the parent dialog will not work unless you dismiss the popped dialog.
On the other hand as suggested with the parent dialog pointer you can disable the control on it in the InitDialog of the dialog being popped up.
You talk about Being HUMAN. I have it in my name
AnsHUMAN
|
|
|
|
|
thanks for the replay,
I have a dialog that has a menu and clicking on the menu items causes to open other dialogs
by DoModal();
The problem is that, while one dialog is opened the user can click other menu items and open more dialogs and its causes me a mess.
How can I declare that the main dialog will be a parents of the other dialogs?
thanks again
|
|
|
|
|
aangerma wrote: The problem is that, while one dialog is opened the user can click other menu items and open more dialogs and its causes me a mess.
Are you certain you are calling DoModal ?
If the dialog is modal (DoModal ) the parent window should not be active and the user should not be able to click on other menus/buttons.
If that is happening, you have other issues to fix.
Watched code never compiles.
|
|
|
|
|
Maximilien wrote: indow should not be active and the user should not be able to click on other menus/buttons.
Can i correct it as
If the dialog is modal (DoModal) the parent window will not be active and the user will not be able to click on other menus/buttons.
|
|
|
|
|
Yes, you can; but if the user experiment another behavior, there is a bigger issue.
Watched code never compiles.
|
|
|
|
|
I have a doubt that you are using DoModal. If that was the case as Maximilien told in the last mail you will not have access to the parent dialog.
Looks like you are using Modeless Dialog.
|
|
|
|
|
As Chandru080 wrote, using a modeless dialog would explain this behaviour. Alternatively, if the parent window handle is invalid or NULL, the result would be the same.
Could you post the relevant code please? It should be possible to say for sure then.
modified 13-Sep-18 21:01pm.
|
|
|
|
|
can you explain me what does it mean 'modeless dialog',
and how can I change it?
thanks
|
|
|
|
|
|
Hi,
When i search over the google about Memory leaks.I came to know about this commands.Then i use it in my code.
_CrtSetDbgFlag( _CRTDBG_ALLOC_MEM_DF | _CRTDBG_LEAK_CHECK_DF);
_CrtMemState s1, s2, s3;
_CrtMemDumpStatistics( &s1 );
After closing my application i found this in output window But i cannot understand whats it saying.
Pls help me whether this is a serious concern i have to look out.
In Output window i got this
2439008 bytes in 2147348480 Free Blocks.
1244712 bytes in 2438992 Normal Blocks.
2089871648 bytes in -16711681 CRT Blocks.
2089919440 bytes in 2010977956 Ignore Blocks.
-1 bytes in 1244308 Client Blocks.
Largest number used: 2089919435 bytes.
Total allocations: 2089918906 bytes.
Anu
|
|
|
|