Skip to main content
Known Participant
December 27, 2016
Question

m_lpDispatch value getting NULL

  • December 27, 2016
  • 0 replies
  • 324 views

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

This topic has been closed for replies.