本文整理汇总了C++中CConnect::getAsObjRef方法的典型用法代码示例。如果您正苦于以下问题:C++ CConnect::getAsObjRef方法的具体用法?C++ CConnect::getAsObjRef怎么用?C++ CConnect::getAsObjRef使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CConnect
的用法示例。
在下文中一共展示了CConnect::getAsObjRef方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: MAP_AS_ERRORS
extern "C" CEE_status
odbcas_ASSvc_GetObjRefHdl_(
/* In */ const CEE_handle_def *ph_
, /* In */ CEE_tag_def tag_
, /* In */ const CONNECTION_CONTEXT_def *inContext
, /* In */ const USER_DESC_def *userDesc
, /* In */ IDL_long srvrType
, /* In */ IDL_short retryCount
, /* Out */ odbcas_ASSvc_GetObjRefHdl_exc_ *exception_
, /* Out */ char *srvrObjRef
, /* Out */ DIALOGUE_ID_def *dialogueId
, /* Out */ char *dataSource
, /* Out */ USER_SID_def *userSid
, /* Out */ VERSION_LIST_def *versionList
, /* Out */ IDL_long *isoMapping
, /* Out */ IDL_long *srvrNodeId
, /* Out */ IDL_long *srvrProcessId
, /* Out */ IDL_long_long *timestamp
)
{
CEE_status retcode;
bool sts;
IDL_long wlength,rlength;
IDL_char* wbuffer, *rbuffer;
IDL_char* curptr;
IDL_long msg_total_length = 0;
IDL_long exceptionLength = 0;
IDL_long datasourceLength = 0;
IDL_long srvrObjRefLength = 0;
IDL_long userSidLength = 0;
IDL_long clusternameLength = 0;
VERSION_def version[4];
VERSION_def* versionPtr = &version[0];
char srvrHostName[100] = {0};
IDL_long srvrHostNameLength = 0;
char srvrProcessName[100] = {0};
IDL_long srvrProcessNameLength = 0;
char srvrIpAddress[100] = {0};
IDL_long srvrIpAddressLength = 0;
IDL_long srvrPort = 0;
SRVR_CALL_CONTEXT *srvrCallContext = (SRVR_CALL_CONTEXT *)tag_;
CConnect *pConnection = (CConnect *)srvrCallContext->sqlHandle;
pConnection->m_asTCPIPSystem->odbcAPI = AS_API_GETOBJREF;
pConnection->m_asTCPIPSystem->dialogueId = srvrCallContext->dialogueId;
pConnection->m_asTCPIPSystem->dwTimeout = srvrCallContext->u.connectParams.loginTimeout;
//
// do marshaling of input parameters
//
retcode = odbcas_ASSvc_GetObjRefHdl_param_pst_(
pConnection->m_asTCPIPSystem
, wbuffer
, wlength
, inContext
, userDesc
, srvrType
, retryCount);
if (retcode != CEE_SUCCESS)
return retcode;
sts = OpenIO (pConnection->m_asTCPIPSystem,pConnection->getAsObjRef());
if (sts == false)
return MAP_AS_ERRORS((long)pConnection->m_asTCPIPSystem);
sts = DoIO (pConnection->m_asTCPIPSystem, wbuffer, wlength, rbuffer, rlength,pConnection);
if (sts == false)
return MAP_AS_ERRORS((long)pConnection->m_asTCPIPSystem);
CloseIO (pConnection->m_asTCPIPSystem);
//
// process output parameters
//
char swap = pConnection->m_asTCPIPSystem->swap();
curptr = rbuffer;
//
// copy odbcas_ASSvc_GetObjRefHdl_exc_ *exception_
//
exception_->exception_nr = *(IDL_long *)(curptr + msg_total_length);
msg_total_length += sizeof(exception_->exception_nr);
LONG_swap(&exception_->exception_nr,swap);
exception_->exception_detail = *(IDL_long *)(curptr + msg_total_length);
msg_total_length += sizeof(exception_->exception_detail);
LONG_swap(&exception_->exception_detail,swap);
exceptionLength = *(IDL_long *)(curptr + msg_total_length);
msg_total_length += sizeof(exceptionLength);
LONG_swap(&exceptionLength,swap);
if(exceptionLength > 0)
{
//.........这里部分代码省略.........
示例2: OpenIO
/*
* Synchronous object call for
* operation 'odbcas_ASSvc_StopSrvr'
*/
extern "C" void
odbcas_ASSvc_StopSrvr(
/* In */ const CEE_handle_def *ph_
, /* Out */ struct odbcas_ASSvc_StopSrvr_exc_ *exception_
, /* In */ DIALOGUE_ID_def dialogueId
, /* In */ IDL_long srvrType
, /* In */ const IDL_char *srvrObjRef
, /* In */ IDL_long StopType
)
{
CEE_status retcode;
bool sts;
IDL_char *curptr;
IDL_long msg_total_len = 0;
IDL_long wlength, rlength;
IDL_char *wbuffer, *rbuffer;
SRVR_CALL_CONTEXT *srvrCallContext = (SRVR_CALL_CONTEXT *)ph_;
CConnect *pConnection = (CConnect *)srvrCallContext->sqlHandle;
pConnection->m_asTCPIPSystem->odbcAPI = AS_API_STOPSRVR;
pConnection->m_asTCPIPSystem->dialogueId = srvrCallContext->dialogueId;
pConnection->m_asTCPIPSystem->dwTimeout = srvrCallContext->u.connectParams.loginTimeout;
//
// do marshaling of input parameters
//
retcode = odbcas_ASSvc_StopSrvr_param_pst_(
pConnection->m_asTCPIPSystem
, wbuffer
, wlength
, dialogueId
, srvrType
, srvrObjRef
, StopType);
if (retcode != CEE_SUCCESS)
return;
sts = OpenIO (pConnection->m_asTCPIPSystem,pConnection->getAsObjRef());
if (sts == false)
return;
sts = DoIO (pConnection->m_asTCPIPSystem, wbuffer, wlength, rbuffer, rlength,pConnection);
if (sts == false)
return;
CloseIO (pConnection->m_asTCPIPSystem);
//
// process output parameters
//
char swap = pConnection->m_asTCPIPSystem->swap();
msg_total_len = 0;
curptr = rbuffer;
//
// exception_
//
IDL_long ExceptionLength;
//
// exception_ ->exception_nr
//
exception_->exception_nr = *(IDL_long*)(curptr+msg_total_len);
msg_total_len += sizeof(exception_->exception_nr);
LONG_swap(&exception_->exception_nr,swap);
//
// exception_ ->exception_detail
//
exception_->exception_detail = *(IDL_long*)(curptr+msg_total_len);
msg_total_len += sizeof(exception_->exception_detail);
LONG_swap(&exception_->exception_detail,swap);
ExceptionLength = *(IDL_long*)(curptr+msg_total_len);
msg_total_len += sizeof(ExceptionLength);
LONG_swap(&ExceptionLength,swap);
if(ExceptionLength > 0)
{
exception_->u.ASParamError.ErrorText = (IDL_char*)(curptr+msg_total_len);
msg_total_len += ExceptionLength;
}
return;
}