|
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
|
|
|
|
|
I strongly recommmend you move this post to the C# forum before toxcct gets hold of it...
Is that the sound a flame thrower warming up [duck]...
Nothing is exactly what it seems but everything with seems can be unpicked.
|
|
|
|
|
Your code is managed or unmanaged?
|
|
|
|
|
Thanks for your help, I found a solution to the problem: I declare and define the variables in the InitializeComponents() function.
By the way, does anyone know a tutorial for visual c++ windows forms using the windows forms project type of VS.NET?
Thanks and best wishes.
|
|
|
|
|
I think you can find articles on the codeproject did you search?
|
|
|
|
|
Hello everyone,
Sorry that this question is related to another question I posted some time before because I have some new findings and self-analysis.
My question is why sometimes from perfmon on Windows, working set larger than virtual memory? I think virtual memory is the total size of memory (committed, reserved, shared, private) and working set is just the RAM touched by current process currently. Virtual memory should always larger than working set...
But, I write a simple program to show working set is larger than virtual memory from perfmon. The program is simple, just open a couple of memory map files and read from beginning to the end.
The only reason I could think of why working set sometimes is larger than virtual memory is, the OS memory management component may not reclaim some RAM consumed by current process even if the current process does not use the RAM. And keeping such RAM could improve performance if the process will use it in the future. But this point makes me confused because I think if it is true, such RAM does not have related virtual memory address, how could the current process utilize or even address (re-use to avoid hard page fault) it in the future?
thanks in advance,
George
|
|
|
|
|
Perhaps you have the wrong idea about the Virtual Memory figure in perfmon. Perhaps it only records memory that has actually been VirtualAlloc ed at some point without including directly heap allocated memory like that which I guess is used for the memory mapped files. The complete process memory map for a Win32 process, even pre .NET, is a complex beast with potentially multiple heaps, Virtual allocations in their various states, a stack per thread, a TLS block per thread, non paged pool, kernel object storage, COM CoTaskAlloc ed memory and whatever marshalling uses and some other wierd stuff that the C Runtime does way down in the bowls with functions like calloc .
Probably you should do some in depth research and the write an article for Code Project laying all this stuff out and relating it to what we see in perfmon.
Nothing is exactly what it seems but everything with seems can be unpicked.
|
|
|
|
|
Matthew Faithfull wrote: Probably you should do some in depth research and the write an article for Code Project laying all this stuff out and relating it to what we see in perfmon.
I think he collected material for many, many articles.
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]
|
|
|
|