C/Visual C - Usando MDI a lo SDI

 
Vista:

Usando MDI a lo SDI

Publicado por Nelek (816 intervenciones) el 11/07/2006 10:48:58
He encontrado un comando que me puede ayudar a cerrar los documentos que tenga abiertos (en caso de que haya alguno)

CDocTemplate::CloseAllDocuments
virtual void CloseAllDocuments( BOOL bEndSession );

Pero tengo un problema, cuando llamo a esta funcion recibo un fallo de compilacion que dice:

error C2352: 'CDocTemplate::CloseAllDocuments' : Llamada ilicita a una funcion miembro

Yo lo estoy usando de la siguiente manera:

BOOL CFPSDoc::OnNewDocument()
{
if (!CDocument::OnNewDocument())
return FALSE;

p_nICount = 0; //Miguel: There are no Inputs
p_posI = NULL; //Miguel: No position, list empty
p_clIList.RemoveAll(); //Miguel: Deleting all the contents of the Inputs' list

p_nOCount = 0; //Miguel: There are no Outputs
p_posO = NULL; //Miguel: No position, list empty
p_clOList.RemoveAll(); //Miguel: Deleting all the contents of the Outputs' list

p_nRCount = 0; //Miguel: There are no Reglers
p_posR = NULL; //Miguel: No position, list empty
p_clRList.RemoveAll(); //Miguel: Deleting all the contents of the Reglers' list

CloseAllDocuments (false);

return TRUE;
}

Alguien me puede decir que estoy haciendo mal?
Valora esta pregunta
Me gusta: Está pregunta es útil y esta claraNo me gusta: Está pregunta no esta clara o no es útil
0
Responder

Yo mismo me constesto

Publicado por Nelek (816 intervenciones) el 11/07/2006 11:57:06
1) Estoy intentando llamar a una funcion virtual como si no fuera virtual.

2) Al iniciar el Programa esto tambien se ejecuta, asi que si intento cerrar todos los documentos cuando no tengo ninguno abierto todavia... Ostion que se arrea y access violation que me endosa

En fin, a ver si luego condenso todas las pruebas que voy a ir haciendo a lo largo de hoy podemos sacar algo en claro.
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar