|
IIRK, the standard technique in the C / SDK era was to make sure the processing loop did a peekMessage() call every now & then (say every 50 millisecond or XX loops.)
When you do peekMessage, the program returns control to Windows which takes the opportunity to do its system stuff, and gives other applications a turn to do things.
I think I used this for 16-bit programs under Windows 3.1!!!
|
|
|
|
|
Try calling peekmessage() every 50 milliseconds or X number of loops in your processing function - this gives control back to Windows for system stuff and other programs.
|
|
|
|
|
|
I have an existing project workspace in visual c++. how do I change the name of that workspace??
please help!
Aman N
|
|
|
|
|
Hi,
I open the .dsw and the .dsp files in notepad (with visual studio ide's closed) and make a find & replace and then rename the files.
Best regards,
Mauro.
|
|
|
|
|
struct PS
{
int t,m;
}
;
istream& operator>>(istream& in,PS&p)
{
in>>p.t>>p.m;
return in;
}
ostream& operator<<(ostream& on,PS&p)
{
on<<p.t<<p.m;
return on;
}
template <class T>
void Process()
{
T b;
cin>>b;
cout<<b;
}
void main()
{
Xuly<int>(); // why this call bind T with "PS" type (not int)?
Xuly<PS>();
}
Xuly<int>() : binding wrong type, it must be "int" but when to be executed it bind with "PS" type.
Please help me?
-- modified at 7:46 Monday 20th March, 2006
|
|
|
|
|
edit your message and uncheck the "Ignore HTML tags in this message (good for code snippets)" checkBox...
|
|
|
|
|
v2.0 wrote: edit your message and uncheck the "Ignore HTML tags in this message
that too particularly, when you are talking about templates!!
VuNic
|
|
|
|
|
yup
|
|
|
|
|
Hello
I think you should check MSDN for this.
type Templates in MSDN after that select C++ Templates / Function templates.
i hope you'll get answer to your question here.
|
|
|
|
|
Hello
I think you should check MSDN for this.
type Templates in MSDN after that select C++ Templates / Function templates.
i hope you'll get answer to your question here.
|
|
|
|
|
i want to read a cookie by passing a URL to web ,how it is possible throgh programming please share ur knowledge with me.
Bankey Khandelwal
Software Engineer
|
|
|
|
|
Is possible that we can transmitted some paramters to dll
am
|
|
|
|
|
consider this question instead :
"Is possible to transmit some parameters to a function ?"
|
|
|
|
|
hi,
As i want to shake the window (like "BUZZ" in yahoo messenger ) .when i click a button on that window.
reply early
send reply
|
|
|
|
|
#define Move(x, y) SetWindowPos(NULL,x,y,0,0,SWP_NOZORDER | SWP_NOSIZE);
void CAsdfDlg::OnOK()
{
int x = 0;
int y = 0;
int i;
for (i = 0; i < 20; i++)
{
Move(x,y);
x += 20;
y += 20;
Sleep(100);
Move(x,y);
x -= 20;
y -= 20;
Sleep(100);
}
}
Something like that.
this is this.
|
|
|
|
|
Use MoveWindow .
Set a shake boundary. So that it won't go beyond that. This must be fast too.
Nibu thomas
Software Developer
|
|
|
|
|
something like :
for ( int i = 0; i < 10; i++ )
{
this->MoveWindow( posX+/- random value, posY +/- random value );
}
Maximilien Lincourt
Your Head A Splode - Strong Bad
|
|
|
|
|
Don't use sleep and loops (the window will not get a chance to draw itself)
use WM_TIMER instead
C makes it easy to shoot yourself in the foot; C++ makes it harder, but when you do, it blows away your whole leg
|
|
|
|
|
RECT Rect;
GetWindowRect(&Rect);
for(int i=0;i<30;i++)
{
Sleep(20);
MoveWindow(Rect.left,Rect.top,Rect.right,Rect.bottom,1);
Rect.left+=10;
Rect.top+=10;
Rect.right-=20,Rect.bottom-=20;
}
|
|
|
|
|
hi WHITESKY,
As i use ur code in the event LButtonDown .
but the application will hang for some time ,upto the execution of for loop
the window not get moved(shake)
reply early
send reply
|
|
|
|
|
As i told you earlier loop techniques will not work in this case, you will have to set a timer using SetTimer then handle WM_TIMER event and in the WM_TIMER event you will have to move the window.
C makes it easy to shoot yourself in the foot; C++ makes it harder, but when you do, it blows away your whole leg
|
|
|
|
|
|
hey monty! why do you wanna use a timer here? i dont understand, i think the khan++ way'd work fine, wont it?
VuNic
|
|
|
|
|
Looking at your post, it seems like you are trying to use it in some Doc/View architecture. The code given above all works, but in a dialog.
For a Doc/View architecture, you can use my code above, with this modification:
#define Move(x, y) GetParent()->SetWindowPos(NULL,x,y,0,0,SWP_NOZORDER | SWP_NOSIZE);
Notice the GetParent() function.
this is this.
|
|
|
|