本文整理汇总了C++中MemBlock::GetPointer方法的典型用法代码示例。如果您正苦于以下问题:C++ MemBlock::GetPointer方法的具体用法?C++ MemBlock::GetPointer怎么用?C++ MemBlock::GetPointer使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MemBlock
的用法示例。
在下文中一共展示了MemBlock::GetPointer方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: GetWindowLong
BOOL QSQL_DEF::UpdateOptions /* ---- Update Options ------------------ */
( HWND hDlg // window handle
)
/* Updates options. */
{ MemBlock mb; // memblock class
OBJECTID qsqlObj; // qsql object
Qsql *qsql; // qsql core info
qsqlObj = (OBJECTID) GetWindowLong(hDlg, DWL_USER); // gets object id
qsql = (Qsql *) mb.GetPointer(qsqlObj, QSQLCORE);
/* ---- updates row count ---- */
qsql->rowCount = GetDlgItemInt(hDlg, IDE_ROWCOUNT, NULL, FALSE);
/* ---- updates column separator ---- */
if (IsDlgButtonChecked(hDlg, IDD_TAB))
qsql->colSprtr = TAB;
else
if (IsDlgButtonChecked(hDlg, IDD_COMMA))
qsql->colSprtr = COMMA;
/* else Fall Through */
/* ---- updates oem ---- */
qsql->isOEM = IsDlgButtonChecked(hDlg, IDD_OEM);
return TRUE;
} // UpdateOptions
示例2: while
void QCNC_FNC::CloseCursor /* ---- Close Cursor -------------------- */
( OBJECTID qcncObj // qcnc object
)
/* Closes the associated SQL cursors. */
{ MemBlock mb; // memblock class
OBJECTID qsqlObj; // qsql object
QsqlCore *qsqlCore; // qsql core info
QSQL_FNC fnc; // qsql_fnc class
long objIdx; // object index
qeSTATUS errorCode; // error code
objIdx = AOBJ_GETFIRSTKEY;
while((qsqlObj = AObjGetNextObject(OTYPE_QSQL, &objIdx)) != 0)
{ qsqlCore = (QsqlCore *) mb.GetPointer(qsqlObj, QSQLCORE);
if (qsqlCore && qsqlCore->connectObj == qcncObj && qsqlCore->isCursor)
{ errorCode = (*qe_EndSQL)(qsqlCore->cursor);
if (fnc.RecordError(qsqlCore, errorCode))
AEvtPostSignalAtMark(qsqlObj, QSQLIFERROR);
else
{ qsqlCore->isCursor = FALSE;
fnc.Dispose(qsqlCore);
} // else
} // if
} // while
} // CloseCursor
示例3: SetWindowLong
BOOL QSQL_DEF::InitOptionsDialog/* ---- Init Options -------------------- */
( HWND hDlg, // window handle
OBJECTID qsqlObj // qsql object
)
/* Inits options. */
{ MemBlock mb; // memblock class
Qsql *qsql; // qsql core info
AUtlCenterDialog(hDlg, 0);
SetWindowLong(hDlg, DWL_USER, (DWORD) qsqlObj); // saves object id
qsql = (Qsql *) mb.GetPointer(qsqlObj, QSQLCORE);
/* ---- inits row count ---- */
SetDlgItemInt(hDlg, IDE_ROWCOUNT, (WORD) qsql->rowCount, FALSE);
/* ---- inits row separator ---- */
switch (qsql->colSprtr)
{ case TAB:
CheckRadioButton(hDlg, IDD_TAB, IDD_COMMA, IDD_TAB);
break;
case COMMA:
CheckRadioButton(hDlg, IDD_TAB, IDD_COMMA, IDD_COMMA);
break;
/* default: Fall Through */
} // switch
/* ---- inits oem ---- */
CheckDlgButton(hDlg, IDD_OEM, qsql->isOEM);
return TRUE;
} // InitOptions
示例4: AFuncReportResult
/*------------------------------------------------------------------------*\
| FUNCTION : OQcncGetErrorFunc |
| DESCRIPTION : Returns the most recent ODBC error code, and the |
| associated error message. |
| INPUT 1 : ODBC Connection: ODBC CONNECTION -- The ODBC Connection |
| object to get the error from. |
| OUTPUT 1(OPT): Error Number: NUMBER -- The returned ODBC error code. |
| OUTPUT 2(OPT): Error Message: TEXT -- The returned ODBC error message. |
| FLOW 1 : Fetched. |
| FLOW 2 : No Error. |
| Novell, Inc., November 1, 1993. mw |
\*------------------------------------------------------------------------*/
void ALMAPI OQcncGetErrorFunc
( pAEvtInfo, // event pointer
pAObjMessage theSystem // system pointer
)
{ MemBlock mb; // memblock class
OBJECTID qcncObj; // qcnc object (I: 1)
QcncCore *qcncCore; // qcnc core info
OBJECTID errorNmbrObj; // number object [O: 1]
OBJECTID errorMsgObj; // text object [O: 2]
if (!sqlLib.IsLoadLib()) // no library
if (!sqlLib.LoadLib())
{ AFuncReportResult(theSystem, 0, "ODBC Connection\r\n"
"Get Error: Couldn't find the Q+E ODBC DLL.");
return;
} // if
/* ---- FUNCTION INPUT 1 ---- */
qcncObj = AFuncGetTypedParameter(1, OTYPE_QCNC);
if (!(qcncCore = (QcncCore *) mb.GetPointer(qcncObj, QCNCCORE)))
{ AFuncReportResult(theSystem, 0, "ODBC Connection\r\n"
"Get Error: Couldn't get the ODBC Connection input parameter.");
return;
} // if
if (qcncCore->errorCode == qeSUCCESS)
{ /* ---- FLOW 2 (No Error) ---- */
AFuncReportResult(theSystem, 2, "");
return;
} // if
/* ---- FUNCTION OUTPUT 1 ---- */
if (!(errorNmbrObj = AObjCreate(OTYPE_NUMBER)))
{ AFuncReportResult(theSystem, 0, "ODBC Connection\r\n"
"Get Error: Couldn't create the Error Code output parameter.");
return;
} // if
ONmbrSetInteger(errorNmbrObj, qcncCore->errorCode, TRUE);
AFuncSetParameter(1, errorNmbrObj);
/* ---- FUNCTION OUTPUT 2 ---- */
if (!(errorMsgObj = AObjCreate(OTYPE_TEXT)))
{ AFuncReportResult(theSystem, 0, "ODBC Connection\r\n"
"Get Error: Couldn't create the Error Message output parameter.");
return;
} // if
OTextSetValueFromBuffer(errorMsgObj, qcncCore->errorMsg);
AFuncSetParameter(2, errorMsgObj);
/* ---- FLOW 1 (Fetched) ---- */
AFuncReportResult(theSystem, 1, "");
} // OQcncGetErrorFunc
示例5: AFuncGetTypedParameter
/*------------------------------------------------------------------------*\
| FUNCTION : OQcncStatusFunc |
| DESCRIPTION : Returns whether the ODBC Connection object is currently |
| connected to the DBMS. |
| INPUT 1 : ODBC Connection: ODBC CONNECTION -- The ODBC Connection |
| object to get the status from. |
| OUTPUT : None. |
| FLOW 1 : Connected. |
| FLOW 2 : Not Connected. |
| Novell, Inc., November 1, 1993. mw |
\*------------------------------------------------------------------------*/
void ALMAPI OQcncStatusFunc
( pAEvtInfo, // event pointer
pAObjMessage theSystem // system pointer
)
{ MemBlock mb; // memblock class
OBJECTID qcncObj; // qcnc object (I: 1)
QcncCore *qcncCore; // qcnc core info
/* ---- FUNCTION INPUT 1 ---- */
qcncObj = AFuncGetTypedParameter(1, OTYPE_QCNC);
if (!(qcncCore = (QcncCore *) mb.GetPointer(qcncObj, QCNCCORE)))
{ AFuncReportResult(theSystem, 0, "ODBC Connection\r\n"
"Status: Couldn't get the ODBC Connection input parameter.");
return;
} // if
/* ---- FLOW 1 (Connected), OR FLOW 2 (Not Connected) ---- */
AFuncReportResult(theSystem, 1 + (qcncCore->isConnected == FALSE), "");
} // OQcncStatusFunc