Example #1
0
static LPCHECKEDOBJECTS GetLocations ()
{
   int  hdl, ires;
   BOOL bwsystem;
   char buf [MAXOBJECTNAME];
   char buffilter [MAXOBJECTNAME];
   LPCHECKEDOBJECTS obj, list = NULL;  
   ZEROINIT (buf);
   ZEROINIT (buffilter);

   hdl      = GetCurMdiNodeHandle ();
   // Force to TRUE so as II_DATABASE is picked up.
   bwsystem = TRUE;
       
   ires     = DOMGetFirstObject (hdl, OT_LOCATION, 0, NULL, bwsystem, NULL, buf, NULL, NULL);
   while (ires == RES_SUCCESS)
   {
      BOOL bOK;
      if (DOMLocationUsageAccepted(hdl,buf,LOCATIONDATABASE,&bOK)==
          RES_SUCCESS && bOK) {
          obj = ESL_AllocMem (sizeof (CHECKEDOBJECTS));
          if (obj)
          {
             x_strcpy (obj->dbname, buf);
             obj->pnext = NULL;
             list = AddCheckedObject (list, obj);
          }
      }
      ires  = DOMGetNextObject (buf, buffilter, NULL);
   }
   return list;
}
Example #2
0
static BOOL OccupyLocationControl (HWND hwnd)
/*
	Function:
		Fills the location drop down box with the location names.

	Parameters:
		hwnd	- Handle to the dialog window.

	Returns:
		TRUE if successful.
*/
{
	HWND hwndCtl = GetDlgItem (hwnd, IDC_LOCATIONS);
	int hNode;
	int err;
	BOOL bSystem;
	char szObject[MAXOBJECTNAME];
   char szFilter[MAXOBJECTNAME];
   LPUCHAR aparents[MAXPLEVEL];
	LPTABLEPARAMS lptbl = GetDlgProp(hwnd);

	ZEROINIT(aparents);
	ZEROINIT(szObject);
	ZEROINIT(szFilter);

	aparents[0] = lptbl->DBName;

	hNode = GetCurMdiNodeHandle();
	bSystem = GetSystemFlag ();

	err = DOMGetFirstObject(hNode,
									OT_LOCATION,
									0,
									aparents,
									TRUE,
									NULL,
									szObject,
									NULL,
									NULL);

	while (err == RES_SUCCESS)
	{
      BOOL bOK;
      if (DOMLocationUsageAccepted(hNode,szObject,LOCATIONDATABASE,&bOK)==
          RES_SUCCESS && bOK) {
		   CAListBox_AddString(hwndCtl, szObject);
      }
		err = DOMGetNextObject (szObject, szFilter, NULL);
	}

	return TRUE;
}
Example #3
0
void CuEditableListCtrlDuplicateDbSelectLocation::InitSortComboBox()
{
	int TypeLocation,i,iIndex,err;
	char szObject[MAXOBJECTNAME];
	char szFilter[MAXOBJECTNAME];
	BOOL bOnlyOneLocName;

	CComboBox* pCombo = COMBO_GetComboBox();
	pCombo->ResetContent();
	err = DOMGetFirstObject(GetCurMdiNodeHandle(),
							OT_LOCATION,
							0,
							NULL,
							TRUE,
							NULL,
							(LPUCHAR)szObject,
							NULL,
							NULL);
	while (err == RES_SUCCESS)
	{
		BOOL bOK;
		for (i = 0, TypeLocation = 0,bOnlyOneLocName = TRUE;i <= LOCATIONDUMP;i++,TypeLocation=i)
		{
			if (DOMLocationUsageAccepted(GetCurMdiNodeHandle(),(LPUCHAR)szObject,TypeLocation,&bOK) == RES_SUCCESS && bOK)
			{
				switch (TypeLocation)
				{
					case LOCATIONDATABASE:
					case LOCATIONWORK:
					{
						if ( bOnlyOneLocName )
						{
							iIndex = pCombo->AddString (szObject);
							bOnlyOneLocName = FALSE;
						}
					}
						break;
				}
			}
		}
		err = DOMGetNextObject ((LPUCHAR)szObject,(LPUCHAR)szFilter, NULL);
	}
	if (err != RES_SUCCESS && err != RES_ENDOFDATA)
	{
		//"Error while getting Location list."
		CString csMsg = VDBA_MfcResourceString (IDS_E_DUPLICATEDB_FILL_COMBO_LOCATION);
		MessageWithHistoryButton(m_hWnd,csMsg);
	}

}