Click here to Skip to main content
15,922,015 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: CArray storage options Pin
CPallini6-Jan-11 3:59
mveCPallini6-Jan-11 3:59 
AnswerRe: CArray storage options Pin
Aescleal5-Jan-11 11:37
Aescleal5-Jan-11 11:37 
AnswerRe: CArray storage options Pin
Maximilien6-Jan-11 1:08
Maximilien6-Jan-11 1:08 
AnswerRe: CArray storage options Pin
Nemanja Trifunovic6-Jan-11 3:52
Nemanja Trifunovic6-Jan-11 3:52 
GeneralRe: CArray storage options Pin
bob169726-Jan-11 11:24
bob169726-Jan-11 11:24 
AnswerRe: CArray storage options Pin
bob169726-Jan-11 11:15
bob169726-Jan-11 11:15 
QuestionSaving a web page as image Pin
eight5-Jan-11 5:56
eight5-Jan-11 5:56 
AnswerRe: Saving a web page as image Pin
RaviRanjanKr5-Jan-11 6:39
professionalRaviRanjanKr5-Jan-11 6:39 
GeneralRe: Saving a web page as image Pin
eight5-Jan-11 15:04
eight5-Jan-11 15:04 
Questionsimple string problem - Noob Pin
Paul Hasler5-Jan-11 3:37
Paul Hasler5-Jan-11 3:37 
AnswerRe: simple string problem - Noob Pin
User 74293385-Jan-11 3:50
professionalUser 74293385-Jan-11 3:50 
GeneralRe: simple string problem - Noob Pin
Paul Hasler5-Jan-11 4:00
Paul Hasler5-Jan-11 4:00 
AnswerRe: simple string problem - Noob Pin
guyee5-Jan-11 3:51
guyee5-Jan-11 3:51 
GeneralRe: simple string problem - Noob Pin
Paul Hasler5-Jan-11 4:01
Paul Hasler5-Jan-11 4:01 
Questionfatal error LNK1561 entry point must be defined Pin
Joao Araujo5-Jan-11 3:27
Joao Araujo5-Jan-11 3:27 
QuestionRe: fatal error LNK1561 entry point must be defined Pin
David Crow5-Jan-11 4:57
David Crow5-Jan-11 4:57 
Questionhow can find how thread running in my application Pin
Le@rner4-Jan-11 23:56
Le@rner4-Jan-11 23:56 
AnswerRe: how can find how thread running in my application [modified] Pin
Nuri Ismail5-Jan-11 0:04
Nuri Ismail5-Jan-11 0:04 
GeneralRe: how can find how thread running in my application Pin
Le@rner5-Jan-11 1:12
Le@rner5-Jan-11 1:12 
QuestionReplace dialog in FormView Pin
jaknupp4-Jan-11 23:39
jaknupp4-Jan-11 23:39 
AnswerRe: Replace dialog in FormView Pin
bleedingfingers4-Jan-11 23:46
bleedingfingers4-Jan-11 23:46 
GeneralRe: Replace dialog in FormView Pin
jaknupp5-Jan-11 9:47
jaknupp5-Jan-11 9:47 
GeneralRe: Replace dialog in FormView Pin
bleedingfingers5-Jan-11 21:31
bleedingfingers5-Jan-11 21:31 
GeneralRe: Replace dialog in FormView Pin
jaknupp6-Jan-11 17:29
jaknupp6-Jan-11 17:29 
I actually did find something useful. Adding this line to the CFormView constructor lets you use any dialog for the form view:

CMFCView::CMFCView()
: CFormView(CMFCsdi2View::IDD)
{
m_lpszTemplateName = MAKEINTRESOURCE(View_IDD_TO_USE);
}

So at run time I can set View_IDD_TO_USE to the resource for IDD_DIALOG1 or IDD_DIALOG2. The form view then gets created with whichever of the resources I choose. I create the event handlers in the view, i.e. OnOK(). The controls in each dialog need to be the same including names so that when the view creates the handlers they can be mapped, i.e. there must be a control named ID_OK on each dialog so the view can correctly map ID_OK to OnOK().

That means no duplicated code, only two dialogs which doesn't add to much overhead. This works great for what I'm doing.

Thanks to Scott McPhillips for the direction.
QuestionVisual Studio: Resources ID based on other resources ID Pin
Pascal_334-Jan-11 22:50
Pascal_334-Jan-11 22:50 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.