Cannot add a XChanger Viewer ActiveX control to my form

PDF-XChange Viewer SDK for Developer's
(ActiveX and Simple DLL Versions)

Moderators: PDF-XChange Support, Daniel - PDF-XChange, Chris - PDF-XChange, Sean - PDF-XChange, Vasyl - PDF-XChange, Ivan - Tracker Software, Stefan - PDF-XChange

adntES
User
Posts: 71
Joined: Fri Mar 25, 2011 5:43 pm

Cannot add a XChanger Viewer ActiveX control to my form

Post by adntES »

First, I added the reference correctly named PDFXviewAxLib. After this,
I added the component ActiveX control to the tools box menu.
When drag and drop the control from the menu i have an Compilator error.

Something like this:
Error happenned when generated the wrapper Windows Forms for the control ActiveX 'PDFXviewAxLib'.

Image

Did i'm missing something?

Note : we are using 1.1 with Visual Studio 2003
User avatar
John - Tracker Supp
Site Admin
Posts: 5223
Joined: Tue Jun 29, 2004 10:34 am

Re: Cannot add a XChanger Viewer ActiveX control to my form

Post by John - Tracker Supp »

Hi What is '1.1' ?

Have you tried to compile the demo app's and do these compile correctly ?

Also do you have the latest release (V2.5.194) from our downloads page ?
If posting files to this forum - you must archive the files to a ZIP, RAR or 7z file or they will not be uploaded - thank you.

Best regards
Tracker Support
http://www.tracker-software.com
adntES
User
Posts: 71
Joined: Fri Mar 25, 2011 5:43 pm

Re: Cannot add a XChanger Viewer ActiveX control to my form

Post by adntES »

Yes i'm using the latest version with framework 1.1. If i try to open an example with 2003 it tell me that it was done with an higher version and cannot open. However, i tryed to use the activeX control on another computer and it's worked well.
I don't understand because the only difference between both computer is the OS. He using windows 7 and i using Vista. I just tryed on another vista and it doesn't work too. I just don't get it , there must be something that may interfere with the librairy.

Here is a precise look like of my problem of the screenshot :

http://social.msdn.microsoft.com/Forums ... 42fa3bf59d

It's the same problem beside i'm running VS2003 and using your ActiveX control
Corwin - Tracker Sup
User
Posts: 664
Joined: Tue Nov 14, 2006 12:23 pm

Re: Cannot add a XChanger Viewer ActiveX control to my form

Post by Corwin - Tracker Sup »

Hello adntES,

Please try full reinstall of PDF-XChange Viewer (uninstall - reboot - clear viewer files if needed - install 194 build) with administrator rights.
adntES
User
Posts: 71
Joined: Fri Mar 25, 2011 5:43 pm

Re: Cannot add a XChanger Viewer ActiveX control to my form

Post by adntES »

I did but that doesn't help me...

EDIT : I run axImp on your dll , and i saw the place where it seem to crash here it is :

Code: Select all

public virtual void GetViewObjectFromName(string name, out int type, out int iD, out string properName) {
            if ((this.ocx == null)) {
                throw new System.Windows.Forms.AxHost.InvalidActiveXStateException("GetViewObjectFromName", System.Windows.Forms.AxHost.ActiveXInvokeKind.MethodInvoke);
            }
            object[] paramArray = new object[] {
                  name,
                    type,
                    iD,
                    properName,
                    System.Reflection.Missing.Value};
            System.Type typeVar = typeof(PDFXCviewAxLib.IPDFXCview2);
            System.Reflection.MethodInfo methodToInvoke = typeVar.GetMethod("GetViewObjectFromName");
            methodToInvoke.Invoke(this.ocx, paramArray);
            type = ((int)(paramArray[1]));
            iD = ((int)(paramArray[2]));
            properName = ((string)(paramArray[3]));
        }
When i try to put the control on the form or debug the .cs of your dll it say that ID , Type , Propername are not assigned from the method GetViewObjectFromName. I just don't get it why it just don't compile there. It's seem that any of the out reference is generating an error. Maybe u have an idea??

NEW EDIT : I manage to get it work but i would like you guys to fix it properly if you can of course. I just remove all the out reference of any method that failed to compile.
I put the new dll in my project and with worked. However i can't create it in the design. This is very strange and mean that for some environnement the out reference in parameter generate an error.
Corwin - Tracker Sup
User
Posts: 664
Joined: Tue Nov 14, 2006 12:23 pm

Re: Cannot add a XChanger Viewer ActiveX control to my form

Post by Corwin - Tracker Sup »

Have you read this?
http://support.microsoft.com/kb/889328
Microsoft has confirmed that this is a bug in the Microsoft products that are listed in the "Applies to" section.
adntES
User
Posts: 71
Joined: Fri Mar 25, 2011 5:43 pm

Re: Cannot add a XChanger Viewer ActiveX control to my form

Post by adntES »

Man , i can't believe i have to pay for the support on this hotfix that is caused by Microsoft...
That's a none sense....
User avatar
John - Tracker Supp
Site Admin
Posts: 5223
Joined: Tue Jun 29, 2004 10:34 am

Re: Cannot add a XChanger Viewer ActiveX control to my form

Post by John - Tracker Supp »

Please explain your comment ...

You are criticizing us - or MS ?
If posting files to this forum - you must archive the files to a ZIP, RAR or 7z file or they will not be uploaded - thank you.

Best regards
Tracker Support
http://www.tracker-software.com
adntES
User
Posts: 71
Joined: Fri Mar 25, 2011 5:43 pm

Re: Cannot add a XChanger Viewer ActiveX control to my form

Post by adntES »

I critize MS, your kit is awesome :) . By the way we will probably buy it. However, i would like to know if i can modify your dll with aximp and if yes, does it will remove some important function like the license itself? . We do not really want to pay 299$ for an MS hotfix that is caused by MS itself...
Corwin - Tracker Sup
User
Posts: 664
Joined: Tue Nov 14, 2006 12:23 pm

Re: Cannot add a XChanger Viewer ActiveX control to my form

Post by Corwin - Tracker Sup »

Sure you can edit wrapper code for ActiveX, but this may cause problems - for example if you remove "out" keyword from methods, you would not be able to receive output parameters form this method.
adntES
User
Posts: 71
Joined: Fri Mar 25, 2011 5:43 pm

Re: Cannot add a XChanger Viewer ActiveX control to my form

Post by adntES »

Do you know a workaround for the out parameter that may do the same trick??

Maybe your Dev team can manage to change these both method that are generating the error GetViewObjectFromName()
and GetDocumentFromName() from the wrapper and found an alternative for the out parameter so it will compile for anyone who have this error?

Parameter in question are out int type, out int iD, out string properName for GetViewObjectFromName()
and out int iD for GetDocumentFromName()
Corwin - Tracker Sup
User
Posts: 664
Joined: Tue Nov 14, 2006 12:23 pm

Re: Cannot add a XChanger Viewer ActiveX control to my form

Post by Corwin - Tracker Sup »

Try to change "out" keyword in problem functions to "ref".

HTH.
adntES
User
Posts: 71
Joined: Fri Mar 25, 2011 5:43 pm

Re: Cannot add a XChanger Viewer ActiveX control to my form

Post by adntES »

Thanks!
User avatar
Paul - PDF-XChange
Site Admin
Posts: 7362
Joined: Wed Mar 25, 2009 10:37 pm

Re: Cannot add a XChanger Viewer ActiveX control to my form

Post by Paul - PDF-XChange »

:)
Best regards

Paul O'Rorke
PDF-XChange Support
http://www.pdf-xchange.com