Zum Inhalt springen
View in the app

A better way to browse. Learn more.

Fachinformatiker.de

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Form anzeigen

Empfohlene Antworten

Veröffentlicht

Hallo,

ich habe per Einfügen->neues Formular meinem MFC-Projekt (MDI) ein neues Formular hinzugefügt.

Wie kann ich nun ein solches Formular anzeigen lassen? Ich habe die Methode


void CMainFrame::OnS()

{

	CWinApp* pApp = AfxGetApp();	

			(CCryptoApp*)pApp;


	CDocManager *pDocMgr = pApp->m_pDocManager;  

	POSITION TmplPos = pApp->GetFirstDocTemplatePosition();


	CDocTemplate *pTmpl = pDocMgr->GetNextDocTemplate(TmplPos);



	CDocument *pDoc = pTmpl->CreateNewDocument();

}

in der dies erfolgen soll.

Aber mir wird kein Formular angezeigt :(

Wer kann mir weiterhelfen?

Grüße,

Technician

@Guybrush

wenn ich UpdateAllViews aufrufe - passiert nix.

ich hab jetzt gerade rausgefunden, dass folgendes funktioniert




CWinApp* pApp = AfxGetApp();	

(CCryptoApp*)pApp;



CDocManager *pDocMgr = pApp->m_pDocManager; 


   POSITION pos=pApp->GetFirstDocTemplatePosition();

   CDocTemplate* pTemplate=pDocMgr->GetNextDocTemplate(pos);

   pTemplate->OpenDocumentFile(NULL);



also praktisch genauso vorgehen wie beim Öffnen eines Dokuments - nur, dass als Pfad NULL übergeben wird.

Ist das eine saubere Vorgehensweise (ich denke, nicht...)?!

Gruß,

Technician

Originally posted by Technician

Ist das eine saubere Vorgehensweise (ich denke, nicht...)?!

In der MSDN steht zu OpenDocumentFile folgendes:

Opens the file whose pathname is specified by lpzsPathName. If

lpszPathName is NULL, a new file, containing a document of the type associated with

this template, is created.

Also ich denke schon das, dass irgendwie so gedacht ist und man das ruhig so

machen kann.

Gruß

Guybrush

Originally posted by Guybrush Threepwood

In der MSDN steht zu OpenDocumentFile folgendes:

Also ich denke schon das, dass irgendwie so gedacht ist und man das ruhig so

machen kann.

Gruß

Guybrush

na dann ;)

Danke!

Archiv

Dieses Thema wurde archiviert und kann nicht mehr beantwortet werden.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.