|
vinhie47 wrote: yeah, I 'm accept that using Invalidate will make flickering, so I rarely use it
I just add a note to ur reply, to the person, who poseted the question.
vinhie47 wrote: double buffering isn't supported in VC++6.0
I'm afride not.. double buffering is a concept, which will use normal BitBlt and SelectObject methods.
Do your Duty and Don't expect the Result Rate this Post, if I helped You
|
|
|
|
|
First, thanks a lot to you!
If I use InvalidateRect(...), I won't avoid flickering.
The client will be flickered because I load much bitmap.
And I want bitmap picture can move which depend on time.
I uses 2 functions: GetPixel(..) and SetPixel(..)
Before load bitmap, I use GetPixel(..) to save pixel colors of range which bitmap will be drawn.
In message WM_TIMER, I use functions:
-Clear(): uses SetPixel(..) to set pixel color which saved before.
-Move(); to move bitmap.
-GetPixel()
-Draw():load bitmap
But the results do not succeed.
I don't know Double Buffering technique. Can you help me about this technique. Thank you!
I will send my project for you. Please help me!
|
|
|
|
|
My project comment such as:
* A class CBall: to load,clear a bitmap picture of ball.
//Pixel: to get pixel color of range of rectangle of bitmap.
//nWidth,nHeight: width and height of bitmap.
void CBall::Pixel(HDC hdc)
{
int i,j;
for(i=0;i<this->nWidth;i++)
for(j=0;j<this->nHeight;j++)
this->pixelColor[i][j]=GetPixel(hdc,this->nXDest+i,this->nYDest+j);
}
//Draw: Load bitmap
//nXdest,nYDest: co-ordinate upper-left of bitmap
void CBall::Draw(HDC hdc,HDC hdcMem)
{
SelectObject(hdcMem,this->hBitmap);
BitBlt(hdc,this->nXDest,
this->nYDest,this>nWidth,this->nHeight,hdcMem,0,0,SRCCOPY);
}
//Clear: to clear bitmap
//By uses SetPixel() function to set pixel color which get before
void CBall::Clear(HDC hdc)
{
int i,j;
for(i=0;i<this->nWidth;i++)
for(j=0;j<this->nHeight;j++)
SetPixel(hdc,this->nXDest+i,this->nYDest+j,this->pixelColor[i][j]);
}
//Move: to move bitmap
void CBall:Move()
//In main file of project:
*WM_PAINT:
//Call function
ball.Pixel(hdc);
ball.Draw(hdc,hdcMem);
*WM_TIMER:
//Call function
ball.Clear();
ball.Move();
ball.Pixel();
ball.Draw();
//But after clear bitmap, bitmap isn't re-drawn.
//I can't understand. Help me!
//I will send my project for all you if I know your email address. Thanks!
|
|
|
|
|
Did you use of a Static Control for show bitmap if yes you can use of MoveWindow
|
|
|
|
|
Within my application running on my pc, I wish to browse to files on a connected mobile device using a standard windows open file dialog. Browsing to My Computer does not allow me to select the mobile device, although it does using Windows Explorer. Is there some setting, or some way I can configure the open file dialog to browse to such a system folder?
|
|
|
|
|
I'v tried to connect two computers using sockets... it works between computers in the same LAN, and between computers in the same internet subnet.
But, when i try to connect to computers that are far away in the internet(at another city), the connection fails; it simply doesn't reach the listening computer.
I've heared about public and private IPs is this the problem??
How may I fix it up??
Thanks in advance!!
|
|
|
|
|
if the remote computer is connected to a router you will have to setup port forwarding on the router. E.G.
something that wont work:
----------------------------
Remote computer(client)
|
Router(without port forwarding)
|
Remote computer(server)
-----------------------------
something that will work:
-----------------------------
Remote computer(client)
|
Router(with port forwarding)
|
Remote computer(server)
-----------------------------
|
|
|
|
|
well, the connection works through the router cause i can connect to other computers in the internet that are in the same city...
connection doesnt work connecting to computers in another city...
may it be a problem between nodes??
my public ip (i get it from www.whatismyip.com[^] ) is the same as all other computers i use in my connection so i cannot use this ip because i dont connect to any concrete computer.
i dont know what to do...
|
|
|
|
|
arr2arr1arr wrote: my public ip (i get it from www.whatismyip.com[^] ) is the same as all other computers i use in my connection
You mean all the computers on your LAN have the same public IP? That's normal.
The problem is on the remote end. You need the public IP of the remote to connect to, and if the
remote is on a LAN behind a gateway/router then the remote network needs to be configured to
forward connection requests to the appropriate computer on the LAN. This is usually accomplished
by port forwarding.
Remember an address consists of an IP address and a port number. The port number is used to
identify the application associated with the socket.
"If you can dodge a wrench, you can dodge a ball."
|
|
|
|
|
Ok, my computer is the "remote computer" that is listening for HTTP incoming connections.
i have my public ip; i try to connect from other computer that is not behind the same gateway.
how to allow forward connection requests to my computer on an internet gateway?
(Could the problem be not in my router but in the internet gateway it connects to??)
|
|
|
|
|
arr2arr1arr wrote: how to allow forward connection requests to my computer on an internet gateway?
Thanks to all!!
Now i know how it is done!!
Just get into router options in "http://(RouterIpAddress)/"
|
|
|
|
|
"If you can dodge a wrench, you can dodge a ball."
|
|
|
|
|
Hi
I have a class named CClipSaver and I want to create an array of this class. I do this as follows:
CClipSaver* Clips[10];
.
.
.
Clips[i]=new CClipSaver;
Clips[i]->Save();
.
.
.
But it crashes!
Note:
When I do not use array (i.e.
CClipSaver * Clip;<br />
Clip=new ClipSaver();<br />
Clip.Save();
) everything works fine.
How should I declare and use the array?
|
|
|
|
|
What is the value of i when it "crashes"? (whatever "crashes" means)
You may be right I may be crazy -- Billy Joel --
Within you lies the power for good, use it!!!
|
|
|
|
|
Remember that when using arrays
array[10]
the tenth value is
array[9]
the value array[10] is out of the definition and may cause writting out of memory...
|
|
|
|
|
MohammadAmiry wrote: Clip=new ClipSaver();
Clip.Save();
everything works fine
Hope its a typo Error
Do your Duty and Don't expect the Result Rate this Post, if I helped You
|
|
|
|
|
i am a master student and i need genetic algorithms examples codes in borland C++ for my homework
this homework deadline :12th april
thanks for your help
|
|
|
|
|
kewl , have fun with that!
If you post a specific question you may get a specific answer.
You may be right I may be crazy -- Billy Joel --
Within you lies the power for good, use it!!!
|
|
|
|
|
oz-gur wrote: i am a master student
No, you're not.
/ravi
|
|
|
|
|
if you dont know my question answer you dont sent me yours opinion please
|
|
|
|
|
If you're surprised by my response, see item (2) in this[^] post.
/ravi
|
|
|
|
|
hi i have spawned a an executable using shellexecuteEx as
SHELLEXECUTEINFO ShExecInfo = {0};
ShExecInfo.cbSize = sizeof(SHELLEXECUTEINFO);
ShExecInfo.fMask = SEE_MASK_NOCLOSEPROCESS;
ShExecInfo.hwnd = NULL;
ShExecInfo.lpVerb = NULL;
ShExecInfo.lpFile = "textcopy.exe";
ShExecInfo.lpParameters = str;
ShExecInfo.lpDirectory = NULL;
ShExecInfo.nShow = SW_HIDE;
ShExecInfo.hInstApp = NULL;
ShellExecuteEx(&ShExecInfo);
i wish to check whether "textcopy.exe" is still running....
i want to do sth like
if(process_is_running)
//do something..display some message
else
//continue
but I dont know how to check whether textcopy is still running.
Msdn says it can be done with the help of "ShexecInfo.hprocess"..i dont know how?.Please post some code example.Thnk you..
|
|
|
|
|
See GetExitCodeProcess()
You may be right I may be crazy -- Billy Joel --
Within you lies the power for good, use it!!!
|
|
|
|
|
Something like...
if (WAIT_OBJECT_0 != ::WaitForSingleObject(ShExecInfo.hProcess, 0))
//do something..display some message (process is still running)
else
//continue (process is terminated)
"If you can dodge a wrench, you can dodge a ball."
|
|
|
|
|
thnx man..it worked al rite..kudos!
|
|
|
|