Question
FDK F_ApiAddText() for pgfs in selected cells crashing FM 7.2?
I have developed an extension that walks any selection, deletes a few characters and adds new ones. It deals well with text selections, including table anchors and footnotes, and also handles all text in cells of a table selected via an anchor quite well. Text selections within cells also are handled quite well.
If, however, the selection is only individual cells of a table, F_ApiDeleteText() works well on the current pgfId in the cell, and the immediately following F_ApiAddText() first does the right thing as can be seen on screen, and then crashes FM 7.2 with an unhandled exception 0xC0000005 with a read access violation on 0x24.
Why would F_ApiAddText() work fine if I iterate over a whole table with all cells, but fail abysmally if I try to run on a single selected cell?
I even checked all F_ApiAddText() arguments for my test cell and the working and crashing call specify the same docId, pgfId, and offset.
I found in the fdkguide.pdf a cryptic ref that to add text to a cell you need to specify the cell instead of a pgf (which I don't understand as you can have multiple pgf's to work on in a cell), but I am working on a pgf within a cell and it works well ... except if the current selection is only individual cells.
Any suggestions what I am overlooking?
Thanks
Heinz
If, however, the selection is only individual cells of a table, F_ApiDeleteText() works well on the current pgfId in the cell, and the immediately following F_ApiAddText() first does the right thing as can be seen on screen, and then crashes FM 7.2 with an unhandled exception 0xC0000005 with a read access violation on 0x24.
Why would F_ApiAddText() work fine if I iterate over a whole table with all cells, but fail abysmally if I try to run on a single selected cell?
I even checked all F_ApiAddText() arguments for my test cell and the working and crashing call specify the same docId, pgfId, and offset.
I found in the fdkguide.pdf a cryptic ref that to add text to a cell you need to specify the cell instead of a pgf (which I don't understand as you can have multiple pgf's to work on in a cell), but I am working on a pgf within a cell and it works well ... except if the current selection is only individual cells.
Any suggestions what I am overlooking?
Thanks
Heinz
