Copy link to clipboard
Copied
Hello,
I am using OLE Automation C++ APIs for Inter-Application communication.
I want to get the selected text in PDF and apply annotation to that text.
For this purpose, I created the CAcroPDTextSelect object as below:
CAcroPDTextSelect *textSelect = NULL;
if (!textSelect) {
COleException e;
textSelect = new CAcroPDTextSelect;
textSelect->CreateDispatch("AcroExch.PDTextSelect", &e);
}
Then I am calling the function GetNumText with the object textSelect as below:
long numText = textSelect->GetNumText();
However, execution of this function gives error : Access violation reading location 0xCDFAEB2C.
When I did some debugging then I came to know that object m_lpDispatch = 0x00000000 <NULL>
Am I missing something while initializing things?
Please help!
Thank you in advance!
Regards,
Navnath
Have something to add?
Find more inspiration, events, and resources on the new Adobe Community
Explore Now