|
You CANNOT send WM_PAINT messages yourself. The system will send
WM_PAINT messages when a window or portion of a window needs repainting
and there's no other higher priority messages queued.
To mark a window for repainting, as followait suggested, use the Invalidate
functions. A WM_PAINT message will be sent to the window that is invalidated.
If you need an immediate repaint, you can follow the Invalidate call with a
call to UpdateWindow(), or combine the invalidate and update in one call to
RedrawWindow().
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Hi all,
I have a list control, in that i am adding file path given by user in two ways :-
1) Single file
2) By Directory
I want that no same path files should be added in my control by either way.... I am not geting the way to implement it.
Can anybody help me in this.
Thanks in advance
|
|
|
|
|
Use FindItem of CListCtrl before adding the path to it to check if it already exists in the list.
|
|
|
|
|
You can use of FindItem,but how did you try that users to insert files to listctrl?
|
|
|
|
|
I want to create detailed log of errors that could be raised in any part of whole application while execution. My application is based on client/ server architecture which uses TCP connection.I want to create and maintain log file containing all errors generated with their respective function, class or any part of an application including timestamp. so that i can analyze them to correct them.
Regards,
Hemang
|
|
|
|
|
What is your trouble doing it?
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.
[my articles]
|
|
|
|
|
So you can just use std::ofstream to write log in a text file.
Maxwell Chen
|
|
|
|
|
could anybody please tell me how to create a log file containing date, time, file name and operation being done on or by the file
|
|
|
|
|
Hi all,
I've got a problem trying to detect the shape of the face using C++. I thought of using pixel aggregation(forming a region which is composed of face colour) but can't do it with the boolean operator, Merge/set_union(think these 2 operators can only be applied to arrays..right??), to compose the region so that i can differentiate the oval-shaped face from other objects!! Is there a way to region growing? I tried searching over the web but found only algorithms... I need some advice as to how to apply it to C++!! Do ya have any idea how i could accomplish that? I reached the stage whereby i have extracted the face from a picture along with other "noise" in the background as they also possess skin colour properties, thus i need to further refine the program to recognise face shape so that i can filter out the disturbance!
Super in need of HELP!!!
Thanks in advance!!
Regards,
Purple
|
|
|
|
|
CP homepage almost permanently hosts the link to Chesnokov Yuriy superb article on Face Detection [^].
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.
[my articles]
|
|
|
|
|
If you call a stored procedure and one of the fields is returned as a VT_Decimal, what is the proper method for extracting the value?
I used the following, and it seems to be working, but it feels like there should be a better way...
<br />
pCommand->Fields->Item[_T("Qty")]->get_Value(&var);<br />
<br />
float fQty = var.decVal.Lo32 / 10000.0f;
modified on Friday, January 11, 2008 2:00:46 PM
|
|
|
|
|
var.ChangeType(VT_R4);
Is this what I have to use?
And why isn't the devimal type directly accessible?
|
|
|
|
|
littleGreenDude wrote: And why isn't the devimal type directly accessible?
it is
VARIANT v;
v.decVal;
|
|
|
|
|
I think I'm doing something wrong when I try hit testing on a region.
Using GDI+...
If I build a region from a RectF, then call Region::IsVisible() with a PointF that lies outside of the RectF, the Region::IsVisible() function still returns TRUE. Can anyone show me the folly of my ways...
RectF rectF(5.0f, 5.0f, 10.0f, 10.0f);
Region region(rectF);
PointF pointF(4.5f, 4.5f);
if (region.IsVisible(pointF)) {
// It gets here
TRACE("It contains the point\n");
} else {
TRACE("It does not contain the point\n");
}
|
|
|
|
|
It seems 4.5 gets rounded to 5 when there's no transformations
involved (no Graphics passed to IsVisible()). 4.3 works as
expected, as does 4.49999.
There are reproducible bugs in the GDI+ Region hit testing.
This came up a while back and I forwarded info to Microsoft.
Good luck,
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
And I thought real numbers would solve all my problems.
thanks for the feedback.
|
|
|
|
|
Heh. You expected "real" numbers, but GDI+ uses "REAL'
numbers. REAL is a typedef for fake
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
HI friends,
I want to know establish communication between PC & a micro-controller through USB port. Plz help me in this. I want to know the API or MFC available for this task.
I am using VC++ with XP.
Apurv
|
|
|
|
|
Never done it but using Google I found a programming manual for a specific USB device[^].
3.0 Overview
To communicate with USB IO Driver one must first enumerate the
device. The enumeration of the device returns a device name. This
device name is used to open the interface, using CreateFile(). Once
you have the handle from CreateFile() you can use DeviceIOControl()
to communicate to the USB IO Device and CloseHandle() to close it.
The hardest part is getting the device name the rest is simply. To send
commands to the USB IO device simply build a command packet and
submit it using the DeviceIOControl functions.
|
|
|
|
|
|
To complete what Led Mike said: in that specific case, when you want to communicate between your PC and a micro-controller, you should have received documentation from the supplier of the micro-controller. What you need to pass to the DeviceIOControl should be described there.
There is no way for us to tell you what you need to pass to the function because it is specific for the micro-controller you bought.
|
|
|
|
|
What about serial port (COM1) ?
Which API functions or MFC classes can be used for communication via serial port ?
plz help ....
Apurv
|
|
|
|
|
In fact you can often use the serial port or a USB to serial converter to communicate with such devices. Usually it turns out to be simpler. The (raw) communication API are CreateFile , WriteFile , and so on
(searching MSDN you can find complete examples about). You may also use the MSComm ActiveX control inside your MFC application.
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.
[my articles]
|
|
|
|
|
Hello guys,
I've the following problem: I want to declare a variable and set its value in a windows form outside a function, but when I buid the the project, the following error occurs: "error C3845: only static data members can be initialized inside a ref class or value type".
Declaring the variables as static works but when I want to declare an array, that doesn't. It's not possible to declare the class as non-ref-class.
Does anyone have an idea how to manage this?
Thanks for your help, and best wishes.
|
|
|
|
|
Austrian_Programmer wrote: Declaring the variables as static works but when I want to declare an array, that doesn't.
How about showing us your code that is not working?
"Normal is getting dressed in clothes that you buy for work and driving through traffic in a car that you are still paying for, in order to get to the job you need to pay for the clothes and the car and the house you leave vacant all day so you can afford to live in it." - Ellen Goodman
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|