Skip to main content
Known Participant
December 28, 2016
Question

Error: Invalid number of parameters

  • December 28, 2016
  • 4 replies
  • 1880 views

Hello,

I am working on inter-application communication using OLE Automation APIs.

I want to get the page number on which text has been selected by user.

For this, I am using the function GetPage() of the class CAcroPDTextSelect.

I have done with all the initialization part.

Here is my code snippet:

CAcroPDTextSelect *textSelect;

COleException e;

textSelect->AttachDispatch(m_pAcroApp->GetActiveDoc(), TRUE);

long pageNumber = textSelect->GetPage();

But when I execute this function, I am getting below error:

Invalid number of parameters

Please help. This is real urgent!

Best regards,

Navnath.

This topic has been closed for replies.

4 replies

Legend
January 3, 2017

I don't think we have any more assistance for you here. I suggest you buy a support case if you can find out how. I believe it is $200.

Legend
January 2, 2017

In 1 I said project not product. Sorry I have no solution for your original problem. For $200 you can buy a support case but I don't know how.

Legend
December 30, 2016

You say the samples aren't working. Things to beware of

1. You must use the original projects.

2. You cannot copy/paste into a new project.

3. You cannot make an executable.

4. You cannot use them with Reader.

If that doesn't help, please describe your procedures, and how you determine EXACTLY that the samples are not working.

Known Participant
January 2, 2017

Hello,

1. I used Acrobat Pro DC Trial version as well as Acrobat 2015 trial version.

Please give me the correct download link of Acrobat Product on which I can do manipulation of documents with SDK,

OR, By Original Product,

You mean, should I purchase the Acrobat DC product for evaluating the SDK?

2. I did not copy/paste the samples. I added an extra function in RemoteControlAcrobatVC example of Inter-application support samples. I mean Extra function to annotate a text because there was no sample for annotating the text and I need to evaluate the same. These samples are working fine with Acrobat 2015 version.

3. I did not make executable.

4. I used it with Editors only.

As you suggested, I am giving exact procedure that I followed.

I downloaded Acrobat 2015 from this link: Download Pro or Standard versions of Acrobat DC, XI, or X

Samples are working with this link except annotation for which I already posted a query with the steps in my 2nd post in this thread.

I downloaded Acrobat Pro DC from this link: Download Adobe Acrobat free trial | Acrobat Pro DC

However, samples are not working with this trail version.

Whenever, I tried to debug same sample RemoteControlAcrobatVC with this version, It gives me following error:

Unauthorized access to memory location <Some hexadecimal value of  memory address>

After debugging more, I came to know that m_IDispatch pointer value gets NULL.

Thats why It could not be continued.

Apart from this, If possible, Please give the reply to my first query "Invalid Number of parameters".

Thanks

Best Regards,

Navnath

Bernd Alheit
Community Expert
Community Expert
January 2, 2017

The samples are working with classic and continuous track of Acrobat Pro DC.

Legend
December 28, 2016

Nothing happens very fast in this forum, even if it isn't the holidays. You may be able to speed things up by providing basic information missing in all your posts: platform, Acrobat product, Acrobat version, SDK version used; whether any other API works; your initialization code and how you test for success.

Known Participant
December 29, 2016

Thank you for your information.

As I don't see file attachment option here, I am putting necessary information in this reply.

Platform I am working: Windows 7

Acrobat Product: Adobe Acrobat DC

Acrobat Version: Acrobat 2015 Trial version

SDK Version: Acrobat DC SDK (Version 1)

I am trying to evaluate the SDK by adding my own code in a C sample "RemoteControlAcrobatVC" from InterAppCommunicationSupport folder.
I see that, other APIs that are in the sample are working fine like "Launch the App", "Open document", "Find text" etc.

I added a new function called OnAcrobatPageAnnot as below:

void CRemoteControlAcrobatView::OnAcrobatPageAnnot()

{

  // create object "AcroExch.PDTextSelect"

  textSelect = new CAcroPDTextSelect();

  COleException e;

  textSelect->AttachDispatch(m_pAcroApp->GetActiveDoc(), TRUE);

  if (!textSelect) {

  AfxMessageBox("Can not create TextSelect object!"); 

}

  long pageNumber = textSelect->GetPage();

  AfxMessageBox("Page number on which text selection detected:" + pageNumber );

}

And required initialization is as below:

CAcroApp *m_pAcroApp = NULL;

CAcroPDTextSelect *textSelect=NULL;

COleException e;

m_pAcroApp = new CAcroApp;

m_pAcroApp->CreateDispatch("AcroExch.App", &e);

And method OnAcrobatPageAnnot declaration is as below:

afx_msg void OnAcrobatPageAnnot();

Please let me know where I am going wrong.

Thank you.

Best regards,

Navnath

Known Participant
December 30, 2016

For your more information,

I downloaded Acrobat Pro DC and tried to evaluate the c++ samples on the same.

However, Acrobat DC SDK (Version1) samples are not working for Acrobat Pro DC.

I see there are different Acrobat installations like Acrobat Pro DC, Acrobat Standard DC, Acrobat 2015, Acrobat Pro DC (Continuous), Acrobat Standard DC(Continuous) etc. And I am confused about those installations.

And again there is only one version of Acrobat DC SDK. (Version1 as I downloaded)

Please guide me for proper downloads if required.

I have mentioned what I have downloaded in the previous reply.

Thanks.

Regards,

Navnath