|
One solution is to add a handler for ON_UPDATE_COMMAND_UI of one menu item. Another solution is ON_UPDATE_COMMAND_UI_RANGE for multiple menu items.
ON_UPDATE_COMMAND_UI(ID_EDIT_COPY, OnUpdateEditCopy)
void SomeClass::OnUpdateEditCopy(CCmdUI* pCmdUI)
{
...
}
Kuphryn
|
|
|
|
|
Hello!
i want to get help for a problme that i have while working on a mathematical project.
i need to get the first derivative and integration of simple quadratic and trignometric equations( which is actually out of my project scope to develop them). Can some one point out any link to such a code part or Thankfully provide it.
Thanx
Zaki
|
|
|
|
|
Have a look at a numerical recipes textbook like the one at
http://www.library.cornell.edu/nr/bookcpdf.html
It's written for C but you should be able to get enough out of it to do what you need to do. Alternatively you might be better off to calculate general solutions and then substitute into them.
If you can keep you head when all about you
Are losing theirs and blaming it on you;
If you can dream - and not make dreams your master;
If you can think - and not make thoughts you aim;
Yours is the Earth and everything that's in it.
Rudyard Kipling
|
|
|
|
|
I have a big matrix of buttons in a dlg-based MFC app wizard generated program. When any button is clicked, the focus remains on that button even after the handler is called; until another button is clicked.
Then I modified the handler - this is the first line in the handler now:
GetDlgItem(IDC_STATIC1)->SetFocus();
I'm setting the focus on another static control now. The handler is for the Dialog class, of course.
What happens is that the first time I click on a button, it retains the focus. When I click on the same button again, it loses focus (which is what I want).
I tried repeating the call to SetFocus() , but it doesn't help.
Can anybody suggest a way of taking the focus away completely, please? (I don't want to disable the button)
Thanks,
Vikram.
-----------------------------
KI klike KDE kand kuse kit, kbut KI kmust kadmit, kstarting kall knames kwith K kis ksilly. KI khope kthey kwill kgive kup kthis kwhole kscheme ksoon kand kcome kup kwith kreal knames.
pI vThink aHungarian nNotation vIs iA aWonderful nThing cAnd pEveryone
avShould vUse pIt aAll dThe nTime, adNo nMatter pWhat dThe nContext,
adEven adWhen vSpeaking.
|
|
|
|
|
One solution is Win32 API's SendMessage().
Kuphryn
|
|
|
|
|
There are various problems changing focus to other controls upon some UI action in a dialog. Typically it comes down to the order things happen. In your case of a button click it may be that you are changing focus on the button down, and then when the button up happens Windows puts the focus back on the current control. To resolve issues like this in ED I use PostMessage() with a user defined message, which sets the focus where I want. Hope that helps.
Neville Franks, Author of ED for Windows. Free Trial at www.getsoft.com
|
|
|
|
|
Thanks, I'll check it out and let you know.
Regards,
Vikram.
-----------------------------
KI klike KDE kand kuse kit, kbut KI kmust kadmit, kstarting kall knames kwith K kis ksilly. KI khope kthey kwill kgive kup kthis kwhole kscheme ksoon kand kcome kup kwith kreal knames.
pI vThink aHungarian nNotation vIs iA aWonderful nThing cAnd pEveryone avShould vUse pIt aAll dThe nTime, adNo nMatter pWhat dThe nContext, adEven adWhen vSpeaking.
|
|
|
|
|
I dont think what you did will create problem. i simulated the same condition here in one test dialog box and could see things working fine.
what i did?
On button click i am setting focus on some statis text ctrl. thus, after the button is clicked the button looses the focus.
bhaskar
___________________________
"Think big, think fast, think ahead. Ideas are no one's monopoly"
|
|
|
|
|
BhaskarBora wrote:
I dont think what you did will create problem.
It does.
BhaskarBora wrote:
what i did?
On button click i am setting focus on some statis text ctrl. thus, after the button is clicked the button looses the focus.
Did you create an array of buttons? I don't place the buttons on the dialog box using the dialog editor - there are 200 of them and they must be aligned perfectly. So I create them using an array of CButton s in OnInitDialog() .
Regards,
Vikram.
-----------------------------
KI klike KDE kand kuse kit, kbut KI kmust kadmit, kstarting kall knames kwith K kis ksilly. KI khope kthey kwill kgive kup kthis kwhole kscheme ksoon kand kcome kup kwith kreal knames.
pI vThink aHungarian nNotation vIs iA aWonderful nThing cAnd pEveryone avShould vUse pIt aAll dThe nTime, adNo nMatter pWhat dThe nContext, adEven adWhen vSpeaking.
|
|
|
|
|
i think there wouldnt be any difference whether you use an array or something else. as far as you get the ctrl's address it enough.
___________________________
"Think big, think fast, think ahead. Ideas are no one's monopoly"
|
|
|
|
|
I am looking for some guidelines on quality "Windows-Friendly" applications. I am trying to complete a project that has taken me some years to complete and running into some difficulty with windows.
1. I hate the memory management of Windows, it can't handle lots of calls to malloc() with small structures. I found by building large blocks of memory and obtaining nodes from it was better. Only, this adds additional code, and prohibits memory expansion. I think most applications use this same scheme, but looking for a better solution.
2. My program is a process, not an event-driven application. Therefore, a timer is required that calls the routine at a fixed interval so that the process can operate on the information. This appears to work, but not sure if Windows likes this. I like to set the timer between 50 and 200ms.
Overall, the program functions, but Windows does not seem to like it. I don't have any problems with using Windows and other Win-based apps while my process is running, but when the process is complete and shutdown, Windows stays lethargic!? After awhile, Windows seems to wake up and operate more effectively. I would like some comments on what people do to overcome this. Is this a tuning issue, a memory problem (No Leaks!) or something else?
Also, if one was ambitious, I could use some help. I am not a traditional Windows programmer, good C type though. Contact me at mfeldhake@ccoreinnovations.com if you are interested. I could offer some cash but would prefer some stock incentives (I’m incorporated). Person would need to be highly experienced in scientific applications.
Thanks in Advance
Michael Feldhake
www.ccoreinnovations.com
|
|
|
|
|
iltallman wrote:
1. I hate the memory management of Windows, it can't handle lots of calls to malloc() with small structures. I found by building large blocks of memory and obtaining nodes from it was better. Only, this adds additional code, and prohibits memory expansion. I think most applications use this same scheme, but looking for a better solution.
This is not a Windows restriction, this a restriction of your C/C++ Runtime Library. You need a better (for you) heap manager. Remember that a malloc call is not instantaneous.
iltallman wrote:
2. My program is a process, not an event-driven application. Therefore, a timer is required that calls the routine at a fixed interval so that the process can operate on the information. This appears to work, but not sure if Windows likes this. I like to set the timer between 50 and 200ms.
Huh? What are you trying to accomplish?
Kant wrote:
Actually she replied back to me "You shouldn't fix the bug. You should kill it"
|
|
|
|
|
1) Look at: "Fast memory allocation library for multithreaded applications
" http://www.garret.ru/~knizhnik/sal.html[^]
2) I've seen this sort of behaviour on W9x I think where your app has allocated a large chunk of memory and when it shuts down it takes Windows a while to discard it from VM or something like that. You don't see this on NT based versions of Windows. If you are running NT/W2K/WXP and this is happening having a look in Task Manager Performance may shed some light on things.
Neville Franks, Author of ED for Windows. Free Trial at www.getsoft.com
|
|
|
|
|
I have a CFrameWnd, and several views in a SDI application. When one of the views has the focus, the toolbar will not display tool tips for some reason. Is there a relationship that I have not created between the frame and view? (The other views work fine when they have the focus)
Thank you,
Dave
|
|
|
|
|
Hello Dear,
Please tell me the site address to download irc based chat server source code.
Thank You
|
|
|
|
|
|
read up on the DirectX DirectShow api's
|
|
|
|
|
How do I make the framework force an update_command... macro/function with a command id? instead of wainting for the system to go into idle state.
Cheers
Asim Hussain
e: asim@jawache.net
w: www.jawache.net
|
|
|
|
|
I'm not sure how to do this for a specific ID, but you can try AfxGetApp()->OnIdle(). That may get you what you need.
|
|
|
|
|
I've written a simple NT service which monitors the status of services on remote machines. If they stop (either by design or due to a system failure), my service notifies by email and attempts to restart them. A call to OpenSCManager returns a valid handle, but GetLastError returns ERROR_IO_PENDING after that call. Can anyone help me out with this one? (This is the first service I've ever written, if that matters).
Thanks!
Jason.
|
|
|
|
|
I have the following procedure where I am converting the first alphanumeric value to appropriate numeric (alphanumeric value is always first position).
How should I change the procedure accordingly if alphanumeric value can be on any position?
DBCHAR Modifier[4];
int convert_char_modifier(char *Modifier, char *NewModifier)
{ char NewMod2[8];
char Tempcrap[8];
char Tempcrap1[8];
memset(NewMod2,0x00,sizeof(NewMod2));
memset(Tempcrap,0x00,sizeof(Tempcrap));
memset(Tempcrap1,0x00,sizeof(Tempcrap1));
sprintf(NewModifier, "%02d", Modifier[0] - 64);
sprintf(Tempcrap1, "%d", Modifier[1] - 48);
strcpy(Tempcrap, Tempcrap1);
sprintf(Tempcrap1, "%d", Modifier[2] - 48);
strcat(Tempcrap, Tempcrap1);
sprintf(NewMod2, "%03s", Tempcrap);
strcat(NewModifier, NewMod2);
return(0);
}
Here my examples what I am trying to accomplish:
A03-01003
B10-02010
1AD-11030...for the next letter add 10,len of result no more then 5.
|
|
|
|
|
Hi All
I am very new to OCCI (3 days now) and I am trying to do the following:
I have the following package:
<br />
CREATE OR REPLACE PACKAGE BODY UNICORN.SAL2UNI<br />
AS <br />
PROCEDURE SAL2UNI_GETPLANS(PLAN_ID IN OUT PK_PLAN_CUR)<br />
AS<br />
BEGIN<br />
IF NOT PLAN_ID%ISOPEN<br />
THEN<br />
OPEN PLAN_ID FOR SELECT PLANID from PK_PLAN where STOPDATE >= SYSDATE; <br />
END IF;<br />
END;<br />
<br />
PROCEDURE SAL2UNI_GETSERVICEINSTANCES(SERVINST IN VARCHAR2,SVCMIG OUT CUR_GET_SI)<br />
IS<br />
PICCODE VARCHAR2(1);<br />
COMPANYID VARCHAR(5);<br />
OCPPRODUCT VARCHAR(5);<br />
BEGIN<br />
PICCODE := 'P';<br />
COMPANYID := '11';<br />
OCPPRODUCT := 'OCP';<br />
<br />
IF NOT SVCMIG%ISOPEN<br />
THEN<br />
OPEN SVCMIG FOR<br />
select distinct<br />
accountno,<br />
serviceno,<br />
status,<br />
startdate,<br />
stopdate,<br />
reasonid,<br />
PICCODE,<br />
startdate,<br />
COMPANYID,<br />
OCPPRODUCT,<br />
cic,<br />
null,<br />
null,<br />
null,<br />
null<br />
from CC_AccountService<br />
where serviceno=SERVINST;<br />
END IF;<br />
END;<br />
<br />
END SAL2UNI;<br />
In my C++ program, I am doing the following:
<br />
.<br />
.<br />
.<br />
Statement *stmt = con->createStatement <br />
("BEGIN SAL2UNI.SAL2UNI_GETSERVICEINSTANCES(:v1, :v2); END;");<br />
<br />
stmt->setString(1,"9721234567");<br />
stmt->registerOutParam (2, OCCICURSOR);<br />
int updateCount = stmt->executeUpdate ();<br />
<br />
<br />
ResultSet *rs = stmt->getCursor(2);<br />
???<br />
.<br />
.<br />
I don't know what to do from this point on. I have tried while(rs->next()) but I get a Microsoft C++ exception (using VC++ editor). Same thing with rs->getString(...).
Does anyone have any idea whether what I am doing is correct and how to proceed.
Thanks a lot in advance.
ashish
|
|
|
|
|
many games are running under full screen mode, but this may cause some inconvenient matter after you quit it or tab to other application. How can I make a program to make them running in stardard window mode, of cause the games themselvies don't have this option.
Thank you!
|
|
|
|
|
i could use api hooks for CreateWindow and CreateWindowEx!
also for ChangeDisplaySettings and ChangeDisplaySettingsEx if the game changes the screen resolution.
i don't know if it also works with directx games, try it to be sure about this problem!
IceMatrix
|
|
|
|
|
Hi,
I found a set of animated cursor on the web. It's cool. But how can we use them into a MFC Application?
Thanks
Everything's beautiful if you look at it long enough...
|
|
|
|
|