|
I have problems with normal, simple enabling and graying menu items.
Commands like:
AfxGetMainWnd()->GetMenu()->EnableMenuItem(ID_VIEW_TOOLBAR,MF_GRAYED|MF_BYCOMMAND);
or
AfxGetMainWnd()->GetMenu()->GetSubMenu(2)->EnableMenuItem(0,MF_GRAYED|MF_BYPOSITION);
or
AfxGetMainWnd()->GetMenu()->GetSubMenu(2)->EnableMenuItem(ID_VIEW_TOOLBAR,MF_GRAYED|MF_BYCOMMAND);
following with:
AfxGetMainWnd()->DrawMenuBar();
AfxGetMainWnd()->RedrawWindow();
didn't function (the items remained enabled), even though the Status of menu items has been changed (when I tried to call the some function for the second time, the return value (=previous state) was as I set it).
Noticable is, that command
AfxGetMainWnd()->GetMenu()->EnableMenuItem(0,MF_GRAYED|MF_BYPOSITION);
worked properly.
Could You help me with my problem, please?
Thank You very much...
|
|
|
|
|
I bet the UPDATE_COMMAND_UI mechanism is overriding your calls and re-enabling the menu items. Write UPDATE_COMMAND_UI handlers instead to disable the menu items; that's the "right" way to do it anyway.
|
|
|
|
|
Hi Everyone,
How do I display the data in a Microsoft Access Table with an MFC application?
Can I call up a table from Access for display directly?
If anyone knows, Please let me know.
Thanks in Advance!
Steve
|
|
|
|
|
Hi,
I have a MFC application that uses Microsoft Access tables.
The result of my program writes data into a Access database so at the end, I have a Table with the results.
I would like to know: How can I allow the user to save that RESULT TABLE where they SPECIFY the name of the table and the location of where to save it?
If anyone has any ideas, Please let me know.
Thanks in Advance
Steve
|
|
|
|
|
Hi,
how could i get two dialog bars docked like this:
_____________
| | |
| | |
| |---------|
|_|_________|
( ie. - i want the left dialogbar to take
all height available. )
/*
unless i don't call DockControlBar on bottom window
(but then it can't be resized anymore. )
i just always get the VC version
____________
| | |
| | |
|_|_________|
|___________|
*/
Thank you++
|
|
|
|
|
hi there
just a quicky - i need to obtain the hwnd of all the other currently running programms on order to send then WM_* messages
|
|
|
|
|
Try EnumWindows() . That should get you the hwnds for the top level windows of the desktop processes - you could also use EnumChildWindows() both for this and for getting child windows of the processes after you get their main windows.
|
|
|
|
|
You don't need to get their HWNDs, just call SendMessage() with HWND_BROADCAST as the first param.
|
|
|
|
|
TAHNKS ,you are great exactly what i needed
|
|
|
|
|
how to create a new .c file and .dsp file .dsw file and a .h file and a .rc file ? How to make sure these files are linked together for my application? Sorrie I am new to c++ programming. Thanks for helping
|
|
|
|
|
What you need to do is purchase Microsoft Visual C++ Version 6.0 ( maybe even 5.0 ) and then
all the fancy dsp files will be automatically constructed for you. And a small matter : if you are doing
c++ programming then there is not necessarily a .c file--instead a .cpp file ! Sorry if this sounds
expensive.
Dave
|
|
|
|
|
Hi,
Is there anyway that I can convert an int to a double without losing any of the data?
Thanks
|
|
|
|
|
what about (double)intvar
the precision of a double is 64 bits, that should be enough
|
|
|
|
|
Sorry that doesn't work. What I want to do is put a double into SetPixel, but I need to do so without losing any of the data. I've tried your way and it doesn't work.
|
|
|
|
|
Hi!
I'd like to know where I could find a tutorial on how to create an "IE Add-on", as the one provided by Altavista. Is there any sample in this site that could help me?
I've already tried the MSDN samples.
Thanks in advance
|
|
|
|
|
I am not familiar with the term "Add-on" used to describe anything that works with IE. I am a beginner to learning about such things, though. The following describes the most common IE extensions. Are any of them the type of thing you are looking for?
http://msdn.microsoft.com/workshop/browser/ext/overview/overview.asp
For what it is worth, AltaVista seems to be one site that installs SpyWare that significantly degrades system performance. My performance improved very noticeably after I used AD-aware to remove CometCursor from my system. See:
http://www.lavasoft.de/free.html
See http://grc.com/optout.htm for a good description of Spyware, but AD-aware does everything that OptOut does plus more.
|
|
|
|
|
Toolbars inside explorer are forms of deskbands. There is an ATL object wizard available on this site, although it does have some bug issues currently. I will be posting an update later this week. There are other ways of adding toolbars, you can also create a browser helper object which can access the ShellBrowser object to add toolbar buttons and toolbars. I will be writing an article on this in coming weeks. If you have any specific implementation questions, feel free to ask.
Cheers,
-Erik
|
|
|
|
|
Hi!
my application is dynamically creating controls (=without resources). As long as the parent to these controls is a CDialog or CFormView derivate, the processing of tab/alt-keys work correctly.
But when I want to create the controls within a CScrollView-derivate that tab- and alt-key-processing does not work, though WS_EX_CONTROLPARENT is set for the parent.
Does somebody know why?
And if you know why, maybe you even know a solution!
Thanks!!!
Joe
|
|
|
|
|
Have you used Spy++ to look at the styles?
Have you used GetStyle and GetExStyle (and TRACE) to see what the styles are?
Have you looked at the MFC source code to see how CFormView is created?
I have used all three techniques to answer questions such as this.
|
|
|
|
|
I was wondering how is it a *.c file is linked to a *.rc file .
|
|
|
|
|
An rc file is dealt with the resource compiler, and the c file is compiled by the c complier.
The link is contained in one or more resource headers which are 'included' by both the rc file and the c file, and serve to identify the control IDs etc.
The resource compiler recognizes c preprocessor commands like #define and #include, but if other resource files are #included in the .rc they should have an rc extension. The resource compiler will not expect a .c or .h file to contain resources.
There's also a message compiler (MC), which is primarily concerned with string resources (helps when supporting multiple languages, or if you just want to compile messages for event log reporting etc.) Invoking the message compiler on a (typically named) .mc file will actually generate a header containing the resource IDs for you.
Basically, though, these are separate things. The output from the resource compiler (.res) and c compiler (.obj) will be fed to the linker to produce the executable.
|
|
|
|
|
Sorrie I need someone to explain to me the below code which is a .h file. I am very new to c++ . Thanks for helping.
#define IDM_ABOUT 100
#define IDM_CALLWNDPROC 200
#define IDM_CBT 201
#define IDM_GETMESSAGE 202
#define IDM_JOURNALPLAYBACK 203
#define IDM_JOURNALRECORD 204
#define IDM_KEYBOARD 205
#define IDM_MOUSE 206
#define IDM_MSGFILTER 207
#define IDM_SYSMSGFILTER 208
#define IDM_DEBUG 209
#define CALLWNDPROCINDEX 0
#define CBTINDEX (IDM_CBT - IDM_CALLWNDPROC)
#define GETMESSAGEINDEX (IDM_GETMESSAGE - IDM_CALLWNDPROC)
#define JOURNALPLAYBACKINDEX (IDM_JOURNALPLAYBACK - IDM_CALLWNDPROC)
#define JOURNALRECORDINDEX (IDM_JOURNALRECORD - IDM_CALLWNDPROC)
#define KEYBOARDINDEX (IDM_KEYBOARD - IDM_CALLWNDPROC)
#define MOUSEINDEX (IDM_MOUSE - IDM_CALLWNDPROC)
#define MSGFILTERINDEX (IDM_MSGFILTER - IDM_CALLWNDPROC)
#define SYSMSGFILTERINDEX (IDM_SYSMSGFILTER - IDM_CALLWNDPROC)
#define DEBUGFILTERINDEX (IDM_DEBUG - IDM_CALLWNDPROC)
#define NUMOFHOOKS 10
//
// Entry functions for the DLL
//
int FAR PASCAL InitHooksDll(HWND hwndMainWindow, int nWinLineHeight);
int FAR PASCAL PaintHooksDll(HDC hDC );
int FAR PASCAL InstallFilter (int nHookIndex, int nCode );
|
|
|
|
|
Huh? Your question doesn't make much sense. What are you trying to do?
|
|
|
|
|
That is one gigantic chunk of code, now to answer your question one would need to ask, *what part*
do you not understand? Do you have a compiler at home, like VC++ version 5 or 6. And the word
is spelled Sorry.
Dave
|
|
|
|
|
to blur : the way you spell "sorry" as "sorrie" makes me think that you are the same as the two guys
John and Loh, upstairs. A good way to get past the code that all the "sorrie" people have shown here
in the last three days is to get the book on C Programming by Kernighan and Ritchie and read in slowly.
Once you get the C language down straight then you can bounce up to C++.
C and C++ are two different animals.
These questions with 5 miles of code don't make any sense. You should try to be more specific when
you ask something, then the people will answer by the dozens.
Dave
|
|
|
|