|
I have the following static function in my class. (I also have a non-static function that takes no arguments and simply calls HandleMessages(m_hWnd, true). The reason I gave it the option to not do Idle processing is that OnIdle will kill the table that maps your CWnd's to HWND's. That is, if you have a temporary CWnd*, it will be useless after Idle processing happens. Anyway, all the function does is mimic what your program does while it's sitting around doing nothing. (The declaration is private: static void HandleMessages(HWND hWnd, bool bIdle = true))
void CypherusDlg::HandleMessages(HWND hWnd, bool bIdle )
{
MSG msg;
while (::PeekMessage(&msg, hWnd, 0, 0, PM_NOREMOVE))
{
if (!AfxGetApp()->PumpMessage())
{
break;
}
}
if(bIdle)
{
LONG lIdle = 0;
while (AfxGetApp()->OnIdle(lIdle++))
{
}
}
}
|
|
|
|
|
Hi,
We are having a problem with our MFC application which seems to be related to MFC's temporary/permanent handle map mechanism. Our application incorporates HTML Help functionality. If we bring up the HTML Help file, the application asserts when it is being closed. This does not happen in case the HTML Help file is not brought up.
We had break points in most of the Wincore.cpp functions. Our point of concern is the CHandleMap not getting the correct pointer. Following is the statement which causes the problem
CHandleMap* pMap = afxMapHWND();
ASSERT(pMap != NULL);
We debugged into afxMapHWND() to find some details. From what we have seen, member variable m_pmapHWND should not be NULL. This map contains both temporary and permanent Maps for CWnd vs HWnd for the windows created by application vs windows opened by the application.
Any pointers on why the m_pmapHWND attribute gets invalidated in case the HTML Help file is brought up would be greatly appreciated.
P.S. The call to HtmlHelp API is:
HtmlHelp(0, strFileName , HH_HELP_CONTEXT, nContextID);
|
|
|
|
|
Hi,
Is it possible to save an HICON(from a CImageList) into an ico file with VC++.
I've got the ico file structure, but I don't know how can I have a DIB from my HICON...
Thanks a lot, for help
Vincent
|
|
|
|
|
i am eager to wait your reply.
thanx
|
|
|
|
|
The Rogue Wave/Stingray package has a class to display GIFs, its the only one I know of.
The reason there are not many such classes is that to use GIF you have to buy an expensive license from Unisys. I looked into this once, and couldn't even find a person at Unisys who could tell me how to go about getting GIF license. I concluded that Unisys would rather sue people using GIFs than sell them a license.
Is there any reason your application can't use PNG or JPG formats? There are plenty of good classes for these formats.
|
|
|
|
|
Yup, I agree... If your app doesn't _need_ to be GIF-compatible, use PNG.
Also, check out http://www.paintlib.de. Some very usefull stuff here, if you ever menage to compile it
Enjoy!
Marc
|
|
|
|
|
MArc, if, like me, you got paintlib 2.3 the day it came out, the gif link was pointing to the wrong source - I needed to make a number of changes to get that one to compile, although I believe the one up now is quite alright. The other thing you may find ( at least I did ) is that the jpeg encoder swaps the r and b values, which I have written to tehm about.
paintlib rocks. it also has a mailing list where you can get help on these sorts of issues, and gets around the gif issue by using a library that reads them and writes them uncompressed ( i.e. no patent infringement )
Christian
The content of this post is not necessarily the opinion of my yadda yadda yadda.
To understand recursion, we must first understand recursion.
|
|
|
|
|
Hi Guys!
Do you all mean -> GIF images OR -> ANIMATED GIFs?!
If it is about Animated GIFs, then I had posted here before, also I tried other places. Unfortunately never got replies!
If it is about just the GIF image loading/veiwing, then the PaintLib is excellent!
However, I am still interested to have any reply on the Animated GIF programming, something like the things we do with AVIs.
"Silence is golden, but my eyes still see."
-- Masoud Samimi
Website: www.geocities.com/samimi73
|
|
|
|
|
An animated GIF is just lots of gifs, isn't it ? Have you looked on the web for a file format ?
Christian
The content of this post is not necessarily the opinion of my yadda yadda yadda.
To understand recursion, we must first understand recursion.
|
|
|
|
|
Hi Christian!
Thanx for reply. You mentioned:
An animated GIF is just lots of gifs, isn't it ?
True! But as an AVI is just lots of BMPs, yet needs alot to be done inorder to put the BMP guys together and make the AVI, Right?
OK, just last night by searching in the google.com, I have found couple of good stuff w/source codes, but not at all windows based (UNIX). So I was gonna see them later and find out what I could use from it.
I'll post the links here later.
"Silence is golden, but my eyes still see."
-- Masoud Samimi
Website: www.geocities.com/samimi73
|
|
|
|
|
In fact that's pretty easy!! You don't need any 3th party library, if you're using VC6.0, you have everything you need.
The solution is to use the IPicture interface. You just have to use ::OleLoadPicturePath to load the GIF file and then IPicture::Render to actually draw the picture.
If you need more information, I could send a sample application to you.
If you need to display animated GIF files, that's different However I can remember that there is an ATL control which does that. You can find it in www.codeguru.com
|
|
|
|
|
I need putting some animated gifs on my dialog.
I have downloaded a class named "CGif98a".Unfortunately it is not a good class .Anyone have used this class?
|
|
|
|
|
|
Hi Again!
OK, Console app proj in VC++6, Compiled fine! Ran the EXE from dos! BUT got an ERROR!?
Here is the copy of my dos prompt stuff:
C:\gif>mygif
whirlgif Rev 3.02 (c) 1997,1998 by Hans Dinsen-Hansen
(c) 1995,1996 by Kevin Kadow
(c) 1991,1992 by Mark Podlipec
Usage: whirlgif [-o outfile] [-loop [count]] [-time #delay]
-disp [ none | back | prev | not ]
[ -i listfile] file1 [ -time #delay] file2 ...
C:\gif>mygif -o test.gif -loop 5 -time 5 -disp prev -i resume_s.gif -time 1 email_s.gif -time 1 orders_s.gif -time 1
whirlgif Rev 3.02 (c) 1997,1998 by Hans Dinsen-Hansen
(c) 1995,1996 by Kevin Kadow
(c) 1991,1992 by Mark Podlipec
Can't open GIF89ad for reading.
C:\gif>
You can see the line: Can't open GIF89ad for reading.
I feel !
"Silence is golden, but my eyes still see."
-- Masoud Samimi
Website: www.geocities.com/samimi73
|
|
|
|
|
WhirlGIF is a program to *create* animated GIF files; it does not
display them at all.
What seems to be searched for is MFC code to *display* animated GIF files.
|
|
|
|
|
Can't you CODE! Then drink the MAD COW's MILK!
Some people seem to wanna be BORN 29 years old READY! NOT 9 months! HEHE!
"Silence is golden, but my eyes still see."
-- Masoud Samimi
Website: www.geocities.com/samimi73
|
|
|
|
|
First, send Unisys a check for $2,500, unless your app can run on a server and work in real-time serving GIFs to network requests, in which case the price goes up.
And, you file a report to Unisys every 3 months detailing the number of copies of your app that you've sold, what the selling price is.
And if you're writing trialware or shareware, you have to ensure that people can't use the GIF capabilities for more than 30 days before registering.
And, before you do any of this, you have to sign a ten page contract, written by a very expensive lawyer stating that you will do all of this (and more!).
use PNG. GIF is weak.
-c
|
|
|
|
|
can we have animated png?
|
|
|
|
|
I have a very big word-list of a dictionary (up to hundreds of thousand) and I want my user can browse them in a list-box but the list-box is limited 32,767 items on Win9x, even if my app will run on
WinNT, I know, load entire word-list into list-box is not a good solution.
Can I implement virtual-list feature with list-box control ? and how ? I do not want to use list view control because I do not need conlumns, headers... they add much overhead.
Thanks for your helping,
Do Quyet Tien
|
|
|
|
|
why flickering during motion of text
|
|
|
|
|
given the great depth of information provided, I would suggest one of the following
1/ you are drunk
2/ your monitor is stuffed
3/ your glasses are dirty
4/ you need glasses
5/ you have a nervous twitch
6/ presuming for a moment that you are moving text in a window, the problem may be ( making gross assumptions about what you are doing and what your code looks like ) that you are using the dc provided in OnPaint directly ( or OnDraw ), when you should be drawing to a memory dc and blting it in one go, or using onPrepareDC, depending on which of the two methods mentioned you may, or may not be using.
In other words, I might know the answer, but it's hard to tell if you are not going to bother giving any details when asking the question.
Christian
The content of this post is not necessarily the opinion of my yadda yadda yadda.
To understand recursion, we must first understand recursion.
|
|
|
|
|
Try to do something like this in the drawing routine:
CPaintDC dc(this);
Crect rcClient;
GetClientRect(&rcClient);<p>
CDC memDC;
memDC.CreateCompatibleDC(&dc);<p>
CBitmap memBmp;
memBmp.CreateCompatibleBitmap(&dc,rcClient.Width(),rcClient.Height());<p>
CBitmap *pOldBmp = memDC.SelectObject(&memBmp);<p>
dc.BitBlt(0,0,rcClient.Width(),rcClient.Height(),&memDC,0,0,SRCCOPY);
memDC.SelectObject(pOldBmp);
Hope you can use this.
Enjoy!
Marc
|
|
|
|
|
why flickering during motion of text
|
|
|
|
|
Hi,
I am trying to invoke HtmlHelp from a MFC SDI Application by using the 'HtmlHelp' API call. I have obtained a compiled html file (*.chm) from a third party. The problem is that when I invoke HtmlHelp, it comes up fine but when the application terminates (Normal shut down - pressing the close button of the FrameWnd) an exception is raised (in debug version of the application, a debug assertion is raised).
I have tried creating a sample MFC (SDI) exe and call the *.chm file from it. In this case it works fine. So I guess there must not be any problem with the *.chm file
Regarding my application, some points are
1. I am using Sting Ray Objective Grid to implement Grid facility in some dialogs
2. When my application was initially generated using MFC AppWizard, I had selected Context-Sensitive Help. But I am not using that anymore as I am going for HtmlHelp. Is there any way to turn Context-sensitive Help off. Could that be causing the problem?
3. Is there anything specific to be taken care when 'HtmlHelp' API is used? I have tried using NuMega BoundsChecker to locate the problem. BoundsChecker says that 'possible wrong usage of CreateThread function, _beginthreadex has to be used' Does HtmlHelp API create a new thread by itself?
I would be grateful if any one can help me out...
Thanks,
Unni
|
|
|
|
|
What's the ASSERTion?
Possibly involved with trying to free up the help path string, which is now kafuffed (sp) because you are bypassing the regular help init? BoundsChecker would probably flag that one as well though. Press 'retry' on the assert dialog...
|
|
|
|
|