![]() |
【转帖】oddbobjectid to charin
oddbobjectid to char/int ..
oddbobjectid to char/int .. hi, i need to get oddbobjectid in terms of int or char. is it possible to get that? basically i am trying to get unique character/integer value for each entity, so could you please help me out?? thanks in advance. would using an oddbhandle work for you? i use the following code to get the object id based on the handle: code: void getobjectid(char *ahandle) { oddbhandle objhandle(ahandle); oddbobjectid objid = pdb->getoddbobjectid(objhandle); }you can see that i am using handles to retrieve the object ids. i read somewhere that handles are unique in the database. if you have a better way i would also like to know about it. to get the handle i use: code: #define handle_size 20 void gethandle(char **ahandle) { // add entity ... // allocate memory for handle (*ahandle) = (char *) malloc(handle_size * sizeof(char)); oddbhandle objhandle = pobj->getdbhandle(); odchar odhandle[handle_size]; objhandle.getintoasciibuffer(odhandle); for (int j = 0; j < handle_size; j++) (*ahandle)[j] = (char) odhandle[j]; |
| 所有的时间均为北京时间。 现在的时间是 07:08 AM. |