|
I don't think you can put resources into a static library....
Steve S
Developer for hire
|
|
|
|
|
Thanks!
|
|
|
|
|
|
The idea I beleive was just that you could use stdafx as a way to get your includes type behaviour down. If you're writing code for non MS compilers as well, you shouldn't use stdafx, because you can reproduce the behaviour without having that nasty #ifdef ( nasty in the sense that you're making work for yourself, you can't rely on the stdafx, so why use it at all ? )
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
|
I have a dialog that displays gif or jpeg images in a Picture control (CStatic). I can load the images from file and display them.
I have changed the size of the image to thumbnail size and I want the now save the image to disk. How is this done?
CPicture m_pMyPicture; // picture
CStatic m_cThumbCtrl; // static control
So many examples on loading and viewing but none on writing to disk! I don't know where to start.
"Complexity breeds problems. Keep it simple." - Mark
|
|
|
|
|
Your best bet to save images is GDI+. I have a number of articles on this site on using GDI+ in C++.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
Don't take this personnally, but everyone seems to be pushing GDI+ which I don't have installed. I tried installing it and couldn't seem to get anywhere with it so I gave up. I know what I want to do has been done long before GDI+ was every written.
"Complexity breeds problems. Keep it simple." - Mark
|
|
|
|
|
Yes, there are other options. All of them are cross platform libraries ( which, in response to your 'I want to do it myself' comment, all use libjpg, for example, no-one is silly enough to try to impliment jpeg themselves ), and all of them are going to be considerably messier than GDI+, which, I'm sorry, is trivial to set up so that it loads and saves jpg and bmp. If you look for an article I wrote called 'doodle', I believe that will contain all the code you would need.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
I have looked at your Doodle program and I now have a better understanding of how to get GDI+ to work.
Thanks.
|
|
|
|
|
|
Thanks but I don't want to use someone else's classes. I would rather learn how to do it myself. It's easy to use other people's hard work.
Also a lot of extra code for such a simple program as mine.
"Complexity breeds problems. Keep it simple." - Mark
|
|
|
|
|
See CImage::Save for save an image.
|
|
|
|
|
You could always look at how it's solved in CXImage. Do you really want to write and debug code which encodes gifs and jpegs? You seriously need a hobby man!
--
Mit viel Oktan und frei von Blei, eine Kraftstoff wie Benziiiiiiin!
|
|
|
|
|
Hello!
I've made simple MFC program. I sent it to my friend, and he told me that he is getting an error while executing. The message box says that the configuration is corrupted and reinstall of this app. might help (something like that). He tryied to run this app on 3 more computers always getting the same error.
Please help!
|
|
|
|
|
Sounds like you didn't give your friend the DLLs that your program needs to run.
|
|
|
|
|
But how to find out which dll's does he need, and where sholud he place it?
This program is a simple dialog, made with app wizard. With a press of a button I create modal window.
Can't anything be done while debugging/linking...some build options?
|
|
|
|
|
You can use a program called Depends[^] to see what DLLs your program is dependent upon. You might just want to change your project settings to statically link with the runtime and you might not have to distribute any DLLs at all.
|
|
|
|
|
There is a lot of dll's that application depends on. It is hard to check every machine before runnig a program on it.
I don't know if i'm getting it correct (this sattically link), but I've changed in project properties to "Use MFC in Static Library". It didn't worked.
|
|
|
|
|
Then I think that we will need a bit more information to be able to help.
|
|
|
|
|
|
What version of compiler you using? What kind of project is it? What is the error that you are getting?
|
|
|
|
|
Microsoft Visual Studio 2005
Version 8.0.50727.42 (RTM.050727-4200)
Microsoft .NET Framework
Version 2.0.50727
Installed Edition: Professional
Microsoft Visual C++ 2005 77626-009-0000007-41598
Microsoft Visual C++ 2005
Project:
Dialog window made with MFC Application Wizzard. I added only: 1 button to main window, create 1 dialog and call it as Modal window tih this botton.
|
|
|
|
|
As Christian pointed out, it is entirely possible that you need to give him the runtime libraries. For your version of VC it will be the msvc*80.dlls. There should only be a couple of them.
Why is common sense not common?
Never argue with an idiot. They will drag you down to their level where they are an expert.
|
|
|
|
|
If he has XP, it could be a problem related to a missing manifest file ? If you linked statically to MFC, it's probably the C run time that you're using and need to distribute. What version of VC are you using ?
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|