|
if (true)
{
if (true)
{
if (true)
{
return true;
}
else
{
}
}
else
{
}
}
else
{
}
Do you need to do something in each else block?
if yes than follow the same, else you can use
if((condition1)&&(condition2)&&(condition3))
return true;
else
return false;
|
|
|
|
|
Hi
in my application i am using extern to make application's theApp to access by other
is there any problem if use extern
Thanks in advance
----------------------------
KRISHNA KUMAR T M
|
|
|
|
|
I doubt there're any problems using extern for that but you could also use AfxGetApp(), i think that is the preferred method.
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
|
|
|
|
|
Hi thanks for reply
already iam using AfxGetApp()
i don't know wether can i able to declare like that or not
----------------------------
KRISHNA KUMAR T M
|
|
|
|
|
Pardon?
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
|
|
|
|
|
You may declare it wherever you need, for instance suppose you application class name is
CMyApp then you probably have, in your MyApp.cpp source file some lines like the following
CMyApp theApp;
if you need it inside, say, MyView.cpp , then you write, somewhere at the top of the file
#include "MyApp.h"
extern CMyApp theApp;
If you need to reach it globally in your project then just declare it (i.e. write extern CMyApp theApp; ) inside your main header file, MyApp.h (that in turn is usually included by all of the source files).
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
In a CDialogBox that has a button as first control, I want the button to show a focus rectangle when I launch the dialogbox.
Now the focus rectangle doesn't show until I press the ALT or TAB-key for example.
You can test this behaviour by creating a new dialogbox in the resoure editor (with an 'OK' and 'Cancel'-button only) and launch it.
How can I change this behaviour?
Actually: If you create a new MFC AppWizard project that is Dialog based, the AppWizard creates a dialogbox that shows a focus rectangle on the OK-button... That's the behaviour that I want!!!
Thanks for your help!
FYI: I'm using Visual C++ 5.0.
|
|
|
|
|
J. Landsheer wrote: Now the focus rectangle doesn't show until I press the ALT or TAB-key for example...How can I change this behaviour?
Does it have anything to do with what control is first in the Z-order?
"Love people and use things, not love things and use people." - Unknown
"The brick walls are there for a reason...to stop the people who don't want it badly enough." - Randy Pausch
|
|
|
|
|
|
To answer myself (and maybe some others who have a similar problem):
It's a Win2000/WinXP-feature that when a dialogbox is invoked by the mouse (for example by clicking a menu item in the parent window) all accelerator cues and focus rectangles in the dialogbox are disabled (until you touch the ALT- or TAB-key).
However: when you invoke the dialogbox by the keyboard (for example by touching ALT+I on a menu item 'Invoke Dialogbox'), accelerator cues and focus rectangles in the dialogbox are enabled!!!
You can control this i.m.h.o. useless feature from the Desktop Control Panel, under Appearance, Effects, "Hide underlined letters for keyboard navigation until I press the Alt key".
Another way to do it, is to handle the WM_UPDATEUISTATUS message yourself:
make a MESSAGE_MAP-entry 'ON_WM_UPDATEUISTATE()' and let the 'OnUpdateUIState(UINT p1, UINT p2)' do nothing.
If Class-Wizard doesn't support the WM_UPDATEUISTATE-message, you have to define it yourself:
#define WM_UPDATEUISTATE 0x0128<br />
<br />
#define ON_WM_UPDATEUISTATE() \<br />
{ WM_UPDATEUISTATE, 0, 0, 0, AfxSig_vww, \<br />
(AFX_PMSG)(AFX_PMSGW) \<br />
(static_cast< void (AFX_MSG_CALL CWnd::*)(UINT, UINT) > (OnUpdateUIState)) },<br />
|
|
|
|
|
Hi i have one object name in one view
how to give gray color to the name of the object
|
|
|
|
|
Member 4655685 wrote: how to give gray color to the name of the object
What are you trying to give color to?
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
there is a object name i want to give Gray color
|
|
|
|
|
How it is shown the 'object name'? Is it a label (i.e. the caption of a control)? is it a text written using (for instance) TextOut inside the WM_PAINT message handler?...
Please be precise.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
|
A color with the same values for red, green, and blue will be a shade of gray. For example RGB (180, 180, 180) is a light gray, and RGB (100, 100, 100) is a darker gray. Set the text color to a shade of gray before drawing your object's name.
|
|
|
|
|
Change color of a text or a control?
|
|
|
|
|
Hi All,
Hopefully someone can help me, if possible
I have a problem with a locked chm file (htmlhelp file), it is launched from a printer driver so the process thats handling it is the explorer.exe, so when the help file is closed, explorer.exe still has a handle to the file. If I manual close the handle, using process explorer, then replace the file the html help window does not display the content. If I kill teh explorer.exe process and relaunch everything works OK.
I believe the problem is due to the hhctrl.ocx not being unloaded until explorer.exe is closed and restarted, is there a way to unload hhctrl.ocx without killing the explorer.exe?
Thanks!
|
|
|
|
|
Likely not - I believe that once a DLL is loaded into a process, unloading it is not possible (normally).
How about this - instead of opening the file itself, try copying it to a temp location and open the copy instead. After having it opened, open/close it again (via code) with the DELETE_ON_CLOSE flag and the file should clean itself up when it is finally closed.
Peace!
-=- James Please rate this message - let me know if I helped or not!<hr></hr> If you think it costs a lot to do it right, just wait until you find out how much it costs to do it wrong! Remember that Professional Driver on Closed Course does not mean your Dumb Ass on a Public Road! See DeleteFXPFiles
|
|
|
|
|
Thanks for the suggestion, unfortunately this can not be done as it would involve re-writting alot of drivers. But if I can not unload it then there is nothing that can be done.
Thanks again!
|
|
|
|
|
Hello!
Recently, i faced with the problem of rotating selection area using MFC class CRectTracker.
Can anybody share this piece of code?
Thanks in advance.
|
|
|
|
|
The CRectTracker doesn't have the rotate function. Someone have develop class similar to CRectTracker that have this function. A useful class to do what you need is qTransformTracker and you can find it here www.codeguru.com/cpp/g-m/gdi/gdi/article.php/c3681
|
|
|
|
|
I know it. But since our application is written with usage CRectTracker reasonably simply to add this class with the necessary methods. Somebody already did it?
|
|
|
|
|
Excuse me I haven't understood your problem before. Unfortunately I don't know if someone have done this method before.
|
|
|
|
|