Home > Software engineering >  MFC call consulting word startup - disconnect problem
MFC call consulting word startup - disconnect problem

Time:11-14

Because not ripe, the use of MFC call word table, set "to generate the word" "keep out" two buttons, among them, the generated word button to connect the word, keep out of the disconnect, also responsible for data memory release,
Two broken code below
Void CWord_Test4Dlg: : OnButton1 ()
{
//TODO: Add your the control notification handler code here
ODocs. ReleaseDispatch ();//
OWordApp. M_bAutoRelease=true;
OWordApp. SetVisible (TRUE);//make visible
OWordApp. Activate ();//activate
ODocs=oWordApp. GetDocuments ();//get the documents object

BeginWaitCursor ();
ODocs=oWordApp. GetDocuments ();
COleVariant vOpt (DISP_E_PARAMNOTFOUND VT_ERROR);
ODoc=oDocs. Add (vOpt vOpt, vOpt, vOpt);//add a new document
Pagesetup=oDoc. GetPageSetup ();
Pagesetup. SetOrientation (0);//longitudinal
.
}

Void CWord_Test4Dlg: : OnButton2 ()
{
//TODO: Add your the control notification handler code here
.
//release, disconnect
The font. ReleaseDispatch ();
Cells. ReleaseDispatch ();
//wordShading ReleaseDispatch ();
Table. ReleaseDispatch ();
Tables. ReleaseDispatch ();
Range. ReleaseDispatch ();
//wordSelection ReleaseDispatch ();
ODoc. RecheckSmartTags ();
ODocs. ReleaseDispatch ();
OWordApp. ReleaseDispatch ();
}
The question now is, if the generated time, save a no fault; Have been generated without fault, but click save, the more points generated will prompt "base class application has stopped working,"
Me, did I start missing, or shut down, which want to change the words, the code could not probe into, also hope more directions!!!!! thank you

CodePudding user response:

Which master to give directions, thank the
  • Related