|
Hey all,
This is again inrelation with serial communication.
I have establised a serial communication with Rabbit 3000 -an 8 bit microcontroller.
I need to send a packet from the PC to the microcontroller at regualr intervals, say every 'x' secs.
How do I do it?
|
|
|
|
|
thathvamsi wrote: I need to send a packet from the PC to the microcontroller at regualr intervals, say every 'x' secs.
is WM_TIMER message and related thing is of any help!
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and You
|
|
|
|
|
thanks for ur response.
I cannot understand how WM_TIMER works.
Can you give me some code snippet that would help me.
For every x secs, there has to be a packet sent to the microcontroller.
|
|
|
|
|
|
From the MSDN:
<br />
CWnd::OnTimer<br />
The framework calls this member function after each interval specified in the SetTimer member function used to install a timer.<br />
whitesky
|
|
|
|
|
|
Hi all,
I am drawing a Circle in mouse clicked event in CDialog. and when i move the mouse if the mouse entered inside the Circle the Mouse Icon must change to CROSS ie IDC_CROSS or else it should retain its original behavior (ie) IDC_ARROW.
I want to detect that wheather the mouse is inside the Circle or Not to change my Mouse Pointer.
Please help me out. Give a small program using IntersectRect(...) API.
uday.
|
|
|
|
|
I would use a region (CRgn class) that corresponds with the circle and use CRgn::PtInRegion() to check if the mouse is in the circle.
You may be right I may be crazy -- Billy Joel --
Within you lies the power for good, use it!!!
|
|
|
|
|
Hi,
Please give a bit of code so that i can use it. its very urgent.
thanks and regards
uday.
|
|
|
|
|
Use highscool math (Pythagoras' Theorem).
i.e.
bool IsPointInCircle(int cx, int cy, int cr, int x, int y)
{
int xp = x-cx;
int yp = y-cy;
return (xp*xp+yp*yp)<=(cr*cr);
}
cx = circle center x.
cx = circle center y.
cr = circle radius.
x = x coordinate of point to test.
y = y coordinate of point to test.
Steve
-- modified at 2:02 Friday 7th July, 2006
|
|
|
|
|
Hi steve,
Any method like CRect.IntersectRect(...) usage is used please let me know any usage.
uday.
|
|
|
|
|
As mentioned above you can use the CRgn class:
CRgn rgn;<br />
rgn.CreateEllipticRgn(left, top, right, bottom);<br />
<br />
if (rgn.PtInRegion(point))<br />
{<br />
...<br />
}
- S
50 cups of coffee and you know it's on!
|
|
|
|
|
I have declared an array of size 200 for a structure with character as well as integer members.I want to know how to reinitialize the array values to NULL in such a way that the old values should get deleted.
Eg:Group grp[200]; where Group is a structure.
|
|
|
|
|
Can't you just use memset() or ZeroMemory() ?
"The largest fire starts but with the smallest spark." - David Crow
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
I need to copy all content of one projevct to another so to modifier what i need.
|
|
|
|
|
|
I create a new project but i want to copy others forms from a old project to the new, what to do
|
|
|
|
|
Form? Do you mean a dialog? You just want to copy the dialog or the controls in it too, with member variables if any, attached to those and message handlers for those controls and the dialog itself? What is the logic behind your question?
You have an apple and me too. We exchange those and We have an apple each.
You have an idea and me too. We exchange those and We have two ideas each.
|
|
|
|
|
I need to copy a dialogs with all these codes
|
|
|
|
|
There is no such copy-paste operation which will perform this task. You will need to redo the thing.
You have an apple and me too. We exchange those and We have an apple each.
You have an idea and me too. We exchange those and We have two ideas each.
|
|
|
|
|
you create empty prject after that, you add exist project to.
All code, resource will be added.
Huynhnb
.: Your success is also me :.
|
|
|
|
|
how we can restrict the dialog.
what i mean is when we move the dialog to end of the screen.ok, no problem.if we further move i will move to out of screen.how to avoid that,
thank u in advance,
vasu.
|
|
|
|
|
SendMessage(DM_REPOSITION);
You have an apple and me too. We exchange those and We have an apple each.
You have an idea and me too. We exchange those and We have two ideas each.
|
|
|
|
|
please tell some examples then i understand easily,
thank u for ur reply,
vasu
|
|
|
|
|
Handle the WM_MOVE message of your dialog. Just add the following line in that function.
SendMessage(DM_REPOSITION);
Does this solve your problem?
You have an apple and me too. We exchange those and We have an apple each.
You have an idea and me too. We exchange those and We have two ideas each.
|
|
|
|