Esempio n. 1
0
static void FillAllData (HWND hwnd)
{
   HWND  hwndContainer = GetDlgItem (hwnd, IDC_RELOCATE_CONTAINER);
   LPSTORAGEPARAMS  lpstorage = GetDlgProp (hwnd);
   LPCHECKEDOBJECTS lploc = GetLocations ();
   LPOBJECTLIST lx;
   int   i = 1;
   char* item;

   nLine = ContainerAddCntLine  (hwndContainer);
   ContainerFillTextCell (hwndContainer, 0, 0, CONT_COLTYPE_TITLE, CONT_ALIGN_LEFT, ResourceString ((UINT)IDS_I_OLD_LOCATIONS));
   ContainerFillTextCell (hwndContainer, 0, 1, CONT_COLTYPE_TITLE, CONT_ALIGN_LEFT, ResourceString ((UINT)IDS_I_NEW_LOCATIONS));

   lx    = lpstorage->lpLocations;
   while (lx)
   {
       nLine = ContainerAddCntLine  (hwndContainer);
       lx = lx->lpNext;
   }

   ContainerSetColumnWidth (hwndContainer, 0, 26);
   ContainerSetColumnWidth (hwndContainer, 1, 26);

   lx    = lpstorage->lpLocations;
   while (lx)
   {
       item = (char *)lx->lpObject;
       ContainerFillTextCell(
           hwndContainer,
           i,
           0,
           CONT_COLTYPE_TEXT,
           CONT_ALIGN_LEFT,
           item);

       lx = lx->lpNext;
       i++;
   }

   lploc = FreeCheckedObjects (lploc);
   FillAllComboCells          (hwnd, nLine+1);
   SelectItemInComboCell      (hwnd, nLine);
}
Esempio n. 2
0
// create command line and execute remote command
static BOOL SendCommand(HWND hwnd)
{
   //create the command for remote 
   UCHAR buf2[MAXOBJECTNAME*3];
   UCHAR buf[MAX_RMCMD_BUFSIZE];
 
   int iReplicVersion;
   LPRECONCILER  lpreconciler  = GetDlgProp(hwnd);
   LPUCHAR vnodeName = GetVirtNodeName(GetCurMdiNodeHandle ());

   // Get everything from dd_connections 
   iReplicVersion=GetReplicInstallStatus(GetCurMdiNodeHandle (),lpreconciler->DBName,
                                                                lpreconciler->DbaName);
   // Get additionnal information on current CDDS: name,error ,collision
   if (iReplicVersion == REPLIC_V11)  {
	   UCHAR tmpusername[MAXOBJECTNAME];
	   DBAGetUserName(vnodeName,tmpusername);
 
       wsprintf(buf,"reconcil %s %s %s -u%s %s",lpreconciler->DBName,
                                           lpreconciler->TarGetDbNumber,
                                           lpreconciler->CddsNo,
                                           tmpusername,
										   lpreconciler->StarTime);
       wsprintf(buf2,ResourceString(IDS_REPLIC_REC_1PARM_TITLE), lpreconciler->DBName);
   }
   else {
       wsprintf(buf,"reconcil %s::%s %s %s %s %s", vnodeName,
                                                   lpreconciler->DBName,
                                                   lpreconciler->DbaName,
                                                   lpreconciler->TarGetDbNumber,
                                                   lpreconciler->CddsNo,
                                                   lpreconciler->StarTime);
       wsprintf(buf2,ResourceString(IDS_REPLIC_REC_2PARMS_TITLE),
                  vnodeName,
                  lpreconciler->DBName);
   }

   execrmcmd(vnodeName,buf,buf2);

   return(TRUE);
}
Esempio n. 3
0
 const ResourceString Choice::GetstrChoice(void) const
 {
     // First retrieve the choice enterd in its index form.
     int i_Choice = GetChoice();
     if (i_Choice >= 0)
     {
         return Choice2Str(i_Choice, m_tkChoices);
     }
     else
     {
         return ResourceString();
     }
 }
