|
Usman Tasleem Akshaf wrote:
I would
Really why ?
C makes it easy to shoot yourself in the foot; C++ makes it harder, but when you do, it blows away your whole leg
|
|
|
|
|
Usman Tasleem Akshaf wrote:
I would
What change do you want bring with IE settings?
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
|
|
|
|
|
Hi i have a problem that i couldn't find a solution all over the net here it is:
I want to create dynamic menu item (at runtime) in a dialog modal.
Problem:
I assign the same ID for all dynamic menu items
ON_COMMAND(ID_ALL , OnTreeProgramadapter)
Then everytime I need to insert dynamic menu items I use
submenu1->InsertMenu(1,MF_BYCOMMAND, ID_ALL,"Save" )
This way i can know which one is selected using
GetMenuString(1, s, MF_BYCOMMAND);
Everything is great till now but...
In my program I need to enable and disable my menu item so i used
EnableMenuItem(ID_ALL,MF_ENABLED | MF_BYCOMMAND); //and i tried (ID_ALL ,MF_ENABLED | MF_BYPOSITION)
Only what happens is that only the first menu item (position 1 = last added) that is enabled and disabled as i want
My question is: HOW CAN I ENABLE AND DISABLE ALL THE REST knowing that i always want them all disabled or enabled
thx in advance 4 ur help
PS: i don't want to use different IDs for each new menu item.
/\(-)|\/|/\|)
|
|
|
|
|
Add a message map handler for the command UI
ON_UPDATE_COMMAND_UI(ID_ALL, OnUpdateIDALL)
Then the handler itself will look like this
void CMultipleMenuItemsDoc::OnUpdateID_ALL(CCmdUI *pCmdUI)
{
// Get the menu in question - HOWEVER you do this
CWnd* pWnd = theApp.GetMainWnd();
CMenu* pMenu = pWnd->GetMenu()->GetSubMenu(0);
// Get the string of the menu item
CString strTest;
pMenu->GetMenuString(pCmdUI->m_nIndex, strTest, MF_BYPOSITION);
// Then you can disable or enable it based on whatever criteria you have
pCmdUI->Enable(false);
}
|
|
|
|
|
Thanks for ur concern but i still have a problem
U see i just tried ur suggestion but i am still unable to disable or enable all my dynamic menu items together in fact i can only control the last one i added and the rest i can't control at all
Can u help?
/\(-)|\/|/\|)
|
|
|
|
|
Halawlaws wrote:
Problem:
I assign the same ID for all dynamic menu items
[...]
Only what happens is that only the first menu item (position 1 = last added) that is enabled and disabled as i want
Try using a range of IDs (one for each different item) in combination with ON_COMMAND_RANGE / ON_COMMAND_RANGE_EX
--
jlr
http://jlamas.blogspot.com/[^]
|
|
|
|
|
Respected all
I have to display a BitMap using VC++ i did it but now i have to display it on Full moniter Screen,that's after executing VC program the bitmap display on full sceen using 800*600 area of screen.
how i can do ??
David
david
|
|
|
|
|
hi,all
I got a problem about ole, now I'm developing a program to read PDF file as IE does. I made it to be a activex document client program, and using it to read *.doc or *.xls or even the activex document file which produced by my own activex document server program, it works fine, but when I tried to open PDF file, a message box popped up, and it said "no much memeroy enough to run it",and I traced to code, found it was popping up when COleClientItem::Activate(nVerb, pView, lpMsg) was being called.
how can I open pdf successfully? thanks, regards.
|
|
|
|
|
Hi all,
I want to run an exe file on a computer in a local network.
How to do this?
Please help me.
Cheers,
MILAD.
Every new thing you learn,Gives you a new personality.
|
|
|
|
|
|
I am new with C++, I am a VB6.0 Programmer, and I want to create a automated DLL in C++ that will be interfaced to VB6.0.
I Selected MFC AppWizard(dll) to create a new project, then I selected "Regular DLL Using MFC" and checked "Automation" from wizard options.
Then I added class and methods using View->Class Wizard, put some codes in it, then compiled (F7).
When I instantiated it with VB6.0 this error occurs:
Run time error '429'
ActiveX can't create Object
Did I miss something? I did modify the default compilation settings, does it have something do with this?
AI hope you guys can help me.
Thank You.
THEALCA
|
|
|
|
|
Try ATL Dlls,
They are more powerful!
Cheers.
|
|
|
|
|
It worked, thanks a lot!!
|
|
|
|
|
I am looking for a way to obtain the location of the "Temporary Internet Files" using WinInet. Does anyone know?
|
|
|
|
|
Ok, got it. Its using shell and not wininet. SHGetFolderPath with CSIDL_INTERNET_CACHE.
But I see two locations where Temporary Internet Files folder exists. One in C:\Documents and Settings\username\Local Settings\ and the other in C:\Documents and Settings\username\Local Settings\Temp - does any one know what is the second one? The contents of this folder dont get cleared when I delete files from IE tools options. Thisis there both on winxp and win2k.
Thanks in advance.
|
|
|
|
|
Hi
I am using the following code to set my work area and to hide the task bar.
<br />
::ShowWindow(::FindWindow(_T("Shell_TrayWnd"), NULL));<br />
CRect rectWorkArea = CRect(0, 0, ::GetSystemMetrics(SM_CXSCREEN), ::GetSystemMetrics(SM_CYSCREEN));<br />
SystemParametersInfo(SPI_SETWORKAREA,0,&rectWorkArea,SPIF_SENDCHANGE);<br />
When I set my application to full screen/maximize (or any other application actually), the application will not use the space occupied by the hidden task bar, nor will I be able to resize it to use the area. I can drag it to occupy the space, but I have also noticed the window outline for dragging doesn't get display there either.
When I do a SPIG_GETWORKAREA later, it still shows the old work area that includes the task bar.
The Taskbar app found on code guru also exhibits this behaviour.
Has anyone else had this problem and how did you get around it?
I am using Windows 2000 SP4, but it also happens on Windows XP SP2.
Thanks in advance.
|
|
|
|
|
Oops, looks like it was my fault. It looks like my WM_GETMINMAXINFO message handler was misbehaving. If I set bHandled = FALSE it seems to work now.
|
|
|
|
|
Hello. I've been wondering, when an exception is thrown (i.e. by using throw keyword) and there is no catch clause available, is there any function or subroutine that will be executed before the program finalizes? Is atexit called when such an exception is thrown?
Thanks.
KK.
One day you'll find
that I have gone,
for tomorrow may rain, so
I'll follow the sun...
|
|
|
|
|
Yes, it's possible to write a handler for any uncaught exceptions for your applications. I'm not sure if it's done by a try/catch at the top level, or if some other mechanism exists though.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
The debugger should catch it and then you fix the problem.
8bc7c0ec02c0e404c0cc0680f7018827ebee
|
|
|
|
|
SetUnhandledExceptionFilter should be the thing you are looking for.
You can set a global exception filter with it.
Don't try it, just do it!
|
|
|
|
|
Hi everybody, I need your help.
I have a resizable dialog box with some controls (button, edit box, list box, etc). I have a Class that derive from « Paolo Messina CResizable » class. Every things works well.
Now I want to dock that dialog box (docking the dialog to the main frame). I try to do it, but it doesn’t work.
So, any ideas are welcome even if I would restart from scratch.
Thanks.
|
|
|
|
|
|
Thanks,
But it cann't help me because i want my controls inside a dockable dialog to
be resizable like in CResizableLib of Paolo Messina.
|
|
|
|
|
But you can derive Cristi's CSizingControlBar and put anything you want inside. I made it several months ago with a resizable child dialog containing listview, static and button controls. You only need to reposition the child dialog when the control bar is resized, then to override the OnSize handler in the child dialog to reposition correctly its controls.
|
|
|
|