当前位置:首页 > 技术问答集
firefox

在线等,急!

 所属目录:Java   |   类型:技术问答   |   时间:2007-05-21
 问题:

void   dia::onhelp()    
  {  
  //   todo:   add   your   control   notification   handler   code   here  
  shellexecute(getparent()->getsafehwnd(),   _t("open"),"\\help.htm",   null,   null,   sw_show);  
  }//bn_clicked事件为什么打不开help.htm  
  而menu中的command事件却行  
  求大虾指点应该怎样才能在bn_clicked事件为什么打开help.htm  
  ///  
  //  
  //  
  在一个类中如何调用另外一个类中的成员变量的属性和方法  
  解决了可以另外开贴给分

· 网友精彩回答:

发表者:atomictry

1.   保证你的help.chm和你的应用程序放在一个目录下,如果不是,请修改sprintf(szfilename,   "%s\\help.htm",   szfiledir);    
   
  void   callhelpdoc()  
  {  
  char   szfiledir[max_path],   szfilename[max_path];  
  memset(szfiledir,   0,   sizeof(szfiledir));  
  memset(szfilename,   0,   sizeof(szfilename));  
  getmodulefilename(null,   szfiledir,   sizeof(szfiledir));  
  char   *p   =   strrchr(szfiledir,   \\);  
  if   (p)  
  *p   =   0;  
  sprintf(szfilename,   "%s\\help.htm",   szfiledir);    
  shellexecute(null,   _t("open"),   szfilename,   null,   null,   sw_shownormal);  
  }  
   
  2.   由于不清楚你的结构,我只能假设你的那个activemoviecontrol是放在你的主对话框程序,而tab中是另外一个对话框。  
  //   maindlg.cpp  
  void   cmaindlg::run()    
  {  
            activemoviecontrol.run();  
  }  
   
  //   在childdlg.cpp中包含maindlg.h  
  void   cchilddlg::callactivemovie()  
  {  
          cmaindlg   *pdlg   =   (cmaindlg   *)afxgetmainwnd();  
        pdlg->run();  
  }

.
© 2006-2008 All Rights Reserved