|
Hi:
the following is a main codes of shutter show an image, i would like to stop this show in any show process.so how to write such codes? urgent!!!!!!!!!!!
if(!pDoc ->statedoc&&state2==1)
{
BYTE* pBitmapData = CDibNew1->GetData();
LPBITMAPINFO pBitmapInfo = CDibNew1->GetInfo();
int bitmapHeight = CDibNew1->GetHeight();
int bitmapWidth = CDibNew1->GetWidth();
if (CDibNew1->GetRGB())
{
CPalette * hPalette=CreateBitmapPalette(CDibNew1);
CPalette * hOldPalette =
pDC->SelectPalette(hPalette, true);
pDC->RealizePalette();
for(int j=0;j<=bitmapHeight/10;j++)
for(int i=0;i<=10;i++)
{
::StretchDIBits(pDC->GetSafeHdc(),0, i*bitmapHeight/10, bitmapWidth,j,0, (9-i)*bitmapHeight/10, bitmapWidth,j,
pBitmapData, pBitmapInfo,DIB_RGB_COLORS, SRCCOPY);
Sleep(10);
}
pDC->SelectPalette(hOldPalette, true);
::DeleteObject(hPalette);
}
else
{
for(int j=0;j<=bitmapHeight/10;j++)
for(int i=0;i<=10;i++)
{
::StretchDIBits(pDC->GetSafeHdc(),0, i*bitmapHeight/10, bitmapWidth,j,0, (9-i)*bitmapHeight/10, bitmapWidth,j,pBitmapData, pBitmapInfo,DIB_RGB_COLORS, SRCCOPY);
Sleep(10);
Li Zhiyuan
13/09/2006
|
|
|
|
|
li zhiyuan wrote: urgent
Aren't they all ?
Make this code run in another thread. Have a stop flag, a bool that you check before StretchDIBits, which can be set from your main thread, and tells this thread to stop.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
Hi,
I try to to realize Thumbnail view, using CListCtrl. The bug is that items are selected even if I click near the item region to right or left. I was surprised that this bug is also present in AcdSee 7.0 but in windows explorer it doesn't occur. How fix it?
happynomm
|
|
|
|
|
I test it in my mechine. Both the explorer and my sample aplication behaves similarly. As u said the items is getting selected when u click near( very near ) to item right or left. Which version of "comctl32.dll" r u using. I test it in version 5.
nave
|
|
|
|
|
Thanks for your answer, Nave.
I test it under Windows XP SP1 and Comctrl32.dll version 6. I try it under Windows 2000 with Comctrls32.dll version 5 and it's all right as you said. It is possible to use version 5 under XP?
happynomm
|
|
|
|
|
if u remove the manifest file from the project, it will be using the version 5 of the Comctrls32.dll.
I test the same code in windows sp2. And that too is working fine here. If possible plz check that too.
nave
|
|
|
|
|
How can we customize a File Dialog ?
Please reply any source code links.
Thanking you
|
|
|
|
|
|
Here you go http://www.codeproject.com/[^] tons of source code their, browse through I'm sure you will come across the terms "subclassing", "ownerdrawn", "customize", "cfiledialog" somewhere in there.
|
|
|
|
|
HelloGuysHelpMe wrote: How can we customize a File Dialog ?
Readthis[^]. There is a section called Open and Save As Dialog Box Customization . Read that for more information.
|
|
|
|
|
WTL has such a class.
Steve
|
|
|
|
|
See here[^] maybe it is some helpful to you
|
|
|
|
|
I am new to this. I am using a CMonthCalCtrl contol. It works fine but when I click on a day I can not capture the event to highlight the day to show the user that it has been selected. (example: I click on the 5th and I want the 5th to be highlighted. I have tried to use the following event handlers:
afx_msg void OnMcnSelectMonthcalendar(NMHDR *pNMHDR, LRESULT *pResult);
afx_msg void OnMcnGetdaystateMonthcalendar(NMHDR *pNMHDR, LRESULT *pResult);
afx_msg void OnNMReleasedcaptureMonthcalendar(NMHDR *pNMHDR, LRESULT *pResult);
afx_msg void OnNMThemeChangedMonthcalendar(NMHDR *pNMHDR, LRESULT *pResult);
None seems to capture me clicking the 5th on the control. Do you have any ideals on what I could do to solve this problem?
RedSwampFroggy
|
|
|
|
|
How about GetCurSel() and SetCurSel() , but if you want to catch the actual mouse click then add a handler for the mouse button and use HitTest()
|
|
|
|
|
Yes I am trying to capture the mouse clicking on the calendar so I can use the SetCurSel(). I tried the HitTest() event but that only works on my dialog not when I click the calendar object. I am using a Tab control with the calendar object on one of the tabs. When I click a button the calendar appears. I have no trouble getting the date selected but the user will not know that the date was selected. I need a way to capture the user clicking the date inside the calander object so that I can set that date to be highlighted. Thanks for your help as it is greatly appreciated.
|
|
|
|
|
|
Thanks for the help and i will check out the link WhiteSky but I found that the date/time picker control was what i should have been using to start with. It does what i needed.
Thank All for the help.
|
|
|
|
|
Thanks to all that helped me get over my debug issues...
It turns out (as many suggested) that the code I was porting from 'c' and wrapping in an MFC gui had to lose all the old malloc/reallocs it had to work correctly without causing debug to puke. This manifested itself in strings for the most part.
From what several said, malloc uses a different stack than new, and was causing one to stomp on the other.
I must ask at this point...why? Is there a "safe" wrapper out there for malloc (to possibly save re-writing old code)? why did only debug have a problem with sharing methods? Based on call stacks examined while getting to the bottom of this, I saw CString using malloc and free deep down inside... why don't these cause issues?
Thanks again
|
|
|
|
|
new and delete call malloc/free internally, I believe, but if you're writing C++, the rule is to use new/delete. Apart from anything else, it gives you constructor/destructor behaviour.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
The key is if you use malloc /realloc to allocate memory you use free to deallocate the memory.
If you use new to allocate memory you use delete to deallocate it.
When I port code from C, I don't bother changing the malloc's. There's no point and it often causes more bugs than just leaving the mallocs/frees alone.
Anyone who thinks he has a better idea of what's good for people than people do is a swine.
- P.J. O'Rourke
|
|
|
|
|
It may not be the problem of my own procedure, because no matter what new projects I create, I got those 15 errors.
who can copy his winuser.h file and send to me? I am using VC6.0++
Thanks a lot!
my email: linq@kth.se
|
|
|
|
|
what is it with newbies thinking a copy and paste will solve all their problems. use #include <windows.h> instead.
|
|
|
|
|
Did you search on internet maybe you can find this file
|
|
|
|
|
I'm using Visual Studio 2005 and I wrote a DLL program in C. I want to add a status window to this DLL that creates a window and dynamically updates labels each time the DLL is called. What is the best and easiest way to do this? Should I use C++ and Windows Forms or use MFC?
|
|
|
|
|
mparent wrote: Should I use C++ and Windows Forms or use MFC?
You'd be using C++ in both instances.
The real question is, what sort of dll is it ? Is it using MFC ? Is it managed ? I'd go with whatever approach doesn't add a dependancy to the dll.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|