ITPub博客

首页 > IT基础架构 > 网络安全 > InstallShield自定义对话框浅谈(四) (转)

InstallShield自定义对话框浅谈(四) (转)

原创 网络安全 作者:themoney 时间:2007-10-04 10:13:45 0 删除 编辑
InstallShield自定义对话框浅谈(四) (转)[@more@] 

/*------------------------------------------------------------------------*/

/*  */

/*  Function:  ChecksqlServerDSNInputValid  */

/*  */

/*  Descrip:  check the input data is valid.     */

/*  do not need to check the pwd if empty  */

/*  Misc:  */

/*  */

/*------------------------------------------------------------------------*/

  function CheckSQLServerDSNInputValid(hwndDlg, bAllowNotSet)

  STRING szdbUserName;

  STRING szSQLDB;

  STRING szSQLAddr;

  STRING szSQLDSN;

  begin

 

  if(bAllowNotSet) then

  _WinSubEnableControl(hwndDlg, SD_PBUT_CONTINUE, 1);

  return 1;

  endif;

 

  if((CtrlGetState(DSN_SQLSERVER_DLG, IDC_RADIO_DSN_USER) = BUTTON_UNCHECKED) &&

  (CtrlGetState(DSN_SQLSERVER_DLG, IDC_RADIO_DSN_SYSTEM) = BUTTON_UNCHECKED)) then

  _WinSubEnableControl(hwndDlg, SD_PBUT_CONTINUE, 0);

  return 0;

  endif;

 XML:namespace prefix = o ns = "urn:schemas-microsoft-com:Office:office" />

  CtrlGetText(DSN_SQLSERVER_DLG, IDC_EDIT_SQLSERVER_USER_NAME, szDBUserName);

  if(StrLength(szDBUserName) = 0) then

  _WinSubEnableControl(hwndDlg, SD_PBUT_CONTINUE, 0);

  return 0;

  endif;

  CtrlGetText(DSN_SQLSERVER_DLG, IDC_EDIT_SQLSERVER_DSN, szSQLDSN);

  if(StrLength(szSQLDSN) = 0) then

  _WinSubEnableControl(hwndDlg, SD_PBUT_CONTINUE, 0);

  return 0;

   else

  if(!SQLValidDSN(szSQLDSN)) then

  MessageBox("输入了无效的数据源名称!", INFORMATION);

  _WinSubFocuSCOntrol(hwndDlg, IDC_EDIT_SQLSERVER_DSN);

  return 0;

  endif;

  endif;

  CtrlGetText(DSN_SQLSERVER_DLG, IDC_EDIT_SQLSERVER_DB, szSQLDB);

   if(StrLength(szSQLDB) = 0) then

  _WinSubEnableControl(hwndDlg, SD_PBUT_CONTINUE, 0);

  return 0;

  endif;

  CtrlGetText(DSN_SQLSERVER_DLG, IDC_EDIT_DB_ADDR, szSQLAddr);

  if(StrLength(szSQLAddr) = 0) then

  _WinSubEnableControl(hwndDlg, SD_PBUT_CONTINUE, 0);

  return 0;

  endif;

 

  _WinSubEnableControl(hwndDlg, SD_PBUT_CONTINUE, 1);

  return 1;

  end;

 

 

 

#endif // __KDCIS_RUL_

 

 


来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/10794571/viewspace-974718/,如需转载,请注明出处,否则将追究法律责任。

请登录后发表评论 登录
全部评论
  • 博文量
    119
  • 访问量
    338478