|
DavidCrow wrote: While your code may not be doing it directly, a BM_SETCHECK message is being sent to the control, thus the control's handler is doing what it should. If this is undesirable behavior, there's an easy solution.
By easy solution you mean removing the SetCheck(FALSE) call in OnInitDialog(), I tried that with no difference.
Any other suggestions?
Thanks!
jpyp
|
|
|
|
|
jpyp wrote: By easy solution you mean removing the SetCheck(FALSE) call in OnInitDialog()...
No, I did not mean that at all. Try:
void CMyDialog::CMyDialog()
{
m_bInitializing = true;
}
BOOL CMyDialog::OnInitDialog()
{
CDialog::OnInitDialog();
...
m_bInitializing = false;
return TRUE;
}
void CMyDialog::OnButtonChange()
{
if (! m_bInitializing)
{
}
}
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
Thanks for your reply. However this will not help as the handler is being called after OnInitDialog() completes so in OnButtonChange() m_bInitializing will always be FALSE.
This is driving me crazy. This behavior does not happen with my other dialogs.
jpyp
|
|
|
|
|
jpyp wrote: the handler is being called after OnInitDialog() completes
It almost sounds like UpdateData() is the culprit.
What I don't understand, however, is why this is a problem. I've called SetCheck() within OnInitDialog() in several of my programs and it works fine. Can you explain a bit further what the actual problem is?
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
I'll investigate the UpdateData() idea.
See my last post to Mark with regard to more explanation on the problem.
Thanks!
jpyp
|
|
|
|
|
Is there any simple way of reading JPEG and TIFF images without using all those big libraries?? My images are no more than 512x512, so the images are pretty small. I would like to know a easy way to read the height, width and pixel data of the image nothing more than that.
Any suggestions??
-thanks
Pavan
|
|
|
|
|
Read the documentation on the File Formats and implement your own code to obtain the width and height and pixel data, if you call that "simple"? Or were you looking for the "Magic" solution?
led mike
|
|
|
|
|
led mike wrote: Read the documentation on the File Formats and implement your own code to obtain the width and height and pixel data
I know from experience how many trips to McD's THAT project takes!
"Posting a VB.NET question in the C++ forum will end in tears." Chris Maunder
|
|
|
|
|
Why didn't you just use the "magic" solution? You could call yourself "The Great Salsbery"
led mike
|
|
|
|
|
I would only use those powers for evil
"Posting a VB.NET question in the C++ forum will end in tears." Chris Maunder
|
|
|
|
|
led mike wrote: Or were you looking for the "Magic" solution?
You mean such like SetDIBitsToDevice ?
|
|
|
|
|
Now why would you give away secrets like that on a public forum like this??
"Posting a VB.NET question in the C++ forum will end in tears." Chris Maunder
|
|
|
|
|
Mark Salsbery wrote: why would you give away secrets like that on a public forum
Maybe it was a secrect but now its not
|
|
|
|
|
Mark Salsbery wrote: Now why would you give away secrets like that on a public forum like this??
Would you prefer to answer questions in Mark's forum all alone?
|
|
|
|
|
Nah. It's just those magic solutions are scary...luckily I have the worm's wart, frog's breath,
and chicken feet nearby...
"Posting a VB.NET question in the C++ forum will end in tears." Chris Maunder
|
|
|
|
|
Moak wrote: You mean such like SetDIBitsToDevice?
Pavan Tiruveedhula wrote: without using all those big libraries??
Last time I checked that was part of big library.
led mike
|
|
|
|
|
I would say the least amount of work and impact on your projects would be to use GDI+.
It comes with recent Windows versions and you can load images with a couple lines of code.
Mark
"Posting a VB.NET question in the C++ forum will end in tears." Chris Maunder
|
|
|
|
|
Pavan Tiruveedhula wrote: Is there any simple way of reading JPEG and TIFF images without using all those big libraries??
I read your message as decoding an image format into raw RGB values. If you for example take uncompressed TIFF files (see Google), it's a rather simple parsing of file header and reading binary data. For a more complex format like JPEG you would need to implement the complete algorithm for decompressing/transforming... or just use a free library.
Btw, Windows GDI allows you to draw JPEG/PNG image data without manual decoding, see SetDIBitsToDevice. Easy peasy.
Hope it helps.
|
|
|
|
|
|
Pavan Tiruveedhula wrote: Is there any simple way of reading JPEG and TIFF images without using all those big libraries??
GDI+ is the easiest option here. But, the point of libraries is to MAKE it easy, by stopping you from having to write the code yourself.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
You're going to need a big library if you want to draw TIFF images because there is no code built into MFC or Windows to load TIFF images. I recommend FreeImage. It has all the best features, and even works on mobile devices. You can (with a little programming ability) even reduce the "big library" down to the absolute minimum that only supports the image types you intend to load.
"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
|
|
|
|
|
Is there a C/C++ function that will tell how many bytes are valid in a buffer?
|
|
|
|
|
not in general.
if it was allocated with GlobalAlloc/HeapAlloc, you can get the size with GlobalSize/HeapSize.
|
|
|
|
|
kani98 wrote: Is there a C/C++ function that will tell how many bytes are valid in a buffer?
Of course not. That can only be determined by the code that placed those bytes in the buffer to begin with.
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
Yes
What's a "buffer"?
led mike
|
|
|
|