|
if u want to handle the messages passed to the controls, I think u will have to subclass them, I couldn't figure out there r some ways else could work out. , for the messages passed from controls, u need subclass the controls parent window which u have already done.
life is like a box of chocolate,you never know what you r going to get.
|
|
|
|
|
What I'm using: VS2005, MFC, and FreeImage 3.93 and the C++ wrapper class provided by the FreeImage author...
I've been playing around with this most of the weekend.
What I'm Doing: I have a CWnd in which I'm trying to show a slide show of images (contained in a folder on the hard drive). The list of files that can be displayed is contained in a CStringArray called m_saFileNames . The slide show is controlled by a couple of timer threads, one to allows the current image to be displayed for a certain length of time, and another that keeps the next image from being displayed for a certain length of time. These threads are firing their messages correctly.
I've allocated a pointer for the image object (fitWinImage* m_pLastImage ) in the CWnd's constructor. Here's the function that's called that displays the image.
void CSaverWnd::FadeOn()
{
TRACE("CSaverWnd::FadeOn()\n");
if (m_pLastImage)
{
CString sFileName = m_saFileNames.GetAt(m_nNextImage);
m_pLastImage->clear();
m_pLastImage->load(sFileName);
if (m_pLastImage->isValid())
{
CPaintDC dc(this);
ScaleImg(m_pLastImage);
int nImgWidth = m_pLastImage->getWidth();
int nImgHeight = m_pLastImage->getHeight();
int imgX = (int)((m_rect.Width() - nImgWidth) * 0.5);
int imgY = (int)((m_rect.Height() - nImgHeight) * 0.5);
m_rectLastImage.SetRect(imgX, imgY, imgX+nImgWidth, imgY+nImgHeight);
m_pLastImage->draw(dc.GetSafeHdc(), m_rectLastImage);
}
}
}
The problem: It shows the first image, but won't show any of the rest. I've verified that images are being loaded (the image size and name change each time this function is called), but the draw function doesn't seem to be doing anything beyond the first image.
Any help?
-- modified at 19:00 Sunday 8th April, 2007
Solved, but it wouldn't mean anything to anyone but me.
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
|
|
|
|
|
Are the dimensions in m_rectLastImage valid after the first image is displayed?
Never mind, I wasn't looking at the code carefully enough.
/ravi
|
|
|
|
|
is void CSaverWnd::FadeOn() being called by WM_PAINT corresponding function? if not, CPaintDC dc(this); the dc get in this way will not have a valid clipping filed in screen, means using that dc couldn't paint as u wished.
life is like a box of chocolate,you never know what you r going to get.
|
|
|
|
|
William.Wang wrote: CSaverWnd::FadeOn() being called by WM_PAINT corresponding function?
Nope, it's called by the OnFadeOn message handler, which is triggered when the FadeOff thread sends the appropriate message back to the window.
I'm writing a screen saver for myself because a) I can't find anything already written that I want to try, b) I don't really trust programs I get off the net anymore, and c) I've never written a screen saver before. The saver fades pictures and/or quotes on/off the screen.
I may even write an article about it when I'm done.
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
|
|
|
|
|
hi i am new to this language.....could u please suggest me how to create two applications using GUI in VC++????
it should display in the same screen...
-- modified at 16:04 Sunday 8th April, 2007
deepthi bhattachar
|
|
|
|
|
deepthi bhattachar wrote: could u please suggest me how to create two applications using GUI in VC++????
That's a pretty open ended question that can't be answered in a few paragraphs. If you're very new to MFC, I suggest you take a look at this[^] set of tutorials.
/ravi
|
|
|
|
|
I am deriving a class CCustomEdit from CEdit and overriding OnKillFocus.
I am using this CCustomEdit class for edit controls in my project.
In OnKillFocus of CCustomEdit I want to know which controls(preferably ID/object) is being used currently so that i have to check for validation based on the control's ID/object in OnKillFocus of CCustomEdit.
can somebody give me solution.
|
|
|
|
|
According to this[^] MSDN link, OnKillFocus() receives a pointer to the CWnd that's about to receive focus.
/ravi
|
|
|
|
|
But here i want the control id which lost its input.
|
|
|
|
|
Super Hornet wrote: i want the control id which lost its input.
The notification is sent to the control that has lost focus.
/ravi
|
|
|
|
|
has anyone used pkunzip.exe for unzipping files
Arise Awake Stop Not Till ur Goal is Reached.
|
|
|
|
|
deeps_cute wrote: has anyone used pkunzip.exe for unzipping files
It's not a good question for this forum and this question has two answers yes|no,however I suggest use of WinRar
|
|
|
|
|
deeps_cute wrote: has anyone used pkunzip.exe for unzipping files
Yes.
|
|
|
|
|
I use it regularly.
"If you can dodge a wrench, you can dodge a ball."
|
|
|
|
|
Hi,
I wish to parse the EML file ie, storing the EML file contents into
From, To, Cc, Bcc strings and attachments to the corresponding formats.
Please could you specify where i can get the source code for doing this task or suggestions for achieving this would be appreciated in advance...
Regards,
nag.
|
|
|
|
|
Refer to this[^] link.
Nobody can give you wiser advice than yourself. - Cicero
ப்ரம்மா
|
|
|
|
|
Hi,
Thanq for ur prompt response...sorry for the delayed reply...
I searched on "Parse eml files" in the google...but all the links are showing the third party softwares and using MAPI.
I don't wish to use third party tools and MAPI. It should be done by reading the raw data. EML file should be parsed and stored the Attachments in the corresponding files, From, To, Cc and other fields in respective fields. The html body should be stored in plain data.
Please could you specify where can i get the code snippets for achieving this.
Regards,
nag.
|
|
|
|
|
Hi,
I want to use gdi+ in VC++ 6 from where I can get the GDI+ SDK i.e. gdiplus.lib .. etc?
Please help.
Regards
Avinash Gupta
1st Year B-TECH Student(CSE),
ITER India.
|
|
|
|
|
|
u can search gd+ in net, you will get all these.. You need to include
gdiplus.h in your project to use it.
If u can Dream... U can do it
|
|
|
|
|
We are designing a program to diplay the contents of 2 files in an edit box by havin 4 buttons start1 stop1 start2 stop2 that do corresponding jobs.So we are clueless as to how to do the program.Can u send links relating to the program
|
|
|
|
|
Not enough clarity in your request for anyone to be able to help.
what, precisely, are start1, start2, stop1, stop2 expected to start and stop doing? When you say "display the contents of two files in an edit box" one would expect that you mean you are diplaying the text content of two files (that's what edit boxes do). So what is the pupose behind the start and stop buttons (are they meant to browse for and open the files?, close the files?).
Read the post at the top entitled "How to get an answer to your question". Pay particular notice to item 2.
|
|
|
|
|
how to know that the adapter(either lan or wireless) is disconnected in wmi
|
|
|
|
|
use netconnectionstatus in win32-networkadpater. if this is 0 -> disconnected
Arise Awake Stop Not Till ur Goal is Reached.
|
|
|
|