Programming implementation based on MFC Vega Program Mfcworkvega:
1. Create a single-document MFC program to include zsvegaview. cpp and zsvegaview. h.
2. Change the base class of mfcworkvegaview from cview to zsvegaview.
Required functions
Const char * cmfcworkvegaview: getadfname ()
{
Cmfcworkvegadoc * Doc = (cmfcworkvegadoc *) getdocument ();
Const char * adfname = doc-> getpathname ();
// If the filename was not given open "vegawin. ADF ".
If (strlen (adfname) = 0)
Return "Ocean. ADF ";
Else
Return adfname;
}
Void cmfcworkvegaview: postdefine ()
{
Vgwindow * win = vggetwin (0 );
Vgwinsize (Win, 0, sizeofwinx, 0, sizeofwiny );
}
Void cmfcworkvegaview: oninitialupdate ()
{
Cvegaview: oninitialupdate ();
Runvega (); // run Vega
}
Void cmfcworkvegaview: onsize (uint ntype, int CX, int CY)
{
Cvegaview: onsize (ntype, CX, CY );
Sizeofwinx = Cx;
Sizeofwiny = Cy;
// Todd add your message handler code here
}