|
fambi_mail wrote: What class do you use?
Actually, I don't use any classes for my serial communications. I've used MFC for the front end of any application, and a separate thread with overlapping I/O to deal with the serial port side of things. But then again, most of the comms has been *into* the PC, rather than fully two way. When you are multithreading, it can be a problem accessing MFC classes from more than one thread...
But I'm also a bit of a dinosaur control freak, and like doing things the raw way...
I've just a had a peek, and there are several classes to talk with the serial ports in http://www.codeproject.com/system/#Hardware[^]. Unfortunately, I haven't looked at them for quite some time, so I can't recommend any particular one.
Good luck!
|
|
|
|
|
|
A CEdit redraws itself if I call Invalidate, but then it creates its own PaintDC.
I would like to draw the CEdit to a memory DC to prevent flickering, but I can't find any CWnd method that accepts a DC for painting.
Thanks
Andre
|
|
|
|
|
I guess there is no "CWnd method that accepts a DC for painting".
if u only want "to prevent flickering" of the CEdit, I think you are in a hard way.
u may get better solution if u post the reason why you want to redraw the CEdit - normally CEdit can redraw itself if its text is changed.
A special image tool for Windows C++ programmers, don't miss it!
The world unique Software Label Maker is waiting for you and me ...
A nice hyper tool for optimizing your Microsoft html-help contents.
|
|
|
|
|
Hi, how can i access a usb device with winapi?
a short example will be very helpful!
bye
|
|
|
|
|
Have you searched CP, or Googled, for USB-related articles?
"Let us be thankful for the fools. But for them the rest of us could not succeed." - Mark Twain
"There is no death, only a change of worlds." - Native American Proverb
|
|
|
|
|
|
If you want to read/write from/to a USB HID device a suggest to take a look on Jan Axelson's The HID Page[^]
BTW, a mouse is a HID device (I'm using his code in a big commercial project and it's working very good)
|
|
|
|
|
hi, which example do you use?
Visual C++ 6
Usbhidio_vc6 ???
at
------ Build started: Project: usbhidioc, Configuration: Debug Win32 ------
Compiling...
usbhidioc.cpp
c:\download\usbhidio_vc6\usbhidioc.cpp(12) : fatal error C1083: Cannot open include file: 'hidsdi.h': No such file or directory
usbhidiocDlg.cpp
c:\download\usbhidio_vc6\usbhidiocdlg.cpp(57) : fatal error C1083: Cannot open include file: 'hidsdi.h': No such file or directory
Generating Code...
Creating browse information file...
Microsoft Browse Information Maintenance Utility Version ..................
BSCMAKE: error BK1506 : cannot open file '.\Debug\usbhidioc.sbr': No such file or directory
where can i download the Windows Driver Development Kit for win xp??? hm at the microsoft page i only found ... to order...
cu
-- modified at 7:17 Tuesday 4th April, 2006
|
|
|
|
|
Hi,
what is the reason for the Cxyz& return value with *this parameter of = operators?
Dr-Kuulun
|
|
|
|
|
Not sure exactly what you are asking, but this is a pointer while *this is the actual object being pointed to. Since the operator= method is returning a reference to the actual object, that's why *this would need to be returned.
"Let us be thankful for the fools. But for them the rest of us could not succeed." - Mark Twain
"There is no death, only a change of worlds." - Native American Proverb
|
|
|
|
|
if u define return type as Cxyz&, u should return *this, otherwise what you can return?
u can define return type other way, such as void or BOOL.
A special image tool for Windows C++ programmers, don't miss it!
The world unique Software Label Maker is waiting for you and me ...
A nice hyper tool for optimizing your Microsoft html-help contents.
|
|
|
|
|
The reason is simpler than you may think. Its is so that you can make multiple assignment work efficiently.
You expect this to work:
int a, b, c;
a = b = c = 1;
So you also accept this to work:
CFwibble a, b, c;
c.DoSomethingtoInitialisethestruct;
a = b = c;
But the last line is equivalent to:
a = (b = c);
which means b = c has to be something you can assign to another struct / class / object of the same kind.
You could make the return value xyz , but that would mean creating a temporary copy on the stack, which is inefficient. The xyz & means a reference to b is passed, so no temporary copy is made.
For proper purity, you should also make the reference const, to prevent b from being messed about with...
class xyz
{
...
const xyz &operator=(const xyz &rhs)
{
...
return *this;
}
};
I hope that made sense for you!
Iain.
-- modified at 19:54 Monday 3rd April, 2006
|
|
|
|
|
Iain Clarke wrote: CFwibble a, b, c;
5 just for the class name!
Ryan "Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late" John Nichol "Point Of Impact"
|
|
|
|
|
That's it! Thanx!
Dr-Kuulun
|
|
|
|
|
hi
I have developed an ActiveX control using MFC and i am using it in IE. The control has a boolean property ShowThumbNail which i am able to set through scripting, but when i set this property using < PARAM > tag it seems that the property is not set and nothing happens.
please tell me how to set exposed properties of an ActiveX using < Param > tag. The control is developed using MFC
thanks
Azam
|
|
|
|
|
override DoPropExchange and call PX_ functions.
Regards
Microsoft MVP in Visual C++
http://blog.joycode.com/jiangsheng
|
|
|
|
|
thanks Sheng
it worked
Azam
|
|
|
|
|
I am using CListCtrl.
I would like to handle single click event and double click event on list controls.
Is that possiable.
List control's property is set to report style.
How to handle single click and double click on list view?
In single click I want to display the values of that colomn in the same dialog.
In double click I want to open another dialog and show related details.
Is this possiable.
What are the events I need to handle.
At Present I am using only one event
"ON_NOTIFY(LVN_ITEMACTIVATE, IDC_LIST_GROUPS, OnLvnItemActivateListGroups)"
to display colomn values in same dialog.
Please let me know any one.
Nice talking to you.
If you judge people, you have no time to love them. -- Mother Teresa
|
|
|
|
|
G Haranadh wrote: t Present I am using only one event
Handle NM_DBLCLK message
|
|
|
|
|
Hi All,
I want to develop an application in which my GUI supports multiple views(CRichEditView,CListView,CTreeView..).All the views are independent of each other. when any modification is done in any of the views,that view sends a notification to observer class and this class in turn would notify other views about the updation.Can some one tell how to design this in MFC.I want to make the design robust so that more views can be added with ease.
Thanks in advance
Raghu
|
|
|
|
|
See CDocument::UpdateAllViews()
onwards and upwards...
|
|
|
|
|
Hi,
I'm creating a checkbox button at runtime. How can I determine the size of the drawn checkbox in front of the text. Is there a method in CButton to do this or can I retrieve this with a function like ::GetSystemMetrics() ?
Additionally it would be fine if I also could get the space between the checkbox and the text.
Thanks
|
|
|
|
|
madmax0001 wrote: I'm creating a checkbox button at runtime.
Any particular reason why you aren't doing this at design time?
"Let us be thankful for the fools. But for them the rest of us could not succeed." - Mark Twain
"There is no death, only a change of worlds." - Native American Proverb
|
|
|
|
|
Hi,
yes. I'm writing a GroupCheckbox control (similar to http://www.codeproject.com/miscctrl/GenCGroupCheckBx.asp). So the CButton control must be placed at runtime on the groupbox control. But I want to make this work under Win2000 and XP with or without BS_FLAT style set. And I determined that with the BS_FLAT style set, the checkbox is a little bit bigger than without.
|
|
|
|