|
I am currently working on a project with 70+ bitmaps...most are 15k bitmaps with ard 5 of 1000-2000kb bitmaps. My program is still working find...abit slow in certain situations....i think its because mfc isnt suppose to be a good graphic processor. If you need one, thats where direct x comes in.
just my 2 cents.
Aaron
|
|
|
|
|
Anonymous wrote:
....i think its because mfc isnt suppose to be a good graphic processor. If you need one, thats where direct x comes in.
That's not true. Photoshop does not use DX, neither should you if you just have a handful of tiny bitmaps floating around. If it's slow, you need to look at your code to figure out why.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Do you have all those windows open at the same time?
How much RAM is on your video card?
Possibly you are running out of video RAM for some reason.
If your video card is using 'shared' memory, then maybe you can increase the amount of RAM that the video driver will use?
|
|
|
|
|
|
Anyone come across this problem where some of the afx_msg get execute twice?
afx_msg like onButton1 get call twice...and AfxMessageBox("here"); also get execute twice....anyone know wats the problem?
Aaron
"To start a war takes the word "fight", To end it takes a whole lot more explanation"-- someone
|
|
|
|
|
Try posting some code.
<font=arial>Weiye Chen
Life is hard, yet we are made of flesh...
|
|
|
|
|
This should be easy. All i want to do is have some text highlighted in a control in another window. The control doesn't respond to any EM_* messages so i'm simulating the selection of text by sending a series of VK_RIGHT and VK_SHIFT key presses.
The problem is that it the 'right arrow' key gets pressed but the control doesn't have the effect of the 'shift' key. I know it gets pressed because once i move around in the control, the shift key is still down (when i uncomment the shift release key press - see last line of below method)!!
I have to do it this way as i have no other choice.
Here's the code:
window->BringWindowToTop();
//THIS PART WORKS
//Same effect as pressing the right arrow key 10 times
for (int a = 0; a < 10; a++){
wnd->SendMessage(WM_KEYDOWN, VK_RIGHT, 0);
wnd->SendMessage(WM_KEYUP, VK_RIGHT, 0);
}
//This part should select the next 5 characters of text.
//Simulates holding down shift and pressing 'Right Arrow' key 5 times
INPUT input[2];
for (int b = 0; b < 5; b++){
input[0] = GetKeyboardInput(VK_LSHIFT, 0);
input[1] = GetKeyboardInput(VK_RIGHT, 0);
//Press down shift and right arrow key
SendInput(2, input, sizeof(INPUT));
input[1] = GetKeyboardInput(VK_RIGHT, 2);
//Release right arrow key
SendInput(2, input, sizeof(INPUT));
}
//Release the shift key
input[0] = GetKeyboardInput(VK_LSHIFT, 2);
SendInput(2, input, sizeof(INPUT));
INPUT CFindInWindowDlg::GetKeyboardInput(short key, int downUp)
{
INPUT input;
input.type = 0x01; //INPUT_KEYBOARD
input.ki.dwExtraInfo = 0;
input.ki.time = 0;
input.ki.wScan = 0;
input.ki.wVk = key;
input.ki.dwFlags = downUp;
return input;
}
Any help would be greatly appreciated. My head is going to explode!
|
|
|
|
|
c121hains wrote:
The problem is that it the 'right arrow' key gets pressed but the control doesn't have the effect of the 'shift' key. I know it gets pressed because once i move around in the control, the shift key is still down (when i uncomment the shift release key press - see last line of below method)!!
Try the following. I tested it with an edit control in the same dialog and it worked... May or may not work in your case, but I hope you'll let us know
static INPUT GetKeyboardInput(short key, DWORD dwFlags)
{
INPUT input;
input.type = INPUT_KEYBOARD;
input.ki.dwExtraInfo = 0;
input.ki.time = 0;
input.ki.wScan = 0;
input.ki.wVk = key;
input.ki.dwFlags = dwFlags;
return input;
}
void CFindInWindowDlg::Select(CWnd* window, int start, int count)
{
window->BringWindowToTop();
INPUT input[4];
input[0] = GetKeyboardInput(VK_SHIFT, KEYEVENTF_EXTENDEDKEY);
input[1] = GetKeyboardInput(VK_SHIFT, KEYEVENTF_KEYUP | KEYEVENTF_EXTENDEDKEY);
input[2] = GetKeyboardInput(VK_RIGHT, 0);
input[3] = GetKeyboardInput(VK_RIGHT, KEYEVENTF_KEYUP);
for (int i = 1; i < start; i++)
{
SendInput(2, &input[2], sizeof(INPUT));
}
SendInput(1, &input[0], sizeof(INPUT));
for (int j = 0; j < count; j++)
{
SendInput(2, &input[2], sizeof(INPUT));
}
SendInput(1, &input[1], sizeof(INPUT));
}
I think your problem was:
1. Not using KEYEVENTF_EXTENDEDKEY for the shift key.
2. Sending too many shift keys (where you say "release the right key" you were actually sending [shift down + right up], and after the loop you were sending [shift up + right up]).
Hope that helps,
--
jlr
http://jlamas.blogspot.com/[^]
|
|
|
|
|
EXCELLENT! It works... it's alive!!!!!!!!!
hehehe
Thanks a million!
|
|
|
|
|
this is very important (fatal) for me. I think you can help me.
I need code of a Scentefic Calculator with C++ or VC++ or c#
that can draw functions like (y=sin(x)) and so on.
If you can give me an address or guidance.
Thank you very much again and again.
TA RedStar
|
|
|
|
|
You want to draw the functions onto a bitmap ? Well, the most obvious solution would be to read up on GDI+ if you have VC.NET, otherwise on GDI. You need to create a bitmap, then you can use GDI functions, or just SetPixel to draw the points of your function. The math library header will give you access to trig functionality, etc.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Why do you need the source? Did you start late on a school project of yours and now you need it finished by the end of next week or you'll fail your course?
If that's the case you can look here[^] for a calculator, but you have to do the drawing yourself.
Behind every great black man...
... is the police. - Conspiracy brother
Blog[^]
|
|
|
|
|
> this is very important (fatal) for me
No[^] it's not. I'm pretty sure of it.
|
|
|
|
|
Dear all,
I'm building a Context Menu Extension. When user clicks on my extension, say, "My extension," I call a function in my DLL and show a dialog. How to apply XP Theme to this dialog's controls? I tried adding the RT_MANIFEST but it didn't work.
However, when I write another testing app from which I call that DLL's function to show the dialog, it works properly.
So, the question here is how to apply the XP Theme to a DLL called from a context menu extension.
Best regards,
|
|
|
|
|
I need to access the internet using MFC program from LAN that connected to ISA server proxy.
I need to gamp over this server using my MFC program .
can any one help me about this problem.
plz, some source code....
thanx in advance.
On Earth nothing impossible,
while your mind running.
Faroqtam
|
|
|
|
|
GetWindowText() will give you the text from a textbox.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Hi threre people,
I am having a curious problem with Named Pipes. When I have multiple threads accessing the same instance of the Named Pipe,
sometimes the TransactNamedPipe function fails, with GetLastError returning ERROR_PIPE_BUSY. In asynchronous I/O, the error is more evident: when TransactNamedPipe returns ERROR_IO_PENDING in some threads, a call to TransactNamedPipe in aother thread returns ERROR_PIPE_BUSY until the other threads call WaitForSingleObject... Does Somebody know this problem?
Thanks a lot,
Wander
|
|
|
|
|
Hi,
I am doing some hardware programming using C++ on Visual C++ 6.0. In order to speed up the application(controlling the hardware), I would need to do some synchronisation.
I would need to start a certain hardware in parallel with another hardware at certain time interval(some sort of trigger action). I have placed the launching of this hardware program in a thread... but just would like to know how can I trigger it at a particular time interval? Would function like setTimer() be of use? Is there any example you guys can point me to to get a better understanding?
THanks for your help in advance
|
|
|
|
|
Look into CreateWaitableTimer
|
|
|
|
|
Hi, just wonder if there is any example on explaining the usage?
Thanks for your help!
|
|
|
|
|
Look at this article for ideas and some samples:
http://www.codeproject.com/system/timers_intro.asp#WaitableTimers
|
|
|
|
|
Hi
I'm using VC++ .NET. Just recently I started having this problem where changes I make to my source code in the IDE are not being carried over to the corresponding files in my project folder. For example, I will add a new line of code to GraphPlot.cpp using the Solution Explorer, then select "save all" from the file menu. But then when I go look in the GraphPlot.cpp file directly (like opening it with Emacs), the new line of code is not there! whats going on!?
thank you so much
htuba
|
|
|
|
|
Are the changes being cached, or is some other copy of GraphPlot.cpp being updated?
"Ideas are a dime a dozen. People who put them into action are priceless." - Unknown
|
|
|
|
|
Hi,
Suppose I am using XML to define a database structure. I want to use this XML definition to create database and insert table and attributes at run-time. I don't want to use data source "User DSN" or "System DSN", ... stuff.
Is there a existing class that can handle this? How can I do it?
Thank you very much!!!
|
|
|
|
|
I have a DLL which contains a couple of dialogs. In one dialog I am able to enter chinese characters and they display correctly. In another dialog the characters are displayed as black blocks. The characters are correct - they just display incorrectly. Both dialogs are compiled with the same settings (_UNICODE etc.). The resource settings appear to be the same. Anyone have any idea why one displays correctly and the other does not?
Jason
|
|
|
|