|
we need a code to take a poto by using a web cam
|
|
|
|
|
|
hi ,
I am trying to change BackColor of MS CommandButton from Thread. But it is giving me Exception.
code of Thread is :
UINT mainThread(LPVOID param)
{
while(!killThread)
{
if(yes)
{
try
{
yes = FALSE;
dlg->m_jbutn.SetBackColor(0x0000ff00);
//dlg is a ptr to dialog (same as 'this')
}
catch(...)
{
MessageBox(NULL,"Exception","Error",NULL);
}
}
Sleep(500);
}
return 0;
}
/**********************/
m_jbutn.SetBackColor(0x0000ff00);
this line works fine outof Thread. So why it is not working in Thread.
|
|
|
|
|
You can only update a GUI control from the same thread that created it. You'll have to send a message to the thread to tell it to update the button.
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"
|
|
|
|
|
Hi,
Does anyone know if it is possible to set up DMA to transfer data between two memory locations within my C++ application, so that I would use CPU for other calculations while transferring data with no CPU involvement.
Cheers,
Vitaly
|
|
|
|
|
You can't!
DMA devices are not available to user-mode applications. They are also NEVER used to copy memory simply from one location to another!
They are used to copy memory from physical addresses of buses (e.g. PCI bus) to virtual memory sections allocated by the OS and vice-versa.
Don't try it, just do it!
|
|
|
|
|
Hi.. I posted this difficulty before also .. My application is playing only PCM encoded wave files.. I need to play a file which is compressed and in the CCITT A-Law audio format .. How to uncompress it and play..? OR how to convert a file from A-Law to PCM..
Any suggestions???..
Thank you
pallavi
|
|
|
|
|
Build a DirectShow filter graph and play it.
Read the DirectShow SDK for further information.
Don't try it, just do it!
|
|
|
|
|
I am doing some operation on files. The operation vary for files which are currently in use and which are not. So i wish to know that how to find whether a file is in use or not. I try to open file exclusively but it returns true even if the file is in use by some program.
Thanks.
|
|
|
|
|
Does anyone know a way to determine the launching process of another process that has no parent? ie. was started with system function or cmd /c start
Any help would be greatly appreciated!
|
|
|
|
|
you have to hook CreateProcess for that
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
|
|
|
|
|
can you be more specific. i am trying to write a program that will retrace respawning spyware back to launching process. the respawned processes have no parent, so how to determine which process launched it.
|
|
|
|
|
|
Thanks Alok! looks like some stuff in there I may be able to use. I am vb/vfp programmer in over his head a little with c++ code, but I am feeling my way through it. Sometimes just need a point in right direction! thanks again
dman
|
|
|
|
|
warning C4786: '__ehhandler$?ExecSQL@CDBHandle@@QAE?AV?$_com_ptr_t@V?$_com_IIID@U_Recordset@@$1?_GUID_00000556_0000_0010_8000_00aa006d2ea4@@3U__s_GUID@@A@@@@V?$_com_ptr_t@V?$_com_IIID@U_Conne
ction@@$1?_GUID_00000550_0000_0010_8000_00aa006d2ea4@@3U__s_GUID@@A@@@@VCString@@@Z' : identifier was truncated to '255' characters in the debug information
what do this warning is talking about?
thanks for any help!
|
|
|
|
|
See here.
"Ideas are a dime a dozen. People who put them into action are priceless." - Unknown
|
|
|
|
|
Is there a Microsoft 'bug' number for the fact that the GDI rectangles functions stop one short of drawing all the way to the right and bottom coordinates?
For example, if the pen width is one, a Rectangle(0, 0, 16, 16) call will only draw to (0,0)-(15,15)
The Windows GDI function calls involving filled rectangles will draw one pixel short on the right edge and the bottom edge of the specified rectangle. This is documented in MSDN for Rectangle and FillRect, but no mention is made for RoundRect, FrameRect, and InvertRect (even though they also exhibit this behavior).
This is a problem for us because we are trying to represent the locations of our objects using ‘logical’ coordinates and ‘logical extents’ (Visual extent of object rather than logical ‘GDI’ location). We are trying to avoid storing the boundaries of objects in terms of ‘screen coordinates’ so that we might better server our customers with panning, zooming, and device resolution independence.
I had also been told this was 'fixed' in GDI+, or can I just assume that GDI+ 'broke' the existing 'functionality'
|
|
|
|
|
Nice rant. Never mind that it made you look look an idiot...
See, when the documentation specifically states that a function works in a particular way, and then it works that way, it's generally not considered to be a bug. For example, here's the doc comment on FillRect.
The FillRect function fills a rectangle by using the specified brush. This function includes the left and top borders, but excludes the right and bottom borders of the rectangle.
So you're bitching because it does what it says it will do? Or did you even bother to read the docs?
|
|
|
|
|
I am quoting myself here:
This is documented in MSDN for Rectangle and FillRect, but no mention is made for RoundRect, FrameRect, and InvertRect (even though they also exhibit this behavior).
I did read the docs. Read the docs for InvertRect. You would be inclined to think it inverted the ENTIRE rectangle, but it does not. Same for RoundRect and FrameRect. No mention of excluding the edges of the rectangles there. I might have to install my April 1994 MSDN to see if Microsoft mentioned it there or not. That is how old the program I am trying to maintain is.
If you are making a graphics application that is very interested in the visual extent of a rectangle, and you have the logical coordinates for it, it causes a lot of tweaks to be required, one place or the other.
|
|
|
|
|
|
Thanks for the great link. I can see that EndPoint-Exclusive is beneficialif you want your rectangles to border each other. We want ours to be able to visually overlap one pixel.
|
|
|
|
|
I've done some works in C# using the Registry class in Microsoft.Win32 namespace, but now, I can't use the frameWork at the client. I would like to deliver this work fast. ... can you help me ??
|
|
|
|
|
MSDN[^] is your friend.
"You're obviously a superstar." - Christian Graus about me - 12 Feb '03
"Obviously ??? You're definitely a superstar!!!" mYkel - 21 Jun '04
Within you lies the power for good - Use it! Honoured as one of The Most Helpful Members of 2004
|
|
|
|
|
This is the Visual C++ forum! For C# questions please use the C# forum, thx!
Don't try it, just do it!
|
|
|
|
|
I have a problem in a multi-dll project. Everything works except for an access violation in the CCmdTarget Destructor. Its a CEdit Control I'm actually not using. Now heres where the fun starts, remove the CEdit, and the Spin control in the same dialog now asserts setting the range, claiming it is not a window. Want some more fun? Remove the Spin Control from the dialog class, and now operator new breaks during heap alloc doing a heap check, which then fails no matter how many times you continue (big surprise (end sarcasm)). I had thought maybe it was my use of the MS STL not being DLL safe, so I grabbed stlport, and have the exact same results. I'm not doing anything odd in this code, which is why I did not post it. Instead, I suspect I have done something really dumb somewhere else and have just overlooked it, and am hoping someone here may have done the same dumb thing, or know someone who has, and knows what I have done wrong.
Other steps I have taken: Resource ID confilcts resolved. Making the property pages not be global variables, but instead be on the heap.
The behavior has not changed from the original problem.
Additional Info: m_xDispatch.m_vtbl=2696277389 m_dwRef=1051772663 in the CCmdTarget Destructor, it bails on the line ((COleDispatchImpl*)&m_xDispatch)->Disconnect();
Thanks in advance
Corry
|
|
|
|