|
If you are fairly certain this can not be done, can you let me know, because my boss has been bugging me about it for over a week I've told him I can't do it, and I need some backup from you guys. thanks,
Jake
|
|
|
|
|
I would think it is possible to do this by making a custom command bar with your edit control and button. You could then capture the keydown events and check for enter.
|
|
|
|
|
I think you can just derive a class from CToolBar, override PreTranslateMessage, and do something like this:
/*********************************************************************/
BOOL CYourToolbar::PreTranslateMessage(MSG* pMsg)
{
if( pMsg->message == WM_KEYDOWN && pMsg->wParam == VK_RETURN ) {
//
// Call the handler for the button
//
return TRUE;
}
else
return CToolbar::PreTranslateMessage( pMsg );
}
I'm not totally sure. This is hacked from some other project... but you might give it a try.
|
|
|
|
|
My team is having an odd problem:
We are getting severe slowdowns when typing in largeish files: 2, 3 sometimes as long as four seconds when hitting Return.
It seems to be limited to fairly large source files (3,000 or more lines, but I haven't narrowed down the threshold yet).
And if we close the workspace, then there is no problem at all with performance. Reopen the workspace, and the slowdowns are back. So, it's clearly something in Visual Studio.
Some facts about what we're doing:
- Our workspace is large with hundreds of .cp files and more than a thousand .h files broken up into "folders" within the workspace.
- In fairly large files, typing can be very slow: 2, 3 even four seconds of a "pause" when hitting return
- Task Manager does show CPU spikes during this activity
- We are running P3 733 dual CPU Compaq AP550 workstations
- If we close the workspace, typing performance is normal and does not exhibit the slowdowns
- Generate Browse Info is turned off in Project Settings | C++
- Build Browse Info file is turned off in Project Settings | Browse Info
- We are no longer using USERTYPE.DAT for user defined keywords, the file does not even exist
- We are using SourceSafe for source control, but SourceSafe itself is not open at the time of these slowdowns
- All four of the VS "statement completion options" in Options | Editor are off (Auto list members, auto type info, etc.)
- The VS "auto indent" feature in Options | Tabs seems to make no difference: we've tried None, Default and Smart
- We are using Visual C++ 6.0 SP5
- We are not using any other AddIns other than DevTrueColor to patch the color menus to allow us any color in the syntax color chooser
- I've search MSDN and the KB as much as I can, but can't find anything
Any ideas would be very much appreciated.
--
Bryan
|
|
|
|
|
Some information was sent to me offline...
OK, my search on Knowledge Base failed because I search for "slow typing". But... Q202591 "Developer Studio Source and Dialog Editors Respond Slowly":
"When editing source code or a dialog resource with the Visual C++ version 6.0 source or resource editors, the user may experience a slowdown in performance. The resource editor shows a noticeable delay when tabbing between controls. In the source editor, the cursor seems to hesitate when passing through function definitions when using the arrow keys. In both instances the CPU usage is near or at 100%. "
This sounds exactly like my problem so I'll pursue this. Thanks!
--
Bryan
|
|
|
|
|
I've been looking for a function on MSDN that will let me get a percentage of the system's cpu usage, but to no avail Anything similar to this, like a struct that could let me calculate the percent usage would be just as helpful!
|
|
|
|
|
Anyone know how to change or assign a color to a CRectTracker? Thanks.
|
|
|
|
|
Subclass it, add the apropriate get/set methods and overide the Draw method to use your brushes.
-Ben
---------
On the topic of code with no error handling -- It's not poor coding, it's "optimistic"
|
|
|
|
|
How to call by cl.a button another exe programs?
Thank's.
|
|
|
|
|
|
Hi,
I've created a singleton object as described in Gof4,- but I get LNK2001 error-the constructor can't be called because it is protected.
I'm using VC++ 6 sp5.
Any ideas?
|
|
|
|
|
Any ideas?
Just like linker tells you - constructor is protected. You're trying to instantiate singleton outside its class. Read Gof4 again and look into their Instance() method implementation.
Tomasz Sowinski -- http://www.shooltz.com
|
|
|
|
|
Ok, I reviewed the implemention of Instance(), and I'm still having trouble.
interface:
class S {
public:
static S* Instance();
protected:
S();
private:
static S* _instance;
};
implementation:
S* S::_instance = 0;
S* S::Instance(){
if (_instance==0){
_instance = new S;
}
return _instance;
}
Am I using the static member function wrong?
Thanks.
|
|
|
|
|
Have you *defined* the constructor (not merely declared it)?
|
|
|
|
|
Thanks. That did it. I will try to refrain from posting completely idiotic questions here in the future, if at all possible.
|
|
|
|
|
We need more accurate information - the linker won't give you errors about protected members; only the compiler can do that.
I looked at your code and it seems fine.
|
|
|
|
|
Hi,
I'm pretty new to VC++.
I've got an MFC dialog app, and have a system tray icon. I'm trying to capture when a user clicks on it, but I'm struggling to actually find the info i need in the documentation.
When fillinh out my NOTIFYICONDATA struct, I'm seting
m_SysTrayIcon.uCallbackMessage=WM_SYSTRAY;
where WM_SYSTRAY is defined as WM_USER + 1.
I've used Spy and can see the messages being sent to the dialog window. What I can't work out is the proper way to get MFC to handle this message. I want a sort of OnSysTray() function where i can retrieve the lparam and wparam of the message and do my stuff.
Help please!
Also, currently I'm not bothering removing my icon from the system tray. This is someting that i ought to do, so it goes when the app is closed. Where is the best place to implement this?
Thanks for your help
Jon
|
|
|
|
|
|
Hi,
this might be a real nebiew question but it would be really nice if you could help me a liitle bit out with that.
I have got a Dialog based App where two dialogs are shown at the same time,
I need to know how to change for example the Value of the Statusbar on Form2 at the time a Button on Form1 is clicked. I hope that you can understand what I want to do. Sorry for my bad english.
I hope you can help me.
sign Jakob W.
|
|
|
|
|
Make use of modeless deialog boxes. I believe MSDN has a sample.
Hope that helps
|
|
|
|
|
GREETINGS
Example: In the OnButton event write
dlgForm2.m_text="LOVE & PEACE to everyone";
1) The header of Form2 Dialog must be included.
2) The member of CdlgForm2 must be created:
CdlgForm2 dlgForm2;
3) dlgForm2 must be attached to existing dialog;
Good Luck!
LOVE & PEACE to everyone
LOVE & PEACE to everyone
|
|
|
|
|
thx.
But what do you mean by dlgform2 must be attached to existing dialog?
sign Jakob W.
|
|
|
|
|
GREETINGS
If you have the second dialog created and it is already on the screen, only creating a new member for it is useless. So you need to attach the member to the dialog. But if you have the member that you used to create the dialog, you should use it without any attachments.
For example:
CdlgForm2 dlgForm2;
dlgForm2.DoModal();
dlgForm2 is now attached to Dialog2. There are different ways how to do it.
Good Luck!
LOVE & PEACE to everyone
LOVE & PEACE to everyone
|
|
|
|
|
GREETINGS
If you have the second dialog created and it is already on the screen, only creating a new member for it is useless. So you need to attach the member to the dialog. But if you have the member that you used to create the dialog, you should use it without any attachments.
For example:
CdlgForm2 dlgForm2;
dlgForm2.DoModal();
dlgForm2 is now attached to Dialog2. There are different ways how to do it.
Good Luck!
LOVE & PEACE to everyone
LOVE & PEACE to everyone
|
|
|
|
|
GREETINGS
If you have the second dialog created and it is already on the screen, only creating a new member for it is useless. So you need to attach the member to the dialog. But if you have the member that you used to create the dialog, you should use it without any attachments.
For example:
CdlgForm2 dlgForm2;
dlgForm2.DoModal();
dlgForm2 is now attached to Dialog2. There are different ways how to do it.
Good Luck!
LOVE & PEACE to everyone
LOVE & PEACE to everyone
|
|
|
|