|
Message Closed
modified 15-Mar-19 22:02pm.
|
|
|
|
|
|
Have a look at Codeproject Articles[^] regarding Serial port communication. You can find a lot of samples which handles serial port communication. Now the rest is to interpret the read data accordingly and do the intended operations. If you have more doubts about "how to do x" , then please be specific.
Regards,
Jijo.
_____________________________________________________
http://weseetips.com[ ^] Visual C++ tips and tricks. Updated daily.
|
|
|
|
|
In your serial communication class you must have an eventhandler which is called by interrupt service and sending custom messages to your mainfrm application class. Handle this custom messages to convert them to windows messages.
|
|
|
|
|
http://lcdinterfacing.googlepages.com
|
|
|
|
|
Of course your message was reported as abuse.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
Ive similarly flagged the other two posting in the other forums
hope you're well and rested after the xmas/New Year break
'g'
|
|
|
|
|
Garth J Lancaster wrote: hope you're well and rested after the xmas/New Year break
Best wishes to you
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
CPallini wrote: Of course your message was reported as abuse.
humm i am thinking of doing same!
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow Never mind - my own stupidity is the source of every "problem" - Mixture
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and You
|
|
|
|
|
Why its here?
Of one Essence is the human race
thus has Creation put the base
One Limb impacted is sufficient
For all Others to feel the Mace
(Saadi )
|
|
|
|
|
not mine!
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow Never mind - my own stupidity is the source of every "problem" - Mixture
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and You
|
|
|
|
|
Dear All
I want to create the OnDestroy command in VC2005.
But because there is no ClassWizard in it, I dont know how to do this
could u please help me?
Regards
Monhi
|
|
|
|
|
See Q7 and Q10-Q12 here[^].
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
thanks
It was really helpfull.
|
|
|
|
|
I'd like to make a popup menu with the following code. However my assertion (ASSERT(m_Popup)) always fails. I've no idea what the problem could be. Thanks.
void CChildView::OnContextMenu(CWnd* pWnd, CPoint point)
{
CMenu PopupMenu;
PopupMenu.LoadMenu(IDR_P);
CMenu *m_Popup = PopupMenu.GetSubMenu(0);
ASSERT(m_Popup);
m_Popup->TrackPopupMenu(TPM_LEFTALIGN |TPM_RIGHTBUTTON, point.x, point.y, this);
}
|
|
|
|
|
GetSubMenu() only returns a sub menu that already exists.
If you want to create a new one, you must call CreateSubMenu() , and then attach menu items to it with AppendMenu or InsertMenu .
|
|
|
|
|
Thaks for the answer. I created a menu (IDR_P), and I thought that loading it would do all the aforementioned, or what is the point in using creating Menu resources?
Of course if I can't get around it, i will use the method you suggested I just thought that using a resource would be simpler. Thanks again.
|
|
|
|
|
Does PopupMenu.LoadMenu(...) succeed? If so, is there a popup menu at index 0 in the IDR_P menu?
|
|
|
|
|
I also did an assertion on PopupMenu.LoadMenu() and it was OK. How can I check if there is a popup menu at index 0?
Thanks
|
|
|
|
|
Thanks, the latter part was the problem.
|
|
|
|
|
As a side note, m_Popup is not a good name for a local variable. The m_ prefix is normally used to indicate that a variable is a member variable (member of a class or struct ).
Steve
|
|
|
|
|
|
I have an array of BYTEs named aBytes. As you know, It looks some thing like this in the memory:
1000100110001010100011011011010110110101 ...
memory increase ---->
Now I want to separate 6-Bit chunks from the begin, as follow:
100010011000101010001101101101011011 ...
memory increase ---->
I used this code:
typedef unsigned __int32 BASE64
struct CHUNKS
{
BASE64 First:6;
BASE64 Second:6;
BASE64 Third:6;
BASE64 Fourth:6;
}*pChunk = NULL;
for (int iCountor = 0; iCountor < Size_Of_aBytes; iCountor++)
{
pChunk = (CHUNKS*) (aBytes + iCountor);
} But each time, I get wrong values. Where is the problem?
Thank you masters!
|
|
|
|
|
Hi Jusef,
iCountor is counting 4-byte integers and you want the pChunk pointer to advance by 4 bytes, however aBytes is a char pointer, so adding iCountor to it is not correct. You should use one of these:
pChunk = (CHUNKS*) (aBytes + 4*iCountor);
pChunk = ((CHUNKS*)aBytes) + iCountor;
|
|
|
|
|
What type is aBytes ?
I'll presume it's a char or BYTE pointer. You want to increment it by sizeof (struct CHUNKS) , as you want to manipulate items of that type. One wrinkle - making sure you don't increment off the end of the byte array and making sure that all of a CHUNK is in the array.
Anyway - try this:
for (int chunkCountor = 0; chunkCountor < Size_Of_aBytes/sizeof (struct CHUNKS); chunkCountor++)
{
pChunk = ((CHUNKS*) (aBytes)) + chunkCountor;
}</pchunk>
|
|
|
|