Click to See Complete Forum and Search --> : Common Dialog


Hexie
April 20th, 1999, 11:10 PM
Hi,

I have an MFC app. On a form, I have a picture box, a button, and a common dialog OCX. When the user presses the button, I want to popup an open dialog then use that information to load a new picture.

I realize there is a CFileDIalog class, but it needs to be initialized, is this right?
Also there is a GetOpenFileName method of the class that I can use to actualy popup up the dialog, but this method requires a pointer to an OPENFILENAME structure. But this structure I already filled out in the IDE in the property sheet of the common dialog OCX. How do I get a pointer to this property sheet?
I plan on fetching the result from the structure and storing it in a CString asuming the boolean from the GetOpenFileName is true.
How do I use this string to load the picture into the picture box?

Thanking You In Advance
Hexie