Meldung: Nicht unterstützter Vorgang!
-
Hallo,
na toll, es ist fast Wochenende und mein Programm funktioniert auf einmal nicht mehr.
Bekomme an dieser Stelle ne Fehlermeldung, wenn ich in meiner SDI-Anwendung nen Dialog aufrufe:[cpp]WND CDataExchange::PrepareCtrl(int nIDC)
{
ASSERT(nIDC != 0);
ASSERT(nIDC != -1); // not allowed
HWND hWndCtrl;
COleControlSite* pSite = NULL;
m_pDlgWnd->GetDlgItem(nIDC, &hWndCtrl);
if (hWndCtrl == NULL)
{
// Could be a windowless OCX
pSite = m_pDlgWnd->GetOleControlSite(nIDC);
if (pSite == NULL)
{
TRACE(traceAppMsg, 0, "Error: no data exchange control with ID 0x%04X.\n", nIDC);
[e]rarr[/e] ASSERT(FALSE);
AfxThrowNotSupportedException();
}
}
m_idLastControl = nIDC;
m_bEditLastControl = FALSE; // not an edit item by defaultreturn hWndCtrl;
}[/cpp]und wenn ich den Fehler Ignorieren lasse, erhalte ich ne MB "Es wurde Versucht, einen nicht unterstützten Vorgang aufzurufen!" und mein Dialog erscheint nicht.
In der Ausgabe steht "Error: no data exchange control with ID 0x03E8."
Kann mir da jemand weiterhelfen?
Ciao Mellsche
-
pSite == NULL !!
Prüfe mal
pSite = m_pDlgWnd->GetOleControlSite(nIDC);
-
Lach mich nicht aus, aber was soll ich da genau prüfen?

-
m_pDlgWnd->GetOleControlSite(nIDC)
was für einen wert hat nIDC, was passiert in der Methode GetOleControlSite ??
-
nIDC = 1000 also 0x3E8 und m_pCtrlCont = 0
-
Stepe mal in die Methode m_pDlgWnd->GetOleControlSite(nIDC)
rein, und sieh nach warum NULL zurückgegeben wird !
-
if (m_pCtrlCont != NULL ) { return( m_pCtrlCont->FindItem(idControl) ); } else { return( NULL ); }da m_pCtrlCont = NULL → return NULL
-
wo wird pCtrlCont etwas zugewiesen ?
-
WND CDataExchange::PrepareCtrl(int nIDC) { ASSERT(nIDC != 0); ASSERT(nIDC != -1); // not allowed HWND hWndCtrl; COleControlSite* pSite = NULL; m_pDlgWnd->GetDlgItem(nIDC, &hWndCtrl); if (hWndCtrl == NULL) { // Could be a windowless OCX pSite = m_pDlgWnd->GetOleControlSite(nIDC); if (pSite == NULL) { TRACE(traceAppMsg, 0, "Error: no data exchange control with ID 0x%04X.\n", nIDC); ASSERT(FALSE); AfxThrowNotSupportedException(); } } m_idLastControl = nIDC; m_bEditLastControl = FALSE; // not an edit item by default return hWndCtrlMeinst du hier:
COleControlSite* pSite = NULL;
-
Nein, ich habe mich vorhin vertippt, ich meinte
m_pCtrlContDein Code sagt ja, dass wenn m_pCtrlCont Null is, gib NULL zurück.
Damit das ding aber nicht null is, muss vorher etwas zugewiesen werden.if (m_pCtrlCont != NULL ) { return( m_pCtrlCont->FindItem(idControl) ); } else { return( NULL ); }
-
JUUUUUHHHHUUUUU! Ich habs!
Hab im Editor die Bezeichnung einer ID geändert, im Code aber nicht, deshalb hat er sie nicht gefunden!Danke für deine Hilfe!!!
