|
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.
|
|
|
|
|
thanks khan ,i got it
send reply
|
|
|
|
|
why hang your system?
I worked with this code and it's not problem
|
|
|
|
|
Hey Forum,
I'm searching for hours and hours now, but nothing could help me out. I have a Project in VC++ 2005 with two forms, lets call them form1 and form2.
So, the prjct starts form1 on startup. So long, so good. But what to do if I want it to start both forms on startup? Form1 = visible and form2 != visible, so later on I want to set form2 = visible from a call out of form1. Or, start methods of form2 from form1. Understand my problem? I'm going crazy on this...
Thanks for any help!
|
|
|
|
|
Hello,
Please give me some info about DDK?
What is it?
Thanks.
Every new thing you learn,Gives you a new personality.
|
|
|
|
|
|
|
Hi,
I want to remotely show a Client Desktop in a Server.
and For this I want to Read Graphic Card memory and send them to Server.
Like what the monitor does.
What is the best way?
Thanks.
Every new thing you learn,Gives you a new personality.
|
|
|
|
|
I don't think there is any easy way to read the graphics memory card etc.
But you can take screen shots of the client. Then you can compress the images, like convert them to jpegs and also reduce the size of the image, if you want to, then send them over to the server.
For this, first you will need to know how to take screen shots of the desktop, like this article:
http://www.codeproject.com/tools/screen_snaper.asp[^]
There are other ways also. You can search for them.
this is this.
|
|
|
|
|
Hi,
I wrote a program that sends data to few systems through a differnt thread(SendThread) using UDP on a LAN. and before this SendThread i am launching another Thread(RecvThread), that listens to a port no 54000. this RecvThread listens and whenever it gets any message Say "AAA" then it replies back with a sendto(sd,"yes",3,&client,size); but this message never reaches the other system that sent the first message "AAA". When i dubugged i found that the IP was alright. Once the SendThread finishes sending to selected systems, it ends. my code for RecvThread goes like this. is it because the recvfrom() is done in another thread? so that when another system sends a message, this thread completed its time slice or is not run by the CPU. hence it is not received? can this happen ? Please help me on this.
while (1)
{
buffer[0]='\0';
client_length = (int)sizeof(struct sockaddr_in);
memset((void *)&client, '\0', sizeof(struct sockaddr_in));
bytes_received=0;
bytes_received = recvfrom(sd, buffer, 4, 0, (struct sockaddr *)&client, &client_length);
if (bytes_received < 0){
printf("No Data is Found.\n");
closesocket(sd);
_endthread();
}
else {
if (strcmp(buffer, "XXX") == 0){
if (sendto(sd, current_time, 4, 0, (struct sockaddr *)&client, client_length) != 4){
printf("Error sending datagram.\n");
closesocket(sd);
}
else {
printf("\nReplySent");
}
}
else if(strcmp(buffer,"Yes") == 0){
printf("Got a reply for yes");
}
}//end of outer else
}//end of while
Thanks in Advance
KSS
|
|
|
|
|
you have a separate thread RecvThread for receiving, then why you receive it again here ?
fearless stallion wrote: bytes_received = recvfrom(sd, buffer, 4, 0, (struct sockaddr *)&client, &client_length);
VuNic
|
|
|
|
|