本文整理汇总了C++中msxml2::IXMLDOMNodePtr::GetnodeTypedValue方法的典型用法代码示例。如果您正苦于以下问题:C++ IXMLDOMNodePtr::GetnodeTypedValue方法的具体用法?C++ IXMLDOMNodePtr::GetnodeTypedValue怎么用?C++ IXMLDOMNodePtr::GetnodeTypedValue使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类msxml2::IXMLDOMNodePtr
的用法示例。
在下文中一共展示了IXMLDOMNodePtr::GetnodeTypedValue方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Initial
void CQuickConnection::Initial(void)
{
IXMLDOMDocument2Ptr pConfig;
#ifdef _DEBUG
CFileSys::ConvertBinaryXML( "script\\QuickConnection.xml","script\\QuickConnection.bml" );
FILE* fIn;
if( NULL != (fIn=fopen( "script\\QuickConnection.bml","rb" )))
{
CFileSys::LoadBinaryXML( pConfig, fIn );
}
fclose( fIn );
#else
DFileGPack packFile;
packFile.Open(SFullName("script","QuickConnection.bml"));
CFileSys::LoadBinaryXML(pConfig, packFile.GetFile(), packFile.GetSize());
packFile.Close();
#endif
MSXML2::IXMLDOMNodePtr pNode = NULL;
if( pNode = pConfig->selectSingleNode( L"./root/quick_mode" ) )
{
long nIsQuickMode = pNode->GetnodeTypedValue();
m_nIsQuickMode = nIsQuickMode;
}
if( pNode = pConfig->selectSingleNode( L"./root/frame_speed_on" ) )
{
long nFrameSpeedOn = pNode->GetnodeTypedValue();
m_nFrameSpeedOn = nFrameSpeedOn;
}
if( pNode = pConfig->selectSingleNode( L"./root/full_court" ) )
{
long nFullCourt = pNode->GetnodeTypedValue();
m_nIsFullCourt = nFullCourt;
}
if( pNode = pConfig->selectSingleNode( L"./root/select_host" ) )
{
long nIsHost = pNode->GetnodeTypedValue(); // long, short.
m_nIsHost = nIsHost;
//
}
// 중앙 서버의 ip 주소를 얻어 온다.
if(pNode = pConfig->selectSingleNode(L"./root/server_option/server_addr"))
{
_bstr_t server_addr = pNode->GetnodeTypedValue();
m_sServerAddr = server_addr;
}
// 중앙 서버의 Port 를 얻어 온다.
if(pNode = pConfig->selectSingleNode(L"./root/server_option/server_port"))
{
long nServerPort = pNode->GetnodeTypedValue();
m_iServerPort = nServerPort;
}
if(pNode = pConfig->selectSingleNode( L"./root/host_config/host_port" ))
{
long nHostPort = pNode->GetnodeTypedValue();
m_nHostPort = nHostPort;
}
if(pNode = pConfig->selectSingleNode( L"./root/host_config/player_on_player" ))
{
long nPlayerOn = pNode->GetnodeTypedValue();
m_nPlayerOn = nPlayerOn;
}
if(pNode = pConfig->selectSingleNode( L"./root/host_config/play_mode" ))
{
_bstr_t sPlayMode = pNode->GetnodeTypedValue();
m_sPlayMode = sPlayMode;
}
/////
MSXML2::IXMLDOMNodeListPtr pObjectList = pConfig->selectNodes(L"./root/host_db/character");
int nObject = pObjectList->Getlength();
for( int j = 0; j < nObject; j++ )
{
MSXML2::IXMLDOMNodePtr pNode;
MSXML2::IXMLDOMNodePtr pObject = pObjectList->Getitem(j);
pNode = pObject->selectSingleNode(L"./position/x");
m_vecPos[j].X = pNode->GetnodeTypedValue();
pNode = pObject->selectSingleNode(L"./position/y");
m_vecPos[j].Y = pNode->GetnodeTypedValue();
pNode = pObject->selectSingleNode(L"./position/z");
m_vecPos[j].Z = pNode->GetnodeTypedValue();
}
/////
if(pNode = pConfig->selectSingleNode( L"./root/client_option/connection_addr" ))
{
_bstr_t sConnectAddr = pNode->GetnodeTypedValue();
m_sConnectAddr = sConnectAddr;
}
//.........这里部分代码省略.........
示例2: LoadShootSolutionSet
void CShootManagerSys::LoadShootSolutionSet(LPCTSTR szFilename)
{
int i;
MSXML2::IXMLDOMDocument2Ptr pDoc;
pDoc.CreateInstance(__uuidof(DOMDocument40));
pDoc->load((_variant_t)szFilename);
// 시뮬레이터에서 사용하는 거리 범위들을 로드한다.
MSXML2::IXMLDOMNodeListPtr pNodeListDistance;
MSXML2::IXMLDOMNodePtr pNodeDistance;
float fDistance;
pNodeListDistance = pDoc->selectNodes(L"root/distance_range/distance");
for(i=0; i<pNodeListDistance->Getlength(); i++)
{
pNodeDistance = pNodeListDistance->Getitem(i);
_bstr_t distance = pNodeDistance->GetnodeTypedValue();
sscanf((LPCTSTR)distance, "%f", &fDistance);
m_DistanceList.push_back(fDistance);
}
// 시뮬레이터에서 사용하는 각도 범위들을 로드한다.
// 여기서 각도는 (골대 - 슈터) 와 양의 z 축 사이의 각도를 말한다.
// degree 로 저장되어 있으므로 Angle 로 변환시킨다.
MSXML2::IXMLDOMNodeListPtr pNodeListAngle;
MSXML2::IXMLDOMNodePtr pNodeAngle;
float fDegree;
int iAngle;
pNodeListAngle = pDoc->selectNodes(L"root/angle_range/degree");
for(i=0; i<pNodeListAngle->Getlength(); i++)
{
pNodeAngle = pNodeListAngle->Getitem(i);
_bstr_t degree = pNodeAngle->GetnodeTypedValue();
sscanf((LPCTSTR)degree, "%f", &fDegree);
iAngle = Degree2Angle(fDegree); // degree 에서 Angle 로 변환한다.
m_AngleList.push_back(iAngle);
}
// 전체 섹터 개수를 계산하고 여기에 맞게 메모리를 생성한다.
int iNumSector = m_DistanceList.size() * (m_AngleList.size() + 1) + 6;
for(i=0; i<iNumSector; i++)
{
ShootSolutionSector *pShootSolutionSector = new (m_ShootSolutionSectorArray) ShootSolutionSector;
}
// 각 섹터별로 섹터안의 Shoot Solution 들을 로드한다.
MSXML2::IXMLDOMNodeListPtr pNodeListSector = pDoc->selectNodes(L"root/sector");
MSXML2::IXMLDOMNodePtr pNodeSector;
MSXML2::IXMLDOMNodePtr pNodeIndex;
MSXML2::IXMLDOMNodePtr pNodePath;
for(i=0; i<pNodeListSector->Getlength(); i++)
{
pNodeSector = pNodeListSector->Getitem(i);
pNodeIndex = pNodeSector->selectSingleNode(L"index");
pNodePath = pNodeSector->selectSingleNode(L"path");
_bstr_t index = pNodeIndex->GetnodeTypedValue();
_bstr_t path = pNodePath->GetnodeTypedValue();
int iIndex = atoi((LPCTSTR)index);
SString sFilePath = szFilename;
sFilePath = DGetPathOnly(sFilePath);
sFilePath += "\\";
sFilePath += (LPCTSTR)path;
// sFilePath.Format("%s\\%s\\%s", g_szCurrentPath, g_szSimulatorPath, (LPCTSTR)path);
LoadShootSolutionSector(iIndex, (LPCTSTR)sFilePath);
}
pDoc.Release();
}
示例3: Init
bool CGameApp::Init()
{
// plasma 2005.07.06 - 디버그 모드에선 그냥 직접 읽고, 릴리즈 모드에선 pak 파일에서 추출해서 사용한다.
#ifdef _DEBUG
// if( !g_TextManager.Load("text_data/text.dat") )
if( !g_TextManager.LoadPack("text.dat", "text_data") )
{
MessageBox( NULL, "Text.Dat load fail", "Error", MB_OK );
}
#else
if( !g_TextManager.LoadPack("text.dat", "text_data") )
{
MessageBox( NULL, "Text.Dat load fail", "Error", MB_OK );
}
#endif
// Create game all systems.
m_pGSystem = new CSystemWin32Imp;
m_pGSystem->Init(m_pProcessInfo);
// 2003/11/19 by impurity create xml system
MSXML2::IXMLDOMDocument2Ptr pDoc = NULL;
//#ifdef _DEBUG
// CFileSys::ConvertBinaryXML("script\\window.xml","script\\window.bml");
// FILE* fIn;
// if(NULL!=(fIn=fopen("script\\window.bml","rb")))
// {
// CFileSys::LoadBinaryXML(pDoc, fIn);
// }
// fclose( fIn );
//#else
DFileGPack packFile;
packFile.Open(SFullName("script","window.bml"));
CFileSys::LoadBinaryXML(pDoc, packFile.GetFile(), packFile.GetSize());
packFile.Close();
//#endif
MSXML2::IXMLDOMNodePtr pNode = NULL;
if(pNode=pDoc->selectSingleNode(L"./root/window/bitperpixel"))
{
m_DisplayMode.iBitPerPixel = (short)pNode->GetnodeTypedValue();
}
else
{
m_DisplayMode.iBitPerPixel = 16;
}
m_DisplayMode.iDeviceType = 0;
//if(pNode=pDoc->selectSingleNode(L"./root/window/fullmode"))
//{
// m_DisplayMode.iFullScreen = (bool)pNode->GetnodeTypedValue();
// ((CProcessInfoWin32Imp *)m_pProcessInfo)->m_bFullScreen = true;
//}
//else
{
m_DisplayMode.iFullScreen = false;
((CProcessInfoWin32Imp *)m_pProcessInfo)->m_bFullScreen = false;
}
m_DisplayMode.iRefreshRate = 0;
m_DisplayMode.iZBufferDepth = 32;
if(pNode=pDoc->selectSingleNode(L"./root/window/width"))
{
m_DisplayMode.iWidth = (short)pNode->GetnodeTypedValue();
}
else
{
m_DisplayMode.iWidth = 800;
}
if(pNode=pDoc->selectSingleNode(L"./root/window/height"))
{
m_DisplayMode.iHeight = (short)pNode->GetnodeTypedValue();
}
else
{
m_DisplayMode.iHeight = 600;
}
CFileSys::UnloadXML(pDoc);
m_pGameFactory = new CGameFactoryImp;
// Register Game factory to Factory System.
m_pGSystem->GetFactorySys()->RegisterGameFactory( m_pGameFactory );
// 3d base initial.
InitPhysics();
CWindowSysWin32Imp* pWindowSysWin32Imp = (CWindowSysWin32Imp*)m_pGSystem->GetWindowSys();
if( !m_pGSystem->GetGControlSys()->Create( pWindowSysWin32Imp->m_hWnd,
m_DisplayMode ) )
{
//.........这里部分代码省略.........