Click here to Skip to main content
15,896,552 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
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 
AnswerRe: Visual Studio: Resources ID based on other resources ID Pin
Richard MacCutchan5-Jan-11 0:38
mveRichard MacCutchan5-Jan-11 0:38 
GeneralRe: Visual Studio: Resources ID based on other resources ID Pin
Pascal_335-Jan-11 2:28
Pascal_335-Jan-11 2:28 
GeneralRe: Visual Studio: Resources ID based on other resources ID Pin
Richard MacCutchan5-Jan-11 7:11
mveRichard MacCutchan5-Jan-11 7:11 
QuestionRe: Visual Studio: Resources ID based on other resources ID Pin
CPallini5-Jan-11 1:10
mveCPallini5-Jan-11 1:10 
AnswerRe: Visual Studio: Resources ID based on other resources ID Pin
Pascal_335-Jan-11 2:20
Pascal_335-Jan-11 2:20 
GeneralRe: Visual Studio: Resources ID based on other resources ID [modified] Pin
CPallini5-Jan-11 2:22
mveCPallini5-Jan-11 2:22 
GeneralRe: Visual Studio: Resources ID based on other resources ID Pin
Pascal_335-Jan-11 2:44
Pascal_335-Jan-11 2:44 
GeneralRe: Visual Studio: Resources ID based on other resources ID Pin
CPallini5-Jan-11 3:10
mveCPallini5-Jan-11 3:10 
GeneralRe: Visual Studio: Resources ID based on other resources ID Pin
Pascal_335-Jan-11 5:29
Pascal_335-Jan-11 5:29 
GeneralRe: Visual Studio: Resources ID based on other resources ID Pin
Roger Broomfield5-Jan-11 12:46
Roger Broomfield5-Jan-11 12:46 
GeneralRe: Visual Studio: Resources ID based on other resources ID Pin
Pascal_335-Jan-11 22:02
Pascal_335-Jan-11 22:02 
GeneralRe: Visual Studio: Resources ID based on other resources ID Pin
CPallini6-Jan-11 4:09
mveCPallini6-Jan-11 4:09 
GeneralRe: Visual Studio: Resources ID based on other resources ID Pin
Pascal_336-Jan-11 5:49
Pascal_336-Jan-11 5:49 
GeneralRe: Visual Studio: Resources ID based on other resources ID Pin
CPallini6-Jan-11 6:00
mveCPallini6-Jan-11 6:00 
QuestionProblem: ISAPI Extension Add custom header Pin
theoneneo244-Jan-11 22:47
theoneneo244-Jan-11 22:47 
QuestionProblem with WaitForSingleObject Pin
Amol Jaikar4-Jan-11 21:09
Amol Jaikar4-Jan-11 21:09 

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.