Re: CreateDialog in MFC Extension DLL
"Bubba" <bubba@nowhere.com> wrote in message
news:7LKdnVddiYL5G1vUnZ2dnUVZ8vyWnZ2d@bt.com...
Hi,
I have created an extension DLL to process some data. However due to the
nature of the process and the data I want to create multiple instances of
this. So oo provide the user with an indication of each processes state I
want to create a dialog (used to feedback progress) using a template
(since each process is identical).
I can get a single instance of a dialog to appear, but the application
that creates it can't continue until the dialog is terminated, and I'm not
to sure how to create multiple instances of it, assuming it's even
possible.
i.e.
Feedback * _pf1 = new Feedback(...) ;
Feedback * _pf2 = new Feedback(...) ;
_pf1->ShowProgress() ;
_pf2->ShowProgress() ;
This, or a variation of it, would then produce two identical dialogs on
the screen, each of which would show a differing state of progress.
I simply want to create x number of instances of this dialog with each
dialog self-contained in that each dialog must have it's own WndProc
handler so the user can cancel any individual process. However I can't
seem to do this as using:
_hWnd = CreateDialog(_hInstance, MAKEINTRESOURCE(101), _hWndParent,
(DLGPROC) Feedback::WndProc);
generates errors.
Whatever the error message is probably would have given a nice hint.
If Feedback::WndProc is a static member function then, by definition, there
is only one of them so you can't have two instances.
If Feedback::WndProc is non-static then it is incompatible with the required
CALLBACK calling convention and shouldn't compile.
This being an MFC newsgroup, and your DLL being an MFC extension DLL, have
you considered using MFC?
There should be no problem creating two instances of an MFC modeless dialog.
Call CDialog::Create in the constructor of your CDialog-derived class.
--
Scott McPhillips [VC++ MVP]