How to make a custom file dialog control read-only? - winapi

I'm looking at custom dialog controls, which are added by using the IFileDialogCustomize interface, and I can see ways to do most of what I need, but there's one thing I don't see: How can I set a particular control to read-only status under certain circumstances? Is there any way to do this?

Related

What is imgMain control in visual Basic 6?

I'm using a VB6 application as a reference and have come across imgMain. I'm assuming its an image control, however, I cannot find the object on any of the forms. It's used to load the image. I'm just not sure what's going on with this. I'm assuming its an IMAGE CONTROL, but I cannot find this on any of the forms? it's mentioned a lot of times in teh application as it lets you view incoming faxes and stuff.
Without having a look on source code i assume It might be custom user control that was created for some reasons probably to extend basic picturebox control.
One thing i can advise you is to further inspect code and dig to code of this custom control. If code for this control is not available then see what methods and properties instances of that particular control uses and compare them with regular picturebox.

Which is the most appropriate mfc control to use while creating a dialog window to modify values in a database?

I have to modify existing entries in a database. My Addition entry dialog uses edit controls in order to get values and a submit button to update in database.
I have the need to create a modify dialog that should be able to modify entries when needed by user. Is there appropriate mfc control that can be used for my task?
If you do not want to edit directly on the list control, you can use CListCtrl or CMFCListCtrl.
I think MFC does not provide a list control for editing directly. So, if you want to do it, consider using a 3rd party, like the free Ultimate Grid.

Is there a JPanel equivalent for MFC

Im my application I want to implement the feature of when a user click on a button show a Panel which will consist of some user controls. I know In Java I can easily use Jpanel and use setVisible() method to get this done easily. But this is an MFC application. I couldn't find any built or customized component that I can use for my purpose.
I also tried GroupBox. But it is not grouping the components logically.
What would be the best approach for this?
As user1793036 says, start by creating a dialog resource and CDialog derived class for the panel. In the dialog resource properties turn off the Title Bar style. In the code call Create for the dialog and then SetWindowPos to place it where you want it to appear.
MFC is nothing but a thin wrapper over Win32 API for windows and controls. The core Win32 API doesn't provide any feature to group controls in a group-box or panel. One way is to have a window and make that window parent of all required controls. Unfortunately, this isn't easy to do.
I suggest you, since you are learning, to drop the idea. Instead, learn what you can achieve with existing set of features provided by MFC/Win32. With MFC/Win32, you would, mostly need to derive/subclass a class/window to get something fancy (such as colored list-control).

Activereports (under VB6) issue

I have to modify an old VB6 program that uses ActiveReports 2.0 at work and I am having some problems (BTW I have never used this program before and only have a basic knowledge of VB6)...
I have to make some text boxes biggers which is pretty easy to do but as soon as I move them a whole section of text (and not simply the content of that text box) disappear.
I have noticed that it was in some sort of section (sorry, I don't know how they call that) which englobed those text boxes so I made it bigger and that made no difference.
What could be causing this?
Thank you!
Nick
It sounds like the TextBox is inside a UserControl. A UserControl is created by a developer, and is basically one control with any number of other controls in it. You can check to see if there are any User Controls in your project in the Project Explorer (Ctrl+R).
One way to know exactly what class the control belongs to is to open your form in design mode (Shift+F7), click on the control, and look at the Properties window (F4). The drop-down list should show the currently selected control's class name in bold, then the name of the object.
What is the control's class? If it is anything other than TextBox, then this would explain the unexpected behavior you experienced.

How to derive class from CFindReplaceDialog? (MFC)

Is it possible to derive custom-built dialog from CFindEditDialog? I want to build a dialog template in Viasual Studio Resource Builder (to draw it), then to hide the default Find dialog window and to use my instead.
MSDN says:
To customize the dialog box, derive a
class from CFindReplaceDialog, provide
a custom dialog template, and add a
message map to process the
notification messages from the
extended controls. Any unprocessed
messages should be passed to the base
class.
Customizing the hook function is not
required
Has anyone had any experience with this?
While I don't have direct experience with this (but close others), it is quite possible and should be easish. Most of the messages will be implemented virtually, so you mearly need to override the ones you're interested in with code you add.
Code project has an artical that talks about CFindEdit. It might be helpfull
http://www.codeproject.com/KB/cpp/Media_PlayerByyazan_nemer.aspx
If you take a look at the oninitialize event for an of your dialogs, you should see how events are worked into inherited classes.

Resources