Esempio n. 4
0
void WarningMessage  (unsigned int message_id)
{
   HWND CurrentFocus;
   char MessageString [400];
   int  nByte, resp;

   nByte = LoadString (hResource, (unsigned int)message_id, MessageString, sizeof (MessageString));

   if (nByte <= 0)
   {
       wsprintf (MessageString, "Message not defined !. id = %u ", message_id);
   }

   CurrentFocus = GetFocus ();
   resp = MessageBox (NULL, MessageString, 
                            ResourceString(IDS_TITLE_WARNING), MB_ICONEXCLAMATION | MB_OK | MB_TASKMODAL);
   SetFocus (CurrentFocus);
}
Esempio n. 5
0
int ConfirmedMessage (unsigned int message_id)
{
   HWND CurrentFocus;
   char MessageString [400];
   int  nByte, resp;

   nByte = LoadString (hResource, (unsigned int)message_id, MessageString, sizeof (MessageString));

   if (nByte <= 0)
   {
       wsprintf (MessageString, "Message not defined !. id = %u ", message_id);
   }

   CurrentFocus = GetFocus ();
   resp = MessageBox (NULL, MessageString, ResourceString(IDS_TITLE_CONFIRMATION), MB_ICONQUESTION | MB_YESNO | MB_TASKMODAL);
   SetFocus (CurrentFocus);
  
   return (resp);
}
Esempio n. 6
0
static BOOL ProhibitString_all2 (HWND hwnd)
{
   int  nSel, i;
   char szFindStr [MAXOBJECTNAME];
   HWND hwndObjectType = GetDlgItem (hwnd, IDC_LOCATE_OBJECTTYPE);
   HWND hwndFind       = GetDlgItem (hwnd, IDC_LOCATE_FIND);

   if ((nSel = ComboBox_GetCurSel (hwndObjectType)) != CB_ERR)
       i = Obj4locate() [nSel];
   else
       i = -1;

   if (i == -1)
       return TRUE;
   switch (i)
   {
       case OT_RULE       :
       case OT_INDEX      :
       case OT_INTEGRITY  :
           Edit_GetText (hwndFind, szFindStr, sizeof (szFindStr));
           if (x_strcmp (szFindStr, String_all) == 0)
           {
               char* mess;
               char  mess2 [200];
               HWND currentFocus = GetFocus();

               mess = ResourceString ((UINT)IDS_E_CANNOT_USE_THIS);
               wsprintf (mess2, mess, String_all);
               MessageBox (NULL, mess2, NULL, MB_OK| MB_TASKMODAL);
               SetFocus (currentFocus);
               return FALSE;
           }

       default:
           return TRUE;
   }
}
Esempio n. 7
0
        //! @brief Choice to string conversion.
        //! @return Resource string at the given position in the list. Empty string when an error occured.
        static const ResourceString Choice2Str(
                const int I_Choice,                             //!< Choice index to convert.
                const tk::Queue<ResourceString>& TK_Choices     //!< Choice list.
                )
        {
            // Loop over the choice list until the number of elements to skip has been reached.
            tk::Queue<ResourceString>::Iterator it =  TK_Choices.GetIterator();
            for (   int i_ElementsToSkip = I_Choice;
                    (i_ElementsToSkip >= 0) && TK_Choices.IsValid(it);
                    i_ElementsToSkip --)
            {
                if (i_ElementsToSkip == 0)
                {
                    return TK_Choices.GetAt(it);
                }
                else
                {
                    TK_Choices.MoveNext(it);
                }
            }

            // Default to an empty string.
            return ResourceString();
        }
Esempio n. 8
0
static void OnCommand (HWND hwnd, int id, HWND hwndCtl, UINT codeNotify)
{
   LPSECURITYALARMPARAMS lpsecurity = GetDlgProp (hwnd);
   HWND hwndUsers    = GetDlgItem (hwnd, IDC_SALARM_BYUSER );
   HWND hwndTables = GetDlgItem (hwnd, IDC_SALARM_ONTABLE );
   HWND hwndName   = GetDlgItem (hwnd, IDC_SALARM_NAME );        

   int idu;    
   int i, n, idt;   
   int ires;
   char szName [MAXOBJECTNAME];

   switch (id)
   {
       case IDOK:
           if (!FillStructureFromControls (hwnd, lpsecurity))
               break;
           //
           // Call the low level function to write data on disk
           //

           ires = DBAAddObject
               (GetVirtNodeName (GetCurMdiNodeHandle ()),
               OTLL_SECURITYALARM,
               (void *) lpsecurity );

           if (ires != RES_SUCCESS)
           {
               FreeAttachedPointers (lpsecurity, OTLL_SECURITYALARM);
               ErrorMessage   ((UINT)IDS_E_CREATE_SECURITY_FAILED, ires);
               break;
           }
           else
               EndDialog (hwnd, TRUE);
           
           FreeAttachedPointers (lpsecurity, OTLL_SECURITYALARM);
           break;

       case IDCANCEL:
           EndDialog (hwnd, FALSE);
           FreeAttachedPointers (lpsecurity, OTLL_SECURITYALARM);
           break;

       case IDC_SALARM_BYUSER:
           if (Edit_GetText (hwndName, szName, sizeof (szName)) != 0 &&
              CAListBox_GetSelCount (hwndUsers) > 1)   {
                idu=CAListBox_GetCurSel (hwndUsers);
                n = CAListBox_GetCount (hwndUsers);
                for (i=0; i<n; i++)
                       CAListBox_SetSel (hwndUsers, FALSE, i);
               CAListBox_SetCurSel (hwndUsers, idu);
               CAListBox_SetSel (hwndUsers, TRUE, idu);
               //"Multiple auth-id is not allowed if the security alarm has a name."
               MessageBox(hwnd,
                   ResourceString(IDS_ERR_USING_CHECKPOINT),
                   NULL, MB_OK | MB_ICONEXCLAMATION | MB_TASKMODAL);
                   EnableDisableOKButton (hwnd);
             }
           else if (CAListBox_GetSelCount (hwndUsers) > 1)
                  Edit_Enable(hwndName,FALSE);
                else
                  Edit_Enable(hwndName,TRUE);
               
           EnableDisableOKButton (hwnd);
           break;

       case IDC_SALARM_ONTABLE:
           if (codeNotify == CALBN_CHECKCHANGE) {
               idt = CAListBox_GetCurSel (hwndTables);              
                n = CAListBox_GetCount (hwndTables);                
       
                for (i=0; i<n; i++)
                  CAListBox_SetSel (hwndTables, FALSE, i);      
           
               CAListBox_SetCurSel (hwndTables, idt);              
                CAListBox_SetSel (hwndTables, TRUE, idt);
               if (bNoDisplayMessageDB == FALSE) {
                  int iret;
                  //"Only one database can be checked. Previous database, if any, was unchecked.\nDon't display this message any more?"
                  iret = MessageBox(hwnd, ResourceString(IDS_ERR_DATABASE_BE_CHECKED),
                         NULL, MB_OKCANCEL | MB_ICONEXCLAMATION | MB_TASKMODAL);
                  if (iret == IDOK)
                     bNoDisplayMessageDB=TRUE;
               }
           }
           EnableDisableOKButton (hwnd);
           break;

       case IDC_SALARM_SUCCESS:
       case IDC_SALARM_FAILURE:
       case IDC_SALARM_SUCCESSFAILURE:
       case IDC_SALARM_SELECT:
       case IDC_SALARM_DELETE:
       case IDC_SALARM_INSERT:
       case IDC_SALARM_UPDATE:
       case IDC_SALARM_CONNECT:
       case IDC_SALARM_DISCONNECT:
           EnableDisableOKButton (hwnd);
           break;

       case IDC_SALARM_USER:
           if (Button_GetCheck (hwndCtl))
           {
               CAListBox_ResetContent (hwndUsers);
               CAListBoxFillUsers     (hwndUsers);
               EnableDisableOKButton (hwnd);
           }
           break;

       case IDC_SALARM_GROUP:
           if (Button_GetCheck (hwndCtl))
           {
               CAListBox_ResetContent (hwndUsers);
               CAListBoxFillGroups    (hwndUsers);
               EnableDisableOKButton (hwnd);
           }
           break;

       case IDC_SALARM_ROLE:
           if (Button_GetCheck (hwndCtl))
           {
               CAListBox_ResetContent (hwndUsers);
               CAListBoxFillRoles     (hwndUsers);
               EnableDisableOKButton  (hwnd);
           }
           break;

       case IDC_SALARM_PUBLIC:
           if (Button_GetCheck (hwndCtl))
           {
               CAListBox_ResetContent (hwndUsers);
               EnableDisableOKButton  (hwnd);
           }
           break;

       case IDC_SALARM_DBEVENT:
           if (codeNotify == CBN_SELCHANGE)
           {
               char szItem [MAXOBJECTNAME];

               ZEROINIT (szItem);
               ComboBox_GetText (hwndCtl, szItem, sizeof (szItem));

               if (x_strcmp (szItem, szSecurityDBEvent) == 0)
               {
                   lpsecurity->bDBEvent = FALSE;
                   EnableControl (hwnd, FALSE);
               }
               else
                   EnableControl (hwnd, TRUE);
           }
           break;
   }
}
Esempio n. 9
0
static BOOL OnInitDialog (HWND hwnd, HWND hwndFocus, LPARAM lParam)
{

   LPSECURITYALARMPARAMS lpsecurity   = (LPSECURITYALARMPARAMS)lParam;
   HWND hwndUsers    = GetDlgItem (hwnd, IDC_SALARM_BYUSER );
   HWND hwndDB       = GetDlgItem (hwnd, IDC_SALARM_ONTABLE);
   HWND hwndDBE      = GetDlgItem (hwnd, IDC_SALARM_DBEVENT);
   HWND hwndCaptionDB= GetDlgItem (hwnd, IDC_SALARM_STATIC_DB);

   char szFormat [100];
   char szTitle  [180];

   if (!AllocDlgProp (hwnd, lpsecurity))
       return FALSE;

   bNoDisplayMessageDB = FALSE;
   //
   // force catolist.dll to load
   //
   CATOListDummy();

   if (lpsecurity->bInstallLevel) {
      SetWindowText (hwndCaptionDB, "On:");
      //"Create Security Alarm on Current Installation on %s"
      wsprintf (szTitle, ResourceString(IDS_F_CREATE_SECURITY),
                GetVirtNodeName ( GetCurMdiNodeHandle ()));
   }
   else {
      LoadString (hResource, (UINT)IDS_T_CREATE_SECURITY, szFormat, sizeof (szFormat));
      wsprintf (szTitle, szFormat,
                GetVirtNodeName ( GetCurMdiNodeHandle ()),
                lpsecurity->DBName);

   }


   
   SetWindowText (hwnd, szTitle);

   Edit_LimitText (GetDlgItem (hwnd, IDC_SALARM_DBEVENT_TEXT), MAXOBJECTNAME-1);
   ZEROINIT (szSecurityDBEvent);
   LoadString (hResource, (UINT)IDS_I_NODBEVENT, szSecurityDBEvent, sizeof (szSecurityDBEvent));

   //
   // Set the default to user
   //
   Button_SetCheck (GetDlgItem (hwnd, IDC_SALARM_USER), TRUE);

   //
   // Get the available users names and insert them into the CA list box 
   // 

   CAListBoxFillUsers (hwndUsers);

   //
   // Get the available DB names and insert them into the table list 
   // 
   if (lpsecurity->bInstallLevel) {
       char * pcurinst = ResourceString(IDS_CURRENT_INSTALLATION);
       CAListBox_AddString   (hwndDB,pcurinst);
       CAListBox_SelectString(hwndDB,-1,pcurinst);
       lpsecurity->iObjectType = OT_VIRTNODE;
       EnableWindow(hwndDB,FALSE);
       EnableWindow(hwndDBE,FALSE);
   }
   else  {
       CAListBoxFillDatabases (hwndDB);
       lpsecurity->iObjectType = OT_DATABASE;
   }

   if (!lpsecurity->bInstallLevel &&
       !ComboBoxFillDBevents (hwndDBE, "iidbdb"))
   {
       ComboBoxDestroyItemData (hwndDBE);
       return FALSE;
   }

   {
       int   k;
       char* buffowner;

       k = ComboBox_AddString (hwndDBE, szSecurityDBEvent);
       buffowner = ESL_AllocMem (x_strlen (szSecurityDBEvent) +1);
       x_strcpy (buffowner, szSecurityDBEvent);
       ComboBox_SetItemData (hwndDBE, k, buffowner);
       ComboBox_SelectString(hwndDBE, -1, szSecurityDBEvent);
       EnableControl (hwnd, FALSE);
   }

   PreCheckItem (hwnd);
   EnableDisableOKButton (hwnd);
   //
   // The value 9039 is defined in MAINMFC.H but is not accessible from this file:
   lpHelpStack = StackObject_PUSH (lpHelpStack, StackObject_INIT (lpsecurity->bInstallLevel? 9039: (UINT)IDD_SECURITY_ALARM2));

   richCenterDialog (hwnd);
   return TRUE;
}
Esempio n. 10
0
static BOOL FillStructureFromControls (HWND hwnd)
{
   char szGreatBuffer [MAX_RMCMD_BUFSIZE];
   char szBufferT     [MAX_RMCMD_BUFSIZE];
   char szBufferF     [MAX_RMCMD_BUFSIZE];
   char szSyscat      [22];
   char szBefore      [22];
   char szAfter       [22];
   char szCn          [10];
   char szActUser     [MAXOBJECTNAME];
   char szUserName    [MAXOBJECTNAME];
   char buftemp[200];

   HWND hwndSyscat         = GetDlgItem (hwnd, IDC_AUDITDB_SYSCAT);
   HWND hwndBefore         = GetDlgItem (hwnd, IDC_AUDITDB_BEFORE);
   HWND hwndAfter          = GetDlgItem (hwnd, IDC_AUDITDB_AFTER);
   HWND hwndCn             = GetDlgItem (hwnd, IDC_AUDITDB_CKP_NUMBER);
   HWND hwndActUser        = GetDlgItem (hwnd, IDC_AUDITDB_ACTION_USER);
   HWND hwndWait           = GetDlgItem (hwnd, IDC_AUDITDB_WAIT);
   HWND hwndInconsistent   = GetDlgItem (hwnd, IDC_AUDITDB_INCONSISTENT);
   HWND hwndTable          = GetDlgItem (hwnd, IDC_AUDITDB_TABLES);
   HWND hwndFile           = GetDlgItem (hwnd, IDC_AUDITDB_FILES);

   LPUCHAR vnodeName = GetVirtNodeName (GetCurMdiNodeHandle ());
   LPAUDITDBPARAMS     lpauditdb  = GetDlgProp (hwnd);
   LPTABLExFILE ls   = lpfile;

   ZEROINIT (szGreatBuffer);
   ZEROINIT (szBufferT);
   ZEROINIT (szBufferF);
   ZEROINIT (szSyscat);
   ZEROINIT (szBefore);
   ZEROINIT (szAfter);
   ZEROINIT (szCn);
   ZEROINIT (szActUser);

   // Verify if the length of the remote command do not exceed MAX_LINE_COMMAND.
   if (!VerifyBufferLen(hwnd))
   {
       ErrorMessage ((UINT) IDS_E_TOO_MANY_TABLES_SELECTED, RES_ERR);
       return FALSE;
   }

   if (Button_GetCheck (hwndFile))
       x_strcpy (szBufferF, " -file");

   if (Button_GetCheck (hwndTable))
   {
       char*  aTable;
       LPOBJECTLIST list = table.lpTable;

       if (list)
       {
           aTable = (LPTSTR)RemoveDisplayQuotesIfAny((LPTSTR)StringWithoutOwner(list->lpObject));
           x_strcpy (szBufferT, " -table=");
           x_strcat (szBufferT, aTable);
           list = list->lpNext;
       }
       while (list)
       {
           x_strcat (szBufferT, ",");
           aTable = (LPTSTR)RemoveDisplayQuotesIfAny((LPTSTR)StringWithoutOwner(list->lpObject));
           x_strcat (szBufferT, aTable);
           list = list->lpNext;
       }
   }

   if (Button_GetCheck (hwndFile) && ls && Modify (ls))
   {
       x_strcpy (szBufferF, " -file=");
       x_strcat (szBufferF, ls->FileName);
       ls = ls->next;

       while (ls)
       {
           x_strcat (szBufferF, ",");
           x_strcat (szBufferF, ls->FileName);
           ls = ls->next;
       }
   }

   if (Button_GetCheck (hwndSyscat))
       x_strcpy (szSyscat, "-a");
   else
       x_strcpy (szSyscat, "");

   wsprintf (szGreatBuffer,
       "auditdb %s %s %s %s",
       szSyscat,
       lpauditdb->DBName,
       szBufferT,
       szBufferF);
 
   Edit_GetText (hwndAfter,  szAfter,  sizeof (szAfter ));
   Edit_GetText (hwndBefore, szBefore, sizeof (szBefore));
   Edit_GetText (hwndCn,     szCn,     sizeof (szCn));

   ComboBox_GetText (hwndActUser, szActUser, sizeof (szActUser));

   if (x_strlen (szAfter) > 0)
   {
       x_strcat (szGreatBuffer, " -b");
       x_strcat (szGreatBuffer, szAfter);
   }

   if (x_strlen (szBefore) > 0)
   {
       x_strcat (szGreatBuffer, " -e");
       x_strcat (szGreatBuffer, szBefore);
   }

   if (Button_GetCheck (GetDlgItem (hwnd, IDC_AUDITDB_CKP)))
   {
       x_strcat (szGreatBuffer, " #c");
       if (x_strlen (szCn) > 0)
           x_strcat (szGreatBuffer, szCn);
   }

   if (x_strlen (szActUser) > 0)
   {
       x_strcat (szGreatBuffer, " -i");
       x_strcat (szGreatBuffer, szActUser);
   }

   if (Button_GetCheck (hwndWait))
       x_strcat (szGreatBuffer, " -wait");

   if (Button_GetCheck (hwndInconsistent))
       x_strcat (szGreatBuffer, " -inconsistent");
  
   ZEROINIT (szUserName);
   DBAGetUserName (vnodeName, szUserName);
   x_strcat (szGreatBuffer, " -u");
   x_strcat (szGreatBuffer, szUserName);


   wsprintf(buftemp,
       ResourceString ((UINT)IDS_T_RMCMD_AUDITDB), //"auditing database %s::%s",
       vnodeName,
       lpauditdb->DBName);
   execrmcmd(vnodeName,szGreatBuffer,buftemp);
   return TRUE;
}
Esempio n. 11
0
static void ResetWithDefaultEditCtrl (HWND hwnd)
{
	BOOL bKeepCurrentValues = FALSE;
	INFOOFFSET infoIdx = GetSelectedStructure(hwnd);
	char szNumber[20];
	HLOCAL hmem = GetProp(hwnd, SZINFODEF);
	LPSTRUCTINFO lpinfo = LocalLock(hmem);

	if (bUserChangeEdit == TRUE)
	{
		if (infoDefaults[infoIdx].fillFactors.nData != -1 &&
			SaveFillFactors.DefaultData != infoDefaults[infoIdx].fillFactors.nData )
		{
			int iret;
			// "You have changed the data pages fillfactor.\n"
			// "The new structure you have chosen has a different default value for the fillfactor.\n"
			// "Apply the default of the new structure ?"
			iret = MessageBox(GetFocus(), ResourceString(IDS_APPLY_DEFAULT_FILLFACTOR_DATA), NULL,
			                              MB_YESNO | MB_ICONQUESTION | MB_TASKMODAL);

			if (iret == IDNO)
				bKeepCurrentValues = TRUE;
			else
				bUserChangeEdit = FALSE;
		}
		else
			bKeepCurrentValues = TRUE;
	}
	else
	{
		if ( infoDefaults[infoIdx].fillFactors.nIndex != -1 &&
			 SaveFillFactors.FillFactors.nIndex != -1 &&
			 SaveFillFactors.FillFactors.nIndex != infoDefaults[infoIdx].fillFactors.nIndex)
				bKeepCurrentValues = TRUE;
		if ( infoDefaults[infoIdx].fillFactors.nLeaf != -1 &&
			 SaveFillFactors.FillFactors.nLeaf != -1 &&
			 SaveFillFactors.FillFactors.nLeaf != infoDefaults[infoIdx].fillFactors.nLeaf)
				bKeepCurrentValues = TRUE;

	}
	bInitEdit = TRUE;

	if (bKeepCurrentValues)
	{
		my_itoa(SaveFillFactors.FillFactors.nData, szNumber, 10);
		Edit_SetText (GetDlgItem(hwnd, IDC_DATA), szNumber);
		my_itoa(SaveFillFactors.FillFactors.nIndex, szNumber, 10);
		Edit_SetText (GetDlgItem(hwnd, IDC_INDEX), szNumber);
		my_itoa(SaveFillFactors.FillFactors.nLeaf, szNumber, 10);
		Edit_SetText (GetDlgItem(hwnd, IDC_LEAF), szNumber);
	}
	else
	{
		if (lpinfo[infoIdx].fillFactors.nData != -1)
		{
			my_itoa(lpinfo[infoIdx].fillFactors.nData, szNumber, 10);
			Edit_SetText (GetDlgItem(hwnd, IDC_DATA), szNumber);
		}
		if (lpinfo[infoIdx].fillFactors.nIndex != -1)
		{
			my_itoa(lpinfo[infoIdx].fillFactors.nIndex, szNumber, 10);
			Edit_SetText (GetDlgItem(hwnd, IDC_INDEX), szNumber);
		}
		if (lpinfo[infoIdx].fillFactors.nLeaf != -1)
		{
			my_itoa(lpinfo[infoIdx].fillFactors.nLeaf, szNumber, 10);
			Edit_SetText (GetDlgItem(hwnd, IDC_LEAF), szNumber);
		}
	}
	bInitEdit = FALSE;
	LimitNumericEditControls(hwnd);

	LocalUnlock(hmem);
}
Esempio n. 12
0
static BOOL OnInitDialog(HWND hwnd, HWND hwndFocus, LPARAM lParam)
{
	HWND hwndTempDoc;
	HLOCAL hmem = LocalAlloc(LHND, sizeof(infoDefaults));
	LPSTRUCTINFO lpinfo = hmem ? LocalLock(hmem) : NULL;

	if (!lpinfo)
	{
		if (hmem)
			LocalFree(hmem);
		EndDialog(hwnd, -1);
		return TRUE;
	}

	// Since we modify infoDefaults, make a copy of it for each instance
	// of the dialog
	oldIngresVer = GetOIVers();
	SetProp(hwnd, SZINFODEF, hmem);
	_fmemcpy(lpinfo, infoDefaults, sizeof(infoDefaults));
	if (oldIngresVer >= OIVERS_30)
	{
		int i =0;
		for (i=0; i<4; i++)
		{
			lpinfo[i].nRowWidth = MAX_ROW_WIDTH_R3;
		}
	}
	LocalUnlock(hmem);

	hwndTempDoc = GetWindow(hwndMDIClient, GW_CHILD);
	if (hwndTempDoc)
	{
		if (GetOIVers()>=OIVERS_26) {
			BOOL bResult = SQLGetPageTypesPerTableTypes(GetVirtNodeName(GetCurMdiNodeHandle ()), pagetypespertabletypes);
			if (!bResult) {
				MessageWithHistoryButton(GetFocus(), ResourceString(IDS_E_CONNECTION_FAILED));
				EndDialog(hwnd, -1);
				return TRUE;
			}
			if (PAGE_TYPE_V1 != 1 || PAGE_TYPE_V2 != 2 || PAGE_TYPE_V3 != 3 || PAGE_TYPE_V4 !=4 || PAGE_TYPE_V6 != 6 || PAGE_TYPE_V7 != 7) {
				myerror(ERR_INGRESPAGES); /* the parsing of dm34 trace output (in parse.cpp) assumes V1 == 1 V2 == 2 etc... */
				EndDialog(hwnd, -1);
				return TRUE;
			}
			Button_SetCheck (GetDlgItem (hwnd, IDC_TYPE_TABLE), TRUE);
		}
		if (GetOIVers()>=OIVERS_30)
			RetrieveTupLen4PageSize();
}
	else
	{
		oldIngresVer = SetOIVers(OIVERS_90); // Simulate the current Ingres version 9.0
		Button_SetCheck (GetDlgItem (hwnd, IDC_TYPE_TABLE), TRUE);
		pagetypespertabletypes [0]  = PAGE_TYPE_V1;
		pagetypespertabletypes [1]  = PAGE_TYPE_V3;
		pagetypespertabletypes [2]  = PAGE_TYPE_V3;
		pagetypespertabletypes [3]  = PAGE_TYPE_V3;
		pagetypespertabletypes [4]  = PAGE_TYPE_V3;
		pagetypespertabletypes [5]  = PAGE_TYPE_V3;
		pagetypespertabletypes [6]  = PAGE_TYPE_V1;
		pagetypespertabletypes [7]  = PAGE_TYPE_V4;
		pagetypespertabletypes [8]  = PAGE_TYPE_V4;
		pagetypespertabletypes [9]  = PAGE_TYPE_V4;
		pagetypespertabletypes [10] = PAGE_TYPE_V4;
		pagetypespertabletypes [11] = PAGE_TYPE_V4;
		if (bContinueShowMessage)
		{
			if (MSGContinueBox (ResourceString(IDS_W_CALCULATION_WITH_DEFAULT)))
				bContinueShowMessage = FALSE;
		}
	}

	// Force the catospin.dll to load
	SpinGetVersion();

	if (!OccupyStructureControl(hwnd) || !OccupyPageSizeControl(hwnd))
	{
		EndDialog(hwnd, -1);
		return TRUE;
	}
	if (GetOIVers() >= OIVERS_20)
		lpHelpStack = StackObject_PUSH (lpHelpStack, StackObject_INIT ((UINT)IDD_OIV2_SPACECALC));
	else
		lpHelpStack = StackObject_PUSH (lpHelpStack, StackObject_INIT ((UINT)IDD_SPACECALC));

	SubclassAllNumericEditControls(hwnd, EC_SUBCLASS);

	InitialiseSpinControls(hwnd);
	InitialiseEditControls(hwnd);
	UpdateControls(hwnd,TRUE);
	DoCalculation(hwnd);
	richCenterDialog(hwnd);
	return TRUE;
}