When the 'Currency' fid is updated, it it updated with the value of 826. When it is retrieved using Tib api, it is translated to "GBP". How can I get the value of 826?
When the 'Currency' fid is updated, it it updated with the value of 826. When it is retrieved using Tib api, it is translated to "GBP". How can I get the value of 826?
Just want to check if your application called TibMsg::SetEnumExpansion(TRUE); before you get the enum value from tibField.Data(). There could be a reason that TibMsg return string "GBP" rather than number 826.
You can set TibMsg::SetEnumExpansion(FALSE) if you want the number.
Please find more details from TibMsg API Programmer Guide (tmsgapi.pdf) section 12.3.11. TibMsg::SetEnumExpansion, TibMsg::SetInstanceEnumExpansion
For the TibAPI, you mean TibMsg, right?
Can you try method EnumValue2Index like the following sample code?
TibMsg_mfeed *mfeed_ptr; Tib_i32 ind; mfeed_ptr = TibMsg::Fname2Mfeed("CURRENCY"); // Point to fid CURRENCY ind = TibMsg::EnumValue2Index(mfeed_ptr, "EUR"); // "EUR" -> 978
You can also use TibMsg::Fid2Mfeed(15) to convert fid id to Mfeed pointer.