|
thanku for ur suggestion
if u knw it or u can rather tell me how to read a pst file or in what file format does it contains its content or anythig related to a pst file
it'll be helpfull
thanxs
|
|
|
|
|
I thought I'd answered that question ?
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
if you want to read pst files see here[^]
|
|
|
|
|
I'm trying to move several CDialog-based classes to a common .lib file that will be statically linked.
I understand all the hoo-hah about resource handles when you're doing this with .dll's, but is there some magic dance I have to do to get dialogs to work when they're defined in a .lib?
My main program links to the lib just fine, but CDialog::DoModal() exits here:
if (lpDialogTemplate == NULL)
return -1;
What's more, when I open my executable file as resources in VS, the lib dialogs do not show up.
I know for a stone cold fact that this can be done, because I can statically link to external commercial libs like Stingray and get their dialogs to pop up. But I have studied that source code in vain for any clue as to why theirs works and mine doesn't.
Any suggestions?
|
|
|
|
|
how did u call the domodal of a dialog in the lib? I think this will be the issue of the resources handle.
overide the DoModal function in a derived class of the CDialog. And call
AFX_MANAGE_STATE(AfxGetStaticModuleState( )); and then call the base class' DoModal.
int MyDlg::DoModal()
{
AFX_MANAGE_STATE(AfxGetStaticModuleState( ));
return CDialog::DoModal();
}
nave
|
|
|
|
|
Naveen R wrote: overide the DoModal function in a derived class of the CDialog. And call
AFX_MANAGE_STATE(AfxGetStaticModuleState( )); and then call the base class' DoModal.
That causes CDialog::DoModal to fail here:
HINSTANCE hInst = AfxGetResourceHandle();
because of an ASSERT:
_AFXWIN_INLINE HINSTANCE AFXAPI AfxGetResourceHandle()
{ ASSERT(afxCurrentResourceHandle != NULL);
And the CDialog resource is STILL not being linked into the executable. If I make a program that uses a statically-linked Stingray library and I open the executable as resources in VC, I can see the Stingray dialogs, whereas in my program, I cannot see the resources (and I even made sure that resource IDs were not duplicated in the lib and the main program).
I think this is the key issue here, the resources are simply not being linked into the executable for some reason.
|
|
|
|
|
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.
|
|
|
|