Ik heb de volgende code:
Echter geeft dit de volgende foutmeldingen:
Heeft iemand enig idee? Of een handig trucj hiervoor?
Anders moet ik alles gaan casten of if-elsen...
Code:
const bstr_t EQUIPMENTID = "EquipmentID";
const bstr_t GW_LICENSE = "GWLicense";
const bstr_t SDR_LICENSE = "SDRLicense";
const bstr_t GW_VERSION = "GWVersion";
const bstr_t SDR_VERSION = "SDRVersion";
const bstr_t GW_SERIAL = "GWSerial";
const bstr_t SDR_SERIAL = "SDRSerial";
bstr_t strNodeName = pParent->nodeName;
switch(strNodeName)
{
case EQUIPMENTID: {this->m_pCGemdb->m_EquipmentID = pChild->text; break;}
case GW_LICENSE: {this->m_pCGemdb->m_GWLicense = pChild->text; break;}
case SDR_LICENSE: {this->m_pCGemdb->m_SDRLicense = pChild->text; break;}
case GW_VERSION: {this->m_pCGemdb->m_GWVersion = pChild->text; break;}
case SDR_VERSION: {this->m_pCGemdb->m_SDRVersion = pChild->text; break;}
case GW_SERIAL: {this->m_pCGemdb->m_GWSerial = pChild->text; break;}
case SDR_SERIAL: {this->m_pCGemdb->m_SDRSerial = pChild->text; break;}
default: {break;}
}
Echter geeft dit de volgende foutmeldingen:
Code:
xxxx.cpp(147) : error C2450: switch expression of type 'class _bstr_t' is illegal
No user-defined-conversion operator available that can perform this conversion, or the operator cannot be called
xxxx.cpp(148) : error C2051: case expression not constant
xxxx.cpp(149) : error C2051: case expression not constant
xxxx.cpp(150) : error C2051: case expression not constant
xxxx.cpp(151) : error C2051: case expression not constant
xxxx.cpp(152) : error C2051: case expression not constant
xxxx.cpp(153) : error C2051: case expression not constant
xxxx.cpp(154) : error C2051: case expression not constant
Heeft iemand enig idee? Of een handig trucj hiervoor?
Anders moet ik alles gaan casten of if-elsen...