|
|
Try to use #pragma directives
The following pragma causes the linker to search for the Test.Lib library while linking. The linker searches first in the current working directory and then in the path specified in the LIB environment variable.
#pragma comment( lib, "Test" )
Knock out "T" from CAN'T
You 'CAN' if you think you 'CAN'
|
|
|
|
|
Hi.
I dynamic append some item in a popup menu
AppendMenu(hMenu, MF_STRING | MF_ENABLED, 1000, "111");
but why the menu item is gray and disabled, cannot click.
I use Win32 C++(not MFC).
thanks.
|
|
|
|
|
Yes by default all these handlers are disabled unless you activate it through the command_UI handler .check enablemenuitem.
// try insertmenu or insertmenuitem
Regards,
FarPointer
-- modified at 10:18 Sunday 2nd April, 2006
|
|
|
|
|
|
This is how i have inserted an menu and it works fine
// tried for a dialog
// ID_MYMENU NEWMLY ADDED MENU ID
CMenu *Menu =this->GetSystemMenu(FALSE); <br />
Menu->InsertMenu( 3 , MF_BYPOSITION, ID_MYMENU, "&Insert in 3 Place");<br />
map this <br />
virtual BOOL OnCmdMsg(UINT nID, int nCode, void* pExtra,AFX_CMDHANDLERINFO* pHandlerInfo <br />
);<br />
nCode check for <br />
if(nID ==ID_MYMENU) &&( nCode == CN_UPDATE_COMMAND_UI)<br />
{<br />
( ( CCmdUI* ) pExtra)->Enable( TRUE );<br />
}<br />
Regards,
FarPointer
-- modified at 12:28 Sunday 2nd April, 2006
|
|
|
|
|
|
oh yes i forgot ,so in such case if i want to handle the OnCmdMsg(...)
wat ami supposed to do .
Regards,
FarPointer
|
|
|
|
|
Hi FlyWithYou,
maybe it is some helpful to you
#define IDC_TEST 1000
HMENU hmenu,hMenu2;
hmenu=GetMenu(hWnd);
hMenu2=GetSubMenu(hmenu,0);
AppendMenu(hMenu2, MF_STRING|MF_ENABLED, IDC_TEST, "111");
case WM_COMMAND:
switch (wmId)
{
case IDC_TEST:
MessageBox(hWnd,"test",NULL,MB_OK);
break;
...
...
|
|
|
|
|
But the menu item not enabled, how to click.
|
|
|
|
|
FlyWithYou
I tested for your question(why the menu item is gray and disabled, cannot click)
I write this code then test it and it's not gray
do you use this code?
|
|
|
|
|
Hello,
In addition to catching the WM_CLOSE event, I would like to disable the close icon on the dialog title bar when some critical section is being parsed in my application.
Is this possible?,
For those that use Nero Burning Room, when you are burning a CD/DVD, the close icon on the dialog title bar is dissabled.. How can be this done under MFC?
http://img82.imageshack.us/img82/1588/disableclose7uy.gif[^]
I guess that the style of the window is changed with SetWindowLong() , but I don't manage to find how.
Thanks in advance.
-- Ricky Marek (AKA: rbid)
-- "Things are only impossible until they are not" --- Jean-Luc Picard
My articles
|
|
|
|
|
disable the related menuitem in the system menu and the button will be disabled at the same time...
|
|
|
|
|
|
GetSystemMenu(FALSE)->RemoveMenu(SC_CLOSE, MF_BYCOMMAND);
|
|
|
|
|
RemoveMenu or ModifyMenu.
Regards,
FarPointer
|
|
|
|
|
of course Fisrt Hi FarPointer
whats the problem?
|
|
|
|
|
he doesnt wants to remove it all he wants is to disable it .
Regards,
FarPointer
|
|
|
|
|
yes (he wants only disable)
|
|
|
|
|
It is so simple when you know it
-- Ricky Marek (AKA: rbid)
-- "Things are only impossible until they are not" --- Jean-Luc Picard
My articles
|
|
|
|
|
--------------------------------------------------------------------------------
hello ,
can u tell me one this ,
is there any point in MDI application u newly created with CrichEditView base class and execute it and then write something on editor and it will find left to right . how i can find right to left .
????
in my application reverse happen , it is finding right to left but i want to find left to right
thanks in advance
sachin gupta
|
|
|
|
|
I am a novice c programmer. My programs are very floating point intensive - some can take days to run. Most of the CPU time is spent in long loops doing various tasks. I would like to know what the best way of optimising this sort of program for dual cpu processors is. It would be possible to break the loop into 2 bits. I'm guessing it has something to do with multithreading.
Do dual cpu machines automatically distribute the load without specific coding?
|
|
|
|
|
Windows does distribute threads of execution between multiple processors. You need to be careful, however. If your algorithm requires that you use thread synchronization primitives like critical sections, mutexes, or other types to synchronize the two threads, your application can end up running slower.
Software Zen: delete this;
|
|
|
|
|
m_581 wrote: I would like to know what the best way of optimising this sort of program for dual cpu processors is.
Multithreading is an advanced topic.
Without seeing the code, and understanding the problem the app is trying to solve, nobody is going to be able to you an answer.
Start reading up on multithreading topics.
VS2005 has also added support for OpenMP:
http://msdn.microsoft.com/msdnmag/issues/05/10/OpenMP/[^]
m_581 wrote: Do dual cpu machines automatically distribute the load without specific coding?
Not the way you want.
...cmk
Save the whales - collect the whole set
|
|
|
|
|
i can't understand that how sscanf() take any number of param we want. When i see it definition, i see that it prototype is something like this:
sscanf(char *xx,char *yy,...);
I wonder: can we write a function that can take any param like sscanf();
Thank you very much!
|
|
|
|