|
What does your LogIt() method do? Shouldn't lpMsgBuf3 be sent to it instead of pMsg3 ?
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
|
|
|
|
|
LogIt() just calls EventReport function. Because it needs LPTSTR[] and lpMsgBuf3 is LPTSTR...so basically pMsg3 = {lpMsgBuf3}
Thanks for your reply.
|
|
|
|
|
So is an assignment statement missing from your original post?
Have you tried scaling the problem down to just two replaceable parameters instead of four? Have you tried using FormatMessage(..., (va_list*) args) instead?
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
|
|
|
|
|
One of the parameters to your LogIt() should be the number of parameter strings - i.e. 4.
::ReportEventW(
hnd,
EVENTLOG_INFORMATION_TYPE,
0,
EVENT_MSG_SESSION_NORMAL,
sid,
strNbr, // should be 4, # of args
DS,
str, // args array
(void*)D
);
...cmk
Save the whales - collect the whole set
|
|
|
|
|
|
Hi
Anyone know if there is defined constant value for Data type...For example
DWORD.... Max Range For DWORD is FFFFFFFF
Need To Do Functions That Do Checking If The Passed In values Meet The Range Or Not. Although Can Hardcode the FFFFFFFF, i ma wondering if there is any better way.
Thanx
|
|
|
|
|
Yes, they are defined in LIMITS.H
Serge
|
|
|
|
|
when I capture the screen,I can't capture the mpeg file's image under playing,why??and what i should do~who can help me~thank you very much~~
Jack
|
|
|
|
|
Because no-one can. They are drawn direct to the screen.
Christian
I have several lifelong friends that are New Yorkers but I have always gravitated toward the weirdo's. - Richard Stringer
|
|
|
|
|
If you turn off 'overlay' in the hardware acceleration settings
of your video card you should be able to capture video windows
(but it may seriously impact video performance)
Steve T
|
|
|
|
|
how do i set the hardware acceleration programmatically in c# or in c++?
|
|
|
|
|
Sorry, I don't know. If it's possible it will probably
be a DirectShow function. Most likely a property of the
video renderer you are using. You may even be able to
acheive it by simply using a different video renderer
in your filtergraph.
Steve T
|
|
|
|
|
Could some of you tell me how to get the RGB value of a pixel from a frame which captured from USB camera.
|
|
|
|
|
You need to either use GetPixel ( which is slow ), or make your image a DIBSection or use GDI+ to access the bits as an array.
Christian
I have several lifelong friends that are New Yorkers but I have always gravitated toward the weirdo's. - Richard Stringer
|
|
|
|
|
Thank you for your reply, could you give me some idea on it?
I have no idea..
|
|
|
|
|
In what format is the frame stored?
Assuming you used ISampleGrabber you will have a frame stored
in whatever format the video pin directly upstream of your
sample grabber is configured to. e.g 24-bit YUV ( FourCC, IYUV )
This is essentially an array of YUV values so first you will
want to access the YUV values (3 bytes) at the pixel location
Use a BYTE pointer that is set to a function of your frame
buffer start, buffer width, Pixel X and Y position and size (in bytes)
e.g. assuming 640 x 480 24-bit YUV (3 bytes), To find pixel(X,Y) :
BYTE *pPixel = pBufferStart + ( Y * 640 * 3 ) + ( X * 3 );
Now
BYTE Y = *pPixel;
BYTE U = *(pPixel+1);
BYTE V = *(pPixel+2);
This will be different if the stored frame is in another format.
Assuming you correctly get the pixel YUV values now convert
to RGB
Of the top of my head I think the formula is :
R = 1.164*Y + 1.596*V;
G = 1.164*Y - 0.813*V - 0.392*U;
B = 1.164*Y + 2.017*U
But I'm not sure. You can look it up.
In ant case if you're doing a lot of pixel testing you
should build look-up tables from those formulas at
initialization time.
Steve T
|
|
|
|
|
|
Thanks for your reply!
another question, how can I store the frame to buffer from the USB camera, and how to compare two frames if they are different?
Thanks alot!
|
|
|
|
|
Thanks for your reply!
another question, how can I store the frame to buffer from the USB camera, and how to compare two frames if they are different?
I use ISampleGrabber in a DirectShow filtergraph to get video frames
(there are other ways)
Here is the DS documentation: ISampleGrabber
There is some sample code if you click through "Using the Sample Grabber"
As to comparing two frames: what differences do you want to detect
and how sensitive to change do you want your detection to be?
In a live video stream even visually indistinguishable frames will have
at least some minor diffences due to tiny camera vibrations, subtle
changes in light-level, sensor "noise", etc.
One simple test you can do on a per-pixel basis is simply compare
the Y-values of corresponding pixels in two frames (in YUV format).
This essentially monitors for a change in brightness. (Like comparing
two gray-scale pixels)* If you are more interested in looking for
changes in a particular area of your frame you could accumulate
Y-values in that area of each frame (add the Y values for each pixel
in the area, average them or accumulate each pixel's difference--whatever
is appropriate for your application--then compare the accumulation
to see if passes a threshold, indicating the selected area of your
video frame has changed.
*If instead of converting a YUV image to RGB using the formula
I gave you simply use the Y value for R, G & B you will get a
gray-scale image.
Steve T
|
|
|
|
|
I want to create and write a DICOM file (include one or more image) in C but i don't know how to begin. Can you show me, please
Sincerely
Thangnvhl
|
|
|
|
|
You need to buy or find an SDK for reading DICOM files. There are some free ones about, but others cost in the vicinity of $5k, so I expect the free ones are not exactly complete.
Christian
I have several lifelong friends that are New Yorkers but I have always gravitated toward the weirdo's. - Richard Stringer
|
|
|
|
|
Thanks for your reply. Could you show me where i can buy or find these SDKs?
Sincerely
Thangnvhl
|
|
|
|
|
If you can't use google, the SDK's will be of no use to you when you buy them.
Christian
I have several lifelong friends that are New Yorkers but I have always gravitated toward the weirdo's. - Richard Stringer
|
|
|
|
|
Hi, i am a newbie, and i am trying to implement a control array as its called in VB, in VC. I have put the following code in a dialog's OnInitDialog() method:
pButton[0] = new CButton;
pButton[0]->Create(_T("My button1"), WS_CHILD|WS_VISIBLE|BS_PUSHBUTTON, CRect(10,10,100,30), this, 1);
pButton[0]->ShowWindow(SW_SHOW);
pButton[1] = new CButton;
pButton[1]->Create(_T("My button2"), WS_CHILD|WS_VISIBLE|BS_PUSHBUTTON, CRect(110,10,200,30), this, 2);
pButton[1]->ShowWindow(SW_SHOW);
But i dont know how to catch their events. Actually, i want to create a dialog which on the basis of a number creates that many buttons. I can read the text of that button and know which button it is. but first i have to catch the event. Please if any of u have any alternatives to this do tell me.
and which library do u prefere for such tasks MFC, ATL or ... (i m not sure about).
To hit 3rd floors window you have to AIM for 5th or Higher.
|
|
|
|
|
you can doit inside OnCommand by filtering the controls by the id
in this case 1 or 2
...100,30), this, 1);
something like this
BOOL CYourClass::OnCommand(WPARAM wParam, LPARAM lParam) <br />
{<br />
switch(LOWORD(wParam)) <br />
{<br />
case 1:<br />
DoSomething1(); <br />
break;<br />
case 2:<br />
DoSomething2();<br />
}<br />
}
|
|
|
|