CCC_Dialog_EditFile *pDlg = new CCC_Dialog_EditFile(this );
Obviously this pointer is to the base class, is it?
No. The 'this' pointer is to the parent window.
If you're wanting to have the dialog manipulate values in the parent, there are a couple of ways to do that. You can either pass pointers to the variables in the dialog's constructor, or you can pass the variable values in, and then have a way of retrieving them. I prefer the second method, since it's easier to handle the case where the use clicks the Cancel button to close the dialog.
it looks like I am getting closer to what I want to accomplish.
I cobbled this "solution"
The parrent calls the dialog with (this) pointer.
The dialog retrieves handle from passed pointer and than I build another
CWnd to get to the caller variables. ( Can't show you now because my mashine is overloaded with restoring the RAID arrays and I don't want to get any " cannnot access because it is in use ").
I have not gotten to actual work on the variables - still working on the dialog "results" actions.
I like your approch and will try it.
But...I am still curious why the "standard" constructor get the CWnd pParent and how to use this pParent pointer "properly".
PS Sorry no spell check - my MS Word is in gone for couple of hours.
I am still curious why the "standard" constructor get the CWnd pParent and how to use this pParent pointer "properly".
Passing the parent window to the dialog constructor lets the dialog disable the parent window if the dialog is used modally. You've seen examples of this before. For example, when you run Notepad and select File, Print, the Print dialog is modal and you're not allowed to interact with the Notepad window again until you dismiss the Print dialog.
Most of the time, passing this parent window pointer to the standard constructor is sufficient. If you need the parent window later on in the dialog for some reason, it's better to call the GetParent() function rather than use a saved copy of the parent window pointer.
i have been searching an *easy* way to place pictures on a dialog box. indeed i can use the static control from the toolbox but then i'll have to use CWnd::SendMessage to change the picture at runtime. isn't there anything like the VB6 picture control or image control? i saw someone mentioning CImage somewhere but it's nowhere on the MSDN. does that mean it's a user-defined class? if anyone has ever used it please tell me. or shall i just go for the static control? thanks.
Is it just me, or is there no way to do a direct conversion from ANSI to UTF8 in one call? Currently, I'm converting from ANSI to UTF16, and then from UTF16 to UTF8 (MultiByteToWideChar et al). That's rather clumbsy...