Click here to Skip to main content
15,887,836 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: Check if an document is already open Pin
Richard MacCutchan4-Oct-11 21:41
mveRichard MacCutchan4-Oct-11 21:41 
AnswerRe: Check if an document is already open Pin
Software_Developer4-Oct-11 23:20
Software_Developer4-Oct-11 23:20 
GeneralRe: Check if an document is already open Pin
_Flaviu4-Oct-11 23:35
_Flaviu4-Oct-11 23:35 
AnswerRe: Check if an document is already open Pin
App_4-Oct-11 23:32
App_4-Oct-11 23:32 
GeneralRe: Check if an document is already open Pin
_Flaviu4-Oct-11 23:40
_Flaviu4-Oct-11 23:40 
GeneralRe: Check if an document is already open Pin
Snorri Kristjansson4-Oct-11 23:56
professionalSnorri Kristjansson4-Oct-11 23:56 
AnswerRe: Check if an document is already open Pin
Snorri Kristjansson5-Oct-11 0:02
professionalSnorri Kristjansson5-Oct-11 0:02 
GeneralRe: Check if an document is already open Pin
_Flaviu9-Oct-11 6:52
_Flaviu9-Oct-11 6:52 
I made in follow way :
C++
POSITION posTemplate = theApp.GetFirstDocTemplatePosition();
while(posTemplate)
{
    CDocTemplate* pDocTemplate = theApp.GetNextDocTemplate(posTemplate);
    POSITION posDoc = pDocTemplate->GetFirstDocPosition();
    while(posDoc)
    {
        CDocument* pDoc = pDocTemplate->GetNextDoc(posDoc);
        if(pDoc->IsKindOf(RUNTIME_CLASS(CMy2Doc)))
        {
            POSITION posView = pDoc->GetFirstViewPosition();
            if(posView)
            {
                CView* pView = pDoc->GetNextView(posView);
                pView->GetParentFrame()->BringWindowToTop();
            }
            return;
        }
    }
}

POSITION pos = theApp.GetFirstDocTemplatePosition();
CMultiDocTemplate* pDocTemplate = (CMultiDocTemplate*)theApp.GetNextDocTemplate(pos);
if(pos)
{
    pDocTemplate = (CMultiDocTemplate*)theApp.GetNextDocTemplate(pos);
    pDocTemplate = (CMultiDocTemplate*)theApp.GetNextDocTemplate(pos);
    if(pDocTemplate)pDocTemplate->OpenDocumentFile(NULL);
}

QuestionWindow or form clarification -nomenclature Pin
jkirkerx4-Oct-11 13:59
professionaljkirkerx4-Oct-11 13:59 
AnswerRe: Window or form clarification -nomenclature Pin
enhzflep4-Oct-11 18:56
enhzflep4-Oct-11 18:56 
GeneralRe: Window or form clarification -nomenclature Pin
jkirkerx5-Oct-11 6:21
professionaljkirkerx5-Oct-11 6:21 
AnswerRe: Window or form clarification -nomenclature Pin
ThatsAlok4-Oct-11 20:59
ThatsAlok4-Oct-11 20:59 
GeneralRe: Window or form clarification -nomenclature Pin
jkirkerx5-Oct-11 6:15
professionaljkirkerx5-Oct-11 6:15 
QuestionEntering ? into edit box Pin
Vaclav_4-Oct-11 12:28
Vaclav_4-Oct-11 12:28 
AnswerRe: Entering ? into edit box Pin
Richard Andrew x644-Oct-11 14:46
professionalRichard Andrew x644-Oct-11 14:46 
GeneralRe: Entering ? into edit box Pin
Vaclav_4-Oct-11 15:47
Vaclav_4-Oct-11 15:47 
GeneralRe: Entering ? into edit box Pin
Richard Andrew x644-Oct-11 15:50
professionalRichard Andrew x644-Oct-11 15:50 
GeneralRe: Entering ? into edit box SOLVED Pin
Vaclav_4-Oct-11 16:37
Vaclav_4-Oct-11 16:37 
GeneralRe: Entering ? into edit box SOLVED Pin
Richard Andrew x644-Oct-11 16:38
professionalRichard Andrew x644-Oct-11 16:38 
GeneralRe: Entering ? into edit box Pin
Chuck O'Toole4-Oct-11 16:15
Chuck O'Toole4-Oct-11 16:15 
Questionhow to move button when the dialog is resized? Pin
antonio3434-Oct-11 7:29
antonio3434-Oct-11 7:29 
AnswerRe: how to move button when the dialog is resized? Pin
Maximilien4-Oct-11 8:02
Maximilien4-Oct-11 8:02 
GeneralRe: how to move button when the dialog is resized? Pin
antonio3434-Oct-11 8:17
antonio3434-Oct-11 8:17 
GeneralRe: how to move button when the dialog is resized? Pin
Maximilien4-Oct-11 8:22
Maximilien4-Oct-11 8:22 
GeneralRe: how to move button when the dialog is resized? Pin
antonio3434-Oct-11 8:45
antonio3434-Oct-11 8:45 

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.