static LPTABLExFILE RemoveElement (LPTABLExFILE lpFile, char* aTable) { LPTABLExFILE tm, prec; LPTABLExFILE ls = lpFile; prec = ls; while (ls) { if (x_strcmp (ls->TableName, aTable) == 0) { tm = ls; if (ls == lpFile) { ls = ls->next; ESL_FreeMem (tm); tm = NULL; return (ls); } else { prec->next = ls->next; ESL_FreeMem (tm); tm = NULL; return (lpFile); } } prec = ls; ls = ls->next; } return lpFile; }
static void FillAllComboCells(HWND hwnd, int maxLine) { HWND hwndContainer = GetDlgItem (hwnd, IDC_RELOCATE_CONTAINER); LPSTORAGEPARAMS lpstorage = GetDlgProp (hwnd); LPCHECKEDOBJECTS ls, lploc = GetLocations (); int i, maxlen = 0; char* item; char* buffer; char* first; ls = lploc; while (ls) { item = (char*) ls->dbname; maxlen = maxlen + x_strlen (item) +1; ls = ls->pnext; } if (maxlen > 0) { buffer = ESL_AllocMem (maxlen +2); first = buffer; ls = lploc; x_strcpy (buffer, (char*) ls->dbname); ls = ls->pnext; while (ls) { item = (char*) ls->dbname; buffer = buffer + x_strlen (buffer) +1; x_strcpy (buffer, item); ls = ls->pnext; } buffer = buffer + x_strlen (buffer) +1; x_strcpy (buffer, ""); // // Fill all combos // for (i=1; i<maxLine; i++) { ContainerFillComboCell( hwndContainer, i, 1, 0, CONT_ALIGN_LEFT, first); } ESL_FreeMem (first); first = NULL; } lploc = FreeCheckedObjects (lploc); }
static LPTABLExFILE FreeTableAndFile (LPTABLExFILE lpFile) { LPTABLExFILE ls = lpFile, tmp; while (ls) { tmp = ls; ls = ls->next; ESL_FreeMem (tmp); } return (ls); }
void CxDlgObjectComment::OnDestroy() { CDialog::OnDestroy(); ObjectColumn_Done(); FreeObjectList(m_ListColumn); m_ListColumn = NULL; if (m_tcObjComment) ESL_FreeMem(m_tcObjComment); m_ImageList.DeleteImageList(); PopHelpId(); }
void CxDlgObjectComment::ObjectColumn_Done () { LPOBJECTLIST ls = m_ListColumn; LPCOMMENTCOLUMN lpCommentCol; while (ls) { lpCommentCol = (LPCOMMENTCOLUMN)ls->lpObject; if (lpCommentCol->lpszComment) ESL_FreeMem (lpCommentCol->lpszComment); ls = (LPOBJECTLIST)ls->lpNext; } }
// // Frees objects associated to the container // VOID TerminateContainer(HWND hwndCnt) { LPRECORDCORE hLine; LPFIELDINFO lpFld; GENCNTR_COLUMN column; LPGENCNTRDATA lpGenCntrData; lpGenCntrData = GetGenericCntrData(hwndCnt); if (!lpGenCntrData) return; // Free draw proc instance FreeProcInstance( lpGenCntrData->lpfnDrawProc); // Free the memory blocks allocated for combo boxes lpFld = CntFldHeadGet(hwndCnt); while (lpFld) { hLine = CntRecHeadGet(hwndCnt); while (hLine) { CntFldDataGet(hLine, lpFld, 0, (LPVOID)&column); if (column.type == CONT_COLTYPE_COMBO) ESL_FreeMem(column.ucol.sCombo.pItems); hLine = CntNextRec(hLine); } lpFld = CntNextFld(lpFld); } // We would free here the gdi objects created // for the container in InitContainer(), // such as fonts, bitmaps, icons, cursors // free the data associated with the container ESL_FreeMem(lpGenCntrData->pLines); ESL_FreeMem(lpGenCntrData); RemoveGenericCntrData(hwndCnt); }
// // Creates a line and returns a line number // creates the default cells, all alpha with a dummy text // int ContainerAddCntLine(HWND hwndCnt) { LPGENCNTRDATA lpGenCntrData; int columns; LPGENCNTR_RECORD lpCr; // Dynamic alloc LPRECORDCORE lpRC; int unit; int cpt; LPGENCNTR_COLUMN lpCol; // advances in lpCr lpGenCntrData = GetGenericCntrData(hwndCnt); if (!lpGenCntrData) return -1; if (!lpGenCntrData->lines) { (lpGenCntrData->lines)++; UnlockGenericCntrData(hwndCnt); return 0; // special value ---> caption line } columns = lpGenCntrData->columns; unit = offsetof(GENCNTR_RECORD, cont_col2); lpCr = (LPGENCNTR_RECORD)ESL_AllocMem( unit * columns ); if (!lpCr) { UnlockGenericCntrData(hwndCnt); return -1; } CntDeferPaint( hwndCnt ); // Disable container paint lpRC = CntNewRecCore(unit * columns); // Don't be wrong in giving the size! // Fill the reccore with default values for (cpt = 0, lpCol = (LPGENCNTR_COLUMN)lpCr; cpt < columns; cpt++, lpCol++) { // Note pointer arithmetic on lpCol! lpCol->dummy[0] = 'A'; lpCol->dummy[1] = '\0'; lpCol->type = CONT_COLTYPE_EMPTY; lpCol->align = CONT_ALIGN_LEFT; lpCol->precision = 0; lpCol->ucol.s[0] = '\0'; // Store data for future calls to QueryLpFld() lpCol->colnum = cpt; // Column number lpCol->hLine = lpRC; // LPRECORDCORE identifying the line } // Load data into the record. CntRecDataSet(lpRC, (LPVOID)lpCr); // Add this record to the list. CntAddRecTail(hwndCnt, lpRC); CntSelectRec(hwndCnt,lpRC); // ??? // MASQUED BECAUSE OF SIDE EFFECT ON SIBLINGS EDITS: //CntFocusMove(hwndCnt, CFM_LASTFLD); // Free the allocated buffer ESL_FreeMem(lpCr); // Increment the vertical scroll range CntRangeInc(hwndCnt); CntEndDeferPaint( hwndCnt, FALSE); // Enables container paint // make the recordcore array bigger, and add the new recordcore // using old number of lines if (lpGenCntrData->pLines == NULL) lpGenCntrData->pLines = ESL_AllocMem(sizeof(LPRECORDCORE)); else lpGenCntrData->pLines = ESL_ReAllocMem(lpGenCntrData->pLines, sizeof(LPRECORDCORE) * lpGenCntrData->lines, 0); if (lpGenCntrData->pLines == NULL) { UnlockGenericCntrData(hwndCnt); return -1; // ERROR! } lpGenCntrData->pLines[lpGenCntrData->lines - 1] = lpRC; // update the number of lines (lpGenCntrData->lines)++; UnlockGenericCntrData(hwndCnt); // return the line number return (lpGenCntrData->lines - 1); }
LONG CuDlgDomPropTableColumns::OnUpdateData (WPARAM wParam, LPARAM lParam) { // cast received parameters int nNodeHandle = (int)wParam; LPIPMUPDATEPARAMS pUps = (LPIPMUPDATEPARAMS)lParam; ASSERT (nNodeHandle != -1); ASSERT (pUps); // ignore selected actions on filters switch (pUps->nIpmHint) { case 0: //case FILTER_DOM_SYSTEMOBJECTS: //case FILTER_DOM_BASEOWNER: //case FILTER_DOM_OTHEROWNER: break; case FILTER_DOM_BKREFRESH_DETAIL: if (m_Data.m_refreshParams.MustRefresh(pUps->pSFilter->bOnLoad, pUps->pSFilter->refreshtime)) break; // need to update else return 0; // no need to update break; case FILTER_SETTING_CHANGE: VDBA_OnGeneralSettingChange(&m_cListColumns); return 0L; default: return 0L; // nothing to change on the display } // Get info on the object TABLEPARAMS tableparams; memset (&tableparams, 0, sizeof (tableparams)); LPTREERECORD lpRecord = (LPTREERECORD)pUps->pStruct; ASSERT (lpRecord); ResetDisplay(); x_strcpy ((char *)tableparams.DBName, (const char *)lpRecord->extra); x_strcpy ((char *)tableparams.objectname, RemoveDisplayQuotesIfAny((LPCTSTR)StringWithoutOwner(lpRecord->objName))); x_strcpy ((char *)tableparams.szSchema, (const char *)lpRecord->ownerName); tableparams.detailSubset = TABLE_SUBSET_COLUMNSONLY; // minimize query duration int dummySesHndl; int iResult = GetDetailInfo ((LPUCHAR)GetVirtNodeName(nNodeHandle), OT_TABLE, &tableparams, FALSE, &dummySesHndl); if (iResult != RES_SUCCESS) { // Table may not exist if propagate too fast if (iResult != RES_ENDOFDATA) ASSERT (FALSE); // Reset m_Data CuDomPropDataTableColumns tempData; tempData.m_refreshParams = m_Data.m_refreshParams; m_Data = tempData; // Create error item and that's it! /* "<Data Unavailable>" */ CuTblColumn tblColumn1(VDBA_MfcResourceString (IDS_DATA_UNAVAILABLE)); m_Data.m_uaColumns.Add(tblColumn1); // Refresh display RefreshDisplay(); return 0L; } // Update refresh info m_Data.m_refreshParams.UpdateRefreshParams(); TCHAR *lpObjComment = NULL; int iret = RES_SUCCESS; LPOBJECTLIST ls ,lpColTemp,lpObjCol = NULL; LPCOMMENTCOLUMN lpCommentCol; ls = tableparams.lpColumns; while (ls) { lpColTemp = AddListObjectTail(&lpObjCol, sizeof(COMMENTCOLUMN)); if (!lpColTemp) { // Need to free previously allocated objects. FreeObjectList(lpObjCol); lpObjCol = NULL; break; } LPCOLUMNPARAMS lstbl=(LPCOLUMNPARAMS)ls->lpObject; lpCommentCol = (LPCOMMENTCOLUMN)lpColTemp->lpObject; lstrcpy((LPTSTR)lpCommentCol->szColumnName,(LPCTSTR)(LPUCHAR)lstbl->szColumn); lpCommentCol->lpszComment = NULL; ls=(LPOBJECTLIST)ls->lpNext; } if (lpObjCol) iret = VDBAGetCommentInfo ( (LPTSTR)(LPUCHAR)GetVirtNodeName(nNodeHandle), (LPTSTR)tableparams.DBName, (LPTSTR)tableparams.objectname, (LPTSTR)tableparams.szSchema, &lpObjComment, lpObjCol); else ASSERT (FALSE); // update member variables, for display/load/save purpose // list of columns m_Data.m_uaColumns.RemoveAll(); ls = tableparams.lpColumns; ASSERT (ls); // No columns is unacceptable while (ls) { LPCOLUMNPARAMS lpCol = (LPCOLUMNPARAMS)ls->lpObject; ASSERT (lpCol); // Column name CString csName = lpCol->szColumn; // Format "column type" CString csType = ""; if (lstrcmpi(lpCol->tchszInternalDataType, lpCol->tchszDataType) != 0) { ASSERT (lpCol->tchszInternalDataType[0]); csType = lpCol->tchszInternalDataType; // UDTs if (lstrcmpi(lpCol->tchszInternalDataType,VDBA_MfcResourceString(IDS_OBJECT_KEY)) == 0 || lstrcmpi(lpCol->tchszInternalDataType,VDBA_MfcResourceString(IDS_TABLE_KEY) ) == 0) { if (lpCol->bSystemMaintained) csType += VDBA_MfcResourceString(IDS_SYSTEM_MAINTAINED); else csType += VDBA_MfcResourceString(IDS_NO_SYSTEM_MAINTAINED); } } else { LPUCHAR lpType; lpType = GetColTypeStr(lpCol); if (lpType) { csType = lpType; ESL_FreeMem(lpType); } else { // Unknown type: put type name "as is" - length will not be displayed csType = lpCol->tchszDataType; } } // Format "default specification" CString csDefSpec = ""; if (lpCol->lpszDefSpec) csDefSpec = lpCol->lpszDefSpec; // Format "Comment" CString csTblComment = ""; LPOBJECTLIST LsObj = lpObjCol; LPCOMMENTCOLUMN lpCommentCol; while (LsObj) { lpCommentCol = (LPCOMMENTCOLUMN)LsObj->lpObject; if (strcmp((LPTSTR)lpCommentCol->szColumnName,(LPTSTR)lpCol->szColumn) == 0) { if (iret!=RES_SUCCESS && !lpCommentCol->lpszComment) csTblComment.LoadString(IDS_NOT_AVAILABLE); else { if (lpCommentCol->lpszComment) csTblComment = lpCommentCol->lpszComment; } } LsObj = (LPOBJECTLIST)LsObj->lpNext; } // item on the stack CuTblColumn tblColumn(csName, // LPCTSTR name, csType, // LPCTSTR type, ??? Code complexe lpCol->nKeySequence,// int primKeyRank, lpCol->bNullable, // BOOL bNullable, lpCol->bDefault, // BOOL bWithDefault, csDefSpec, // LPCTSTR defSpec csTblComment ); // LPCTSTR comment on column CuMultFlag *pRefCol = m_Data.m_uaColumns.Find(&tblColumn); ASSERT (!pRefCol); m_Data.m_uaColumns.Add(tblColumn); // Loop on next column ls = (LPOBJECTLIST)ls->lpNext; } // liberate detail structure FreeAttachedPointers (&tableparams, OT_TABLE); // liberate column comment ls = lpObjCol; while (ls) { lpCommentCol = (LPCOMMENTCOLUMN)ls->lpObject; if (lpCommentCol->lpszComment) ESL_FreeMem (lpCommentCol->lpszComment); ls = (LPOBJECTLIST)ls->lpNext; } FreeObjectList(lpObjCol); if (lpObjComment) ESL_FreeMem (lpObjComment); // Refresh display RefreshDisplay(); return 0L; }
static BOOL FillStructureFromControls (HWND hwnd, LPSECURITYALARMPARAMS lpsecurity) { char buf [MAXOBJECTNAME]; // char buffowner [MAXOBJECTNAME]; // char bufftable [MAXOBJECTNAME]; char szDBE [MAXOBJECTNAME]; char szName [MAXOBJECTNAME]; LPCHECKEDOBJECTS obj; LPCHECKEDOBJECTS list = NULL; int i, max_database_number, checked; HWND hwndDB = GetDlgItem (hwnd, IDC_SALARM_ONTABLE); HWND hwndUsers = GetDlgItem (hwnd, IDC_SALARM_BYUSER ); HWND hwndSuccess = GetDlgItem (hwnd, IDC_SALARM_SUCCESS); HWND hwndFailure = GetDlgItem (hwnd, IDC_SALARM_FAILURE); HWND hwndSelect = GetDlgItem (hwnd, IDC_SALARM_SELECT); HWND hwndDelete = GetDlgItem (hwnd, IDC_SALARM_DELETE); HWND hwndInsert = GetDlgItem (hwnd, IDC_SALARM_INSERT); HWND hwndUpdate = GetDlgItem (hwnd, IDC_SALARM_UPDATE); HWND hwndConnect = GetDlgItem (hwnd, IDC_SALARM_CONNECT); HWND hwndDisconnect = GetDlgItem (hwnd, IDC_SALARM_DISCONNECT); HWND hwndDBE = GetDlgItem (hwnd, IDC_SALARM_DBEVENT); HWND hwndDBEText = GetDlgItem (hwnd, IDC_SALARM_DBEVENT_TEXT); HWND hwndName = GetDlgItem (hwnd, IDC_SALARM_NAME); x_strcpy (lpsecurity->DBName, "iidbdb"); ZEROINIT (szName); Edit_GetText (hwndName, szName, sizeof (szName)); x_strcpy (lpsecurity->ObjectName, szName); lpsecurity->bsuccfail [SECALARMSUCCESS] = Button_GetCheck (hwndSuccess); lpsecurity->bsuccfail [SECALARMFAILURE] = Button_GetCheck (hwndFailure); // // Get selection from // toggle buttons (Select, Delete, Insert, Update) // lpsecurity->baccesstype [SECALARMSEL] = Button_GetCheck (hwndSelect); lpsecurity->baccesstype [SECALARMDEL] = Button_GetCheck (hwndDelete); lpsecurity->baccesstype [SECALARMINS] = Button_GetCheck (hwndInsert); lpsecurity->baccesstype [SECALARMUPD] = Button_GetCheck (hwndUpdate); lpsecurity->baccesstype [SECALARMCONNECT] = Button_GetCheck (hwndConnect ); lpsecurity->baccesstype [SECALARMDISCONN] = Button_GetCheck (hwndDisconnect); // // Get the names of users that have been checked and // insert into the list // if (Button_GetCheck (GetDlgItem (hwnd, IDC_SALARM_USER))) lpsecurity->iAuthIdType = OT_USER; else if (Button_GetCheck (GetDlgItem (hwnd, IDC_SALARM_GROUP))) lpsecurity->iAuthIdType = OT_GROUP; else if (Button_GetCheck (GetDlgItem (hwnd, IDC_SALARM_ROLE))) lpsecurity->iAuthIdType = OT_ROLE; else if (Button_GetCheck (GetDlgItem (hwnd, IDC_SALARM_PUBLIC))) lpsecurity->iAuthIdType = OT_PUBLIC; else lpsecurity->iAuthIdType = OT_USER; max_database_number = CAListBox_GetCount (hwndUsers); if (Button_GetCheck (GetDlgItem (hwnd, IDC_SALARM_PUBLIC))) { obj = ESL_AllocMem (sizeof (CHECKEDOBJECTS)); if (!obj) { FreeAttachedPointers (lpsecurity, OTLL_SECURITYALARM); ErrorMessage ((UINT)IDS_E_CANNOT_ALLOCATE_MEMORY, RES_ERR); return FALSE; } else { x_strcpy (obj->dbname, lppublicsysstring()); obj->bchecked = TRUE; list = AddCheckedObject (list, obj); } } for (i = 0; i < max_database_number; i++) { checked = CAListBox_GetSel (hwndUsers, i); if (checked == 1) { CAListBox_GetText (hwndUsers, i, buf); obj = ESL_AllocMem (sizeof (CHECKEDOBJECTS)); if (!obj) { FreeAttachedPointers (lpsecurity, OTLL_SECURITYALARM); ErrorMessage ((UINT)IDS_E_CANNOT_ALLOCATE_MEMORY, RES_ERR); return FALSE; } else { if (x_strcmp (buf, lppublicdispstring()) == 0) x_strcpy (obj->dbname, lppublicsysstring()); else x_strcpy (obj->dbname, QuoteIfNeeded(buf)); obj->bchecked = TRUE; list = AddCheckedObject (list, obj); } } } lpsecurity->lpfirstUser = list; // // Get the names of Database that have been checked and // insert into the list // max_database_number = CAListBox_GetCount (hwndDB); list = NULL; for (i=0; i<max_database_number; i++) { checked = CAListBox_GetSel (hwndDB, i); if (checked) { CAListBox_GetText (hwndDB, i, buf); obj = ESL_AllocMem (sizeof (CHECKEDOBJECTS)); if (!obj) { FreeAttachedPointers (lpsecurity, OTLL_SECURITYALARM); ErrorMessage ((UINT)IDS_E_CANNOT_ALLOCATE_MEMORY, RES_ERR); return FALSE; } else { x_strcpy (obj->dbname, buf); obj->bchecked = TRUE; list = AddCheckedObject (list, obj); } } } lpsecurity->lpfirstTable = list; ComboBox_GetText (hwndDBE, szDBE, sizeof (szDBE)); if ((x_strlen (szDBE) > 0 ) && (x_strcmp (szDBE, szSecurityDBEvent) != 0)) { char szOwner [MAXOBJECTNAME]; char szAll [MAXOBJECTNAME]; int len, nSel; nSel = ComboBox_GetCurSel (hwndDBE); x_strcpy (szOwner, (char *) ComboBox_GetItemData (hwndDBE, nSel)); StringWithOwner (szDBE, szOwner, szAll); x_strcpy (lpsecurity->DBEvent, szAll); len = Edit_GetTextLength (hwndDBEText); if (len > 0) { lpsecurity->lpDBEventText = ESL_AllocMem ((len*sizeof(TCHAR)) + sizeof(TCHAR)); if (lpsecurity->lpDBEventText) { Edit_GetText (hwndDBEText, lpsecurity->lpDBEventText, len+1); // Emb 26/06/97: +1 was missing --> lost character if (EscapedSimpleQuote(&lpsecurity->lpDBEventText) == RES_ERR) { FreeAttachedPointers (lpsecurity, OTLL_SECURITYALARM); ErrorMessage ((UINT)IDS_E_CANNOT_ALLOCATE_MEMORY, RES_ERR); return FALSE; } } else { FreeAttachedPointers (lpsecurity, OTLL_SECURITYALARM); ErrorMessage ((UINT)IDS_E_CANNOT_ALLOCATE_MEMORY, RES_ERR); return FALSE; } } lpsecurity->bDBEvent = TRUE; } else if (lpsecurity->lpDBEventText) { ESL_FreeMem (lpsecurity->lpDBEventText); lpsecurity->lpDBEventText = NULL; } return TRUE; }
LONG CuDlgDomPropView::OnUpdateData (WPARAM wParam, LPARAM lParam) { // cast received parameters int nNodeHandle = (int)wParam; LPIPMUPDATEPARAMS pUps = (LPIPMUPDATEPARAMS)lParam; ASSERT (nNodeHandle != -1); ASSERT (pUps); // ignore selected actions on filters switch (pUps->nIpmHint) { case 0: //case FILTER_DOM_SYSTEMOBJECTS: //case FILTER_DOM_BASEOWNER: //case FILTER_DOM_OTHEROWNER: break; case FILTER_DOM_BKREFRESH_DETAIL: if (m_Data.m_refreshParams.MustRefresh(pUps->pSFilter->bOnLoad, pUps->pSFilter->refreshtime)) break; // need to update else return 0; // no need to update break; case FILTER_SETTING_CHANGE: VDBA_OnGeneralSettingChange(&m_clistCtrl); return 0L; default: return 0L; // nothing to change on the display } // Get info on the object VIEWPARAMS ViewParams; memset (&ViewParams, 0, sizeof (ViewParams)); LPTREERECORD lpRecord = (LPTREERECORD)pUps->pStruct; ASSERT (lpRecord); ResetDisplay(); // // Get Detail Info // x_strcpy ((char *)ViewParams.objectname, RemoveDisplayQuotesIfAny((LPCTSTR)StringWithoutOwner(lpRecord->objName))); x_strcpy ((char *)ViewParams.szSchema, (const char *)lpRecord->ownerName); x_strcpy ((char *)ViewParams.DBName, (const char *)lpRecord->extra); int dummySesHndl; int iResult = GetDetailInfo ((LPUCHAR)GetVirtNodeName(nNodeHandle), OT_VIEW, &ViewParams, FALSE, &dummySesHndl); if (iResult != RES_SUCCESS) { ASSERT (FALSE); // Reset m_Data CuDomPropDataView tempData; tempData.m_refreshParams = m_Data.m_refreshParams; m_Data = tempData; // Refresh display RefreshDisplay(); return 0L; } // Update refresh info m_Data.m_refreshParams.UpdateRefreshParams(); // update member variables, for display/load/save purpose m_Data.m_csText = ViewParams.lpViewText; // liberate detail structure FreeAttachedPointers (&ViewParams, OT_VIEW); // // Get list of view components // m_Data.m_acsViewComponents.RemoveAll(); m_Data.m_acsSchema.RemoveAll(); m_Data.m_awCompType.RemoveAll(); int iret; LPUCHAR aparentsTemp[MAXPLEVEL]; UCHAR buf[MAXOBJECTNAME]; UCHAR bufOwner[MAXOBJECTNAME]; UCHAR bufComplim[MAXOBJECTNAME]; memset (&bufComplim, '\0', sizeof(bufComplim)); memset (&bufOwner, '\0', sizeof(bufOwner)); // prepare parenthood with schema where relevant aparentsTemp[0] = lpRecord->extra; // DBName UCHAR bufParent1[MAXOBJECTNAME]; aparentsTemp[1] = bufParent1; x_strcpy((char *)buf, (const char *)lpRecord->objName); StringWithOwner(buf, lpRecord->ownerName, aparentsTemp[1]); // schema.name aparentsTemp[2] = NULL; iret = DOMGetFirstObject(nNodeHandle, OT_VIEWTABLE, 2, // level, aparentsTemp, // Temp mandatory! pUps->pSFilter->bWithSystem, // bwithsystem NULL, // owner buf, bufOwner, bufComplim); if (iret != RES_SUCCESS && iret != RES_ENDOFDATA) { // Erroneous case! CString csUnavail; csUnavail.LoadString(IDS_TM_ERR_ERR);// = "< Data Unavailable >"; m_Data.m_acsViewComponents.Add(csUnavail); m_Data.m_acsSchema.Add(_T("")); m_Data.m_awCompType.Add(OT_VIEWTABLE); // unresolved view component } else { while (iret == RES_SUCCESS) { m_Data.m_acsViewComponents.Add((LPCTSTR)buf); m_Data.m_acsSchema.Add((LPCTSTR)bufOwner); // Solve type on the fly int viewCompType; UCHAR resBuf[MAXOBJECTNAME]; UCHAR resBuf2[MAXOBJECTNAME]; UCHAR resBuf3[MAXOBJECTNAME]; LPUCHAR aparentsSolve[MAXPLEVEL]; aparentsSolve[0] = lpRecord->extra; // DBName aparentsSolve[1] = aparentsSolve[2] = NULL; int res = DOMGetObjectLimitedInfo(nNodeHandle, buf, bufOwner, OT_VIEWTABLE, 1, // level aparentsSolve, // parentstrings, TRUE, &viewCompType, resBuf, resBuf2, resBuf3); if (res != RES_SUCCESS) viewCompType = OT_VIEWTABLE; m_Data.m_awCompType.Add(viewCompType); // OT_TABLE or OT_VIEW, or OT_VIEWTABLE if error iret = DOMGetNextObject(buf, bufOwner, bufComplim); } } if (m_Data.m_acsViewComponents.GetUpperBound() == -1) { CString csNoViewComp; csNoViewComp.LoadString(IDS_VIEW_COMPONENTS);// = "< No View Components>"; m_Data.m_acsViewComponents.Add(csNoViewComp); m_Data.m_acsSchema.Add(_T("")); m_Data.m_awCompType.Add(OT_VIEWTABLE); // unresolved view component } // Get comment TCHAR *lpObjComment = NULL; LPOBJECTLIST lpObjCol = NULL; iret = VDBAGetCommentInfo ( (LPTSTR)(LPUCHAR)GetVirtNodeName(nNodeHandle), (LPTSTR)ViewParams.DBName, (LPTSTR)ViewParams.objectname, (LPTSTR)ViewParams.szSchema, &lpObjComment, lpObjCol); if (iret!=RES_SUCCESS) { CString csMsg; csMsg.LoadString(IDS_NOT_AVAILABLE); m_ctrlEditComment.SetWindowText(csMsg); m_Data.m_csComment = csMsg; } else if (lpObjComment) { m_ctrlEditComment.SetWindowText(lpObjComment); m_Data.m_csComment = lpObjComment; ESL_FreeMem(lpObjComment); } else { m_ctrlEditComment.SetWindowText(_T("")); m_Data.m_csComment.Empty(); } // // Refresh display // RefreshDisplay(); return 0L; }