![]() |
【转帖】oddbrasterimagedefsetsourcefilename not working
oddbrasterimagedef::setsourcefilename not working?
oddbrasterimagedef::setsourcefilename not working? hi, i load database from file and then: code: oddbdictionaryptr pimgdict = imagedictid.openobject(oddb::kforwrite); oddbdictionaryiteratorptr piter = pimgdict->newiterator(); while (!piter->done()) { oddbrasterimagedefptr pimgdef = piter->objectid().safeopenobject(oddb::kforwrite); pimgdef->setsourcefilename("aaa"); odstring strtest = pimgdef->sourcefilename(); piter->next(); } strtest is "aaa" but when i save the database to a file image path is not changed. what should i do to make paths change? i've tried code: pimgdef->upgradeopen(); pimgdef->setsourcefilename("aaa"); odstring strtest = pimgdef->sourcefilename(); pimgdef->downgradeopen(); and code: pimgdef->setsourcefilename("aaa"); odstring strtest = pimgdef->sourcefilename(); pimgdef->load(); but still images paths in drawing file do not change. tia regards, micha? ?liwka i can't reproduce it in odamfcapp. your code works. are you sure you save the database to the same file and the save realy happens? was file time stamp updated? sergey slezkin i save database to other file. timestamp is new. this is the code i tried in odamfcapp 2.2 code: oddbdictionaryptr pimgdict = oddbrasterimagedef::imagedictionary(pdb).openobject(oddb::kforwrite); oddbdictionaryiteratorptr piter = pimgdict->newiterator(); while (!piter->done()) { oddbrasterimagedefptr pimgdef = piter->objectid().safeopenobject(oddb::kforwrite); pimgdef->setsourcefilename("aaa"); odstring strtest = pimgdef->sourcefilename(); piter->next(); } return; (only the first line of your code was changed) which dd version do you use? sergey slezkin oh, i'm sorry, i didn't say that i'm using 1.14.02. i'm sorry, i'm using 2.2 in this app |
所有的时间均为北京时间。 现在的时间是 01:11 AM. |