Sample Program VB6 demonstrating PXV_Control_onEvent Declaration

PDF-XChange Editor SDK for Developers

Moderators: Tracker Support, TrackerSupp-Daniel, Paul - Tracker Supp, Chris - Tracker Supp, Vasyl-Tracker Dev Team, Sean - Tracker, Tracker Supp-Stefan, Ivan - Tracker Software

Forum rules
DO NOT post your license/serial key, or your activation code - these forums, and all posts within, are public and we will be forced to immediately deactivate your license.

When experiencing some errors, use the IAUX_Inst::FormatHRESULT method to see their description and include it in your post along with the error code.
Post Reply
prime clinical systems
User
Posts: 184
Joined: Sun Aug 05, 2012 5:20 pm

Sample Program VB6 demonstrating PXV_Control_onEvent Declaration

Post by prime clinical systems » Sun Mar 26, 2017 5:17 pm

Hi going to start a new post on this issue with sample program. Simply start new project, add the control to the components window, and then draw the control on a form. Double click on the control to show the bad declaration, making it impossible to catch any events. Please fix asap, as not possible to use the control, tested with 319 and 321 builds.

Code: Select all

Private Sub PXV_Control_OnEvent(ByVal nEventID As Long, ByVal pEvent As PDFXEditCtl.IEvent, ByVal pFrom As 0)

End Sub
Thanks
Attachments
sample vb6 event error.zip
Sample Code with the issue
(1.19 KiB) Downloaded 56 times

User avatar
Sasha - Tracker Dev Team
User
Posts: 4076
Joined: Fri Nov 21, 2014 8:27 am
Contact:

Re: Sample Program VB6 demonstrating PXV_Control_onEvent Declaration

Post by Sasha - Tracker Dev Team » Tue Mar 28, 2017 8:48 am

Hello prime clinical systems,

We've investigated the problem and the problem is in the VB6 itself. The widely used languages like VB.Net, C#, Delphi, C++ are working correctly. We will try to make some workarounds though we don't guarantee that.

Cheers,
Alex
Join us at Google+:
https://plus.google.com/+PDFXChangeEditorTS
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ

prime clinical systems
User
Posts: 184
Joined: Sun Aug 05, 2012 5:20 pm

Re: Sample Program VB6 demonstrating PXV_Control_onEvent Declaration

Post by prime clinical systems » Tue Mar 28, 2017 9:26 am

Well, during my evaluation I did not try working with events, just basic things like loading document, printing etc, and supposedly Certified by Microsoft, and this would be the very first activexdll that I have ever seen that does not work with VB6. If you can send code that would implement an event monitor as a workaround at least, as I have used your product, Viewer SDK for 5 years as was originally guaranteed that form fields support would be part of that, then Tracker dropped that and went to the Editor SDK only, and now that it's paid for I sure hope you can find some fix, as this does not sound like a VB6 problem rather the fact that if you notice, the INothing interface is not exposed to VB6 as far as I can see.

Private Sub PXV_Control_OnEvent(ByVal nEventID As Long, ByVal pEvent As PDFXEditCtl.IEvent, ByVal pFrom As 0)

supposed to be Private Sub PXV_Control_OnEvent(ByVal nEventID As Long, ByVal pEvent As PDFXEditCtl.IEvent, ByVal pFrom As PDFXEditCtl.INothing )

Thanks.. please don't give up on this.

User avatar
Sasha - Tracker Dev Team
User
Posts: 4076
Joined: Fri Nov 21, 2014 8:27 am
Contact:

Re: Sample Program VB6 demonstrating PXV_Control_onEvent Declaration

Post by Sasha - Tracker Dev Team » Wed Mar 29, 2017 8:46 am

Hello prime clinical systems,

What you can do now is to implement some kind of wrapper dll that would use our dll and then transmit the data you need to your VB6 code.

Cheers,
Alex
Join us at Google+:
https://plus.google.com/+PDFXChangeEditorTS
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ

prime clinical systems
User
Posts: 184
Joined: Sun Aug 05, 2012 5:20 pm

Re: Sample Program VB6 demonstrating PXV_Control_onEvent Declaration

Post by prime clinical systems » Wed Mar 29, 2017 9:05 am

Sounds like a cop-out answer my friend. How much do you want to write this wrapper for me, I have no idea where to begin. I would like to see a copy of your "Microsoft Certification" as is advertised on the web site please, as I doubt they would give that out without compatibility, and certainly no place on your web site does it say, Warning, this control won't work with VB6.

If you could get RMAN user on this forum to answer me, he uses this with VB6 and does get events according to all of his posts, I would like to find out what he does to get the events to work.

Thanks

User avatar
Tracker Supp-Stefan
Site Admin
Posts: 13320
Joined: Mon Jan 12, 2009 8:07 am
Location: London
Contact:

Re: Sample Program VB6 demonstrating PXV_Control_onEvent Declaration

Post by Tracker Supp-Stefan » Wed Mar 29, 2017 10:41 am

Hello Clifford,

Thanks for your e-mail and forum posts.
We've had a chat internally both with Alex and with other colleagues from the team.

The main reason for the problems as Alex explained it to me is because VB6 simply cannot translate the code correctly as it is outdated.
I did check - and the last version of VB6 was released 19 years ago - and Microsoft stopped support for the IDE in 2008 - 9 years ago, so it is clear that you are using an outdated development tool which will eventually start showing it's age and incompatibilities with modern SDK products.
I know lots of developers are reluctant moving to VB.NET - but this is the version Microsoft currently supports - and it works properly with our tools.

We did discuss the possibility to make our code compatible with VB6 but these are the 3 main concerns we have:
1) This is time consuming
2) This could lead to potential problems with other languages
3) There could be a problem with other developers who are already using our library

We are looking at the possibilities and how much time actually might be needed to do such modifications (if at all possible). The alternative is for you to write the needed wrapper yourself as advised on the forms - please note that we can not expedite this from our end further than we have already done.

Regards,
Stefan

RMan
User
Posts: 159
Joined: Tue Jul 02, 2013 10:06 pm

Re: Sample Program VB6 demonstrating PXV_Control_onEvent Declaration

Post by RMan » Wed Mar 29, 2017 3:09 pm

The Editor_OnEvent isn't too bad in VB6. I'll try to clean up my VB6 sample today or tomorrow and post it up but here's the basis like watching for the ActiveTool to change as well as a sample of how to hide the CutomizeUI when the Preferences Dialog is shown.

Code: Select all

Private Sub Editor_OnEvent(ByVal nEventID As Long, ByVal pEvent As PDFXEditCtl.IEvent, ByVal pFrom As Object)
    'Editor_OnEvent nEventID, pEvent '
    On Error Resume Next
    txtEvents.Text = pEvent.ID & " " & AxPXV_Control1.Inst.ID2Str(pEvent.ID) & " Param1=" & pEvent.Param1 & " Param2=" & pEvent.Param2 & vbCrLf & txtEvents.Text
   
    If pEvent.ID = AxPXV_Control1.Inst.Str2ID("e.document.toolActivated") Then
        txtEvents.Text = "toolActivated " & AxPXV_Control1.doc.ActiveTool.ID & AxPXV_Control1.doc.ActiveTool.Name  & vbCrLf & txtEvents.Text
    ElseIf pEvent.ID = AxPXV_Control1.Inst.Str2ID("e.commentStylesChanged") Then
        txtEvents.Text = "Changed " & AxPXV_Control1.Inst.ID2Str(pEvent.Param1) & vbCrLf & txtEvents.Text
    ElseIf pEvent.ID = AxPXV_Control1.Inst.Str2ID("e.beginPropDialog") Then
        txtEvents.Text = "Begin prop dialog" & AxPXV_Control1.Inst.ID2Str(pEvent.Param1) & vbCrLf & txtEvents.Text
        Dim ps As IUIX_PropSheets
        Set ps = pFrom
        If Not ps Is Nothing Then
            If StrComp(ps.ID, "DlgAppPrefs", vbTextCompare) = 0 Then
                txtEvents.Text = "DlgAppPrefs shown" & vbCrLf & txtEvents.Text
                ps.RemovePage "DlgAppPrefs.CustomUI" 
            End If
        End If
    End If
End Sub
Last edited by RMan on Wed Mar 29, 2017 4:56 pm, edited 2 times in total.

User avatar
Tracker Supp-Stefan
Site Admin
Posts: 13320
Joined: Mon Jan 12, 2009 8:07 am
Location: London
Contact:

Re: Sample Program VB6 demonstrating PXV_Control_onEvent Declaration

Post by Tracker Supp-Stefan » Wed Mar 29, 2017 3:18 pm

Thanks for this RMan,

In the mean time my colleagues from the dev team were also looking for possible solutions to this problem.
They just managed to make it work - but it is an awkward solution, but the usage suggested is not normal - you will need to remove the method and create it again and then the compiler will think that it is OK. This will need to be done every time you launch the project. Also this can only be used in Publish mode and not in Debug - as debug will crash.
Here is a gif illustrating the usage we propose:
https://plus.google.com/u/0/b/106988693 ... ?icm=false

Regards,
Stefan

RMan
User
Posts: 159
Joined: Tue Jul 02, 2013 10:06 pm

Re: Sample Program VB6 demonstrating PXV_Control_onEvent Declaration

Post by RMan » Wed Mar 29, 2017 4:52 pm

I mentioned that to someone there a while back. It's defined wrong for VB6 and you should be able to look at how they defined the OnEvent in the Viewer code since it worked properly with VB6, C#, C++, and others before I think.

Private Sub PDFEditor_OnEvent(ByVal nEventID As Long, ByVal pEvent As PDFXEditCtl.IEvent, ByVal pFrom As Object)
instead of
Private Sub PDFEditor_OnEvent(ByVal nEventID As Long, ByVal pEvent As PDFXEditCtl.IEvent, ByVal pFrom As 0)

What I did was define my own command that I call from the PDFEditor_OnEvent so I only have 2 lines of code to copy each time. But it is a pain each time I open the project to redefine it and then delete out the old code.

Code: Select all

Private Sub PDFEditor_OnEvent(ByVal nEventID As Long, ByVal pEvent As PDFXEditCtl.IEvent, ByVal pFrom As 0)
    On Error Resume Next
    Call MyPDFEditorOnEvent(nEventID, pEvent, pFrom)
End Sub

Code: Select all

Private Sub MyPDFEditorOnEvent(ByVal nEventID As Long, ByVal pEvent As PDFXEditCtl.IEvent, ByVal pFrom As Object)
    'Your code to do whatever here '
End Sub

prime clinical systems
User
Posts: 184
Joined: Sun Aug 05, 2012 5:20 pm

Re: Sample Program VB6 demonstrating PXV_Control_onEvent Declaration

Post by prime clinical systems » Wed Mar 29, 2017 7:43 pm

Thanks for the posts RMAN and Tracker, apparently RMAN you must be running the program ignoring errors or something, as I could never get it to run in the example you had, but thanks so much for putting it up. Actually now I'm looking at just working with Java Script as much of what I did before with old control was with JS, and looking at work arounds until a definitive solution can be found.

CE

prime clinical systems
User
Posts: 184
Joined: Sun Aug 05, 2012 5:20 pm

Re: Sample Program VB6 demonstrating PXV_Control_onEvent Declaration

Post by prime clinical systems » Wed Mar 29, 2017 9:43 pm

Ok RMAN, I got yours to work, but only as compiled, IDE cannot get it to run that way, but anyway, at least can now setup the events I need.

ce

RMan
User
Posts: 159
Joined: Tue Jul 02, 2013 10:06 pm

Re: Sample Program VB6 demonstrating PXV_Control_onEvent Declaration

Post by RMan » Wed Mar 29, 2017 11:49 pm

Great. I always run compiled and not through the IDE. The only pain is having to redefine it when you reopen the project.

Hopefully they can get that resolved in future builds for those of use still using VB6 so we don't have to redefine it each time.

Also here's a very messy project I've been testing with it if helps you at all. The functions in the top left dropdown should work. The other command buttons on the far right side are just various test things I was messing with and are not done yet.
https://www.cadzation.com/downloads/VB6-2017-03-29.zip

prime clinical systems
User
Posts: 184
Joined: Sun Aug 05, 2012 5:20 pm

Re: Sample Program VB6 demonstrating PXV_Control_onEvent Declaration

Post by prime clinical systems » Thu Mar 30, 2017 1:24 am

thanks, well sounds they have no plans to try and fix this, but they blame it on vb6 being too old, well, it is the longest tested environment their is, and still many legacy products out there, and they abandoned the old control which was fine, just never delivered on the promised form fields, instead change to new product and now don't want to support VB6 any more, and I doubt highly that the product is Microsoft certified as they say with this kind of an issue, oh well, will keep using work arounds for now.

John - Tracker Supp
Site Admin
Posts: 8201
Joined: Tue Jun 29, 2004 10:34 am
Location: Vancouver Island - Canada
Contact:

Re: Sample Program VB6 demonstrating PXV_Control_onEvent Declaration

Post by John - Tracker Supp » Thu Mar 30, 2017 6:37 am

firstly - we have not abandoned anything - we have said we will look at attempting to assist - and that is exactly want we will do, but it will take longer than 24 hours so please be patient.

However - please be aware this whatever the outcome of our attempts - VB6 is not supported by MS and therefore you will encounter increasing issues with all products that it relays on or interacts with - including Windows and our own products and we will do not support versions of Windows or other MS products once MS has ceased support. So please be aware of this - we will not continue to assist should other issues arrive.

At some point you will have to consider alternatives yourself as a development tool - or accept that your opportunities to offer your services have become extremely limited.

additionally VB6 is hardly the 'longest tested environment their is' - you will need to cast your net a little wider to establish just exactly what this is - there are many older candidates for this title - that predate both you and I !
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

prime clinical systems
User
Posts: 184
Joined: Sun Aug 05, 2012 5:20 pm

Re: Sample Program VB6 demonstrating PXV_Control_onEvent Declaration

Post by prime clinical systems » Thu Mar 30, 2017 9:48 am

Thanks but maybe the support for the vb IDE has ended, but never will MS stop including the VB runtimes with new versions of Windows. They know there are too many clients out there using, and runtime support is guaranteed through 2020 as of now, and rumors are that they are going to resurrect VB6, you watch, it will come back. Thanks for continuing to work on this, and further research on this subject shows how specifically VB6 never shows IUnknown, because, every single COM interface on the planet must implement that and since has always been handled automatically, that is why this is the first time, rather first control I've ever used that exposes that to VB6, explaining why not compatible, but I am looking forward to an ultimate solution, if not, looks like most of the issues can have workarounds, albeit not pretty for now, but whatever works, I'll do it. thanks again.

User avatar
Tracker Supp-Stefan
Site Admin
Posts: 13320
Joined: Mon Jan 12, 2009 8:07 am
Location: London
Contact:

Re: Sample Program VB6 demonstrating PXV_Control_onEvent Declaration

Post by Tracker Supp-Stefan » Thu Mar 30, 2017 12:21 pm

Hello Clifford,

It might be included - but this does not negate the fact that this is now almost 20 years old technology and it will not be updated. So legacy software will run, but you will still begin to experience more and more problems in the future when trying to add new SDK packages to a VB6 project!

Regards,
Stefan

prime clinical systems
User
Posts: 184
Joined: Sun Aug 05, 2012 5:20 pm

Re: Sample Program VB6 demonstrating PXV_Control_onEvent Declaration

Post by prime clinical systems » Thu Mar 30, 2017 5:32 pm

Then update your sales page to mention that no support for VB6, just be upfront about it, that's all
https://www.tracker-software.com/developers
specifically says
As an added bonus, Developers have full access to our technical staff via our Support Forums or email during their evaluation of our SDK's and extensive documentation and example applications (both compiled and source files) come included with install in a variety of the most popular Windows Development languages, including C, C++, C#, .NET, VB, Clarion for Windows and more.

So one would assume VB is supported. Look how old Clarion is as well.

ce

John - Tracker Supp
Site Admin
Posts: 8201
Joined: Tue Jun 29, 2004 10:34 am
Location: Vancouver Island - Canada
Contact:

Re: Sample Program VB6 demonstrating PXV_Control_onEvent Declaration

Post by John - Tracker Supp » Fri Mar 31, 2017 7:47 am

Well we have to concede you have found an 'old' reference to VB on our site that required changing and now has been.

This changes nothing in regards the statements that have been made previously - we are looking to see what can be done to assist - it cannot be done in a 'heart beat' - it will take some days or possibly even weeks to investigate.

And for your info with regards Clarion - the same position exists - Clarion developers have already been told and we issued a news item sometime ago stating this - but there is a difference with Clarion, its owners still develop and support Clarion themselves - it has NOT been discontinued and new versions are still being released unlike VB.

The problem with Clarion for us is that our own Development staff member retired through ill health and our sales to Clarion developer's specifically had dwindled to being so small as to be financially insignificant and it is no longer economically viable for us to support Clarion and had not been for some years.

VB on the other hand has been abandoned by MS, is no longer maintained or supported by its owner and there are significant technical issues in endeavouring to maintain support and compatibility as you and we are now finding.
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

prime clinical systems
User
Posts: 184
Joined: Sun Aug 05, 2012 5:20 pm

Re: Sample Program VB6 demonstrating PXV_Control_onEvent Declaration

Post by prime clinical systems » Fri Mar 31, 2017 8:01 am

Ok thanks John, please keep me posted and will continue with workarounds. Found that between mouse subclassing, ann hit test, and javascript,, will be able to do do most of what I could before, but I'm sure you all will find a fix for this, at least hoping, thanks
Clifford

User avatar
Tracker Supp-Stefan
Site Admin
Posts: 13320
Joined: Mon Jan 12, 2009 8:07 am
Location: London
Contact:

Re: Sample Program VB6 demonstrating PXV_Control_onEvent Declaration

Post by Tracker Supp-Stefan » Fri Mar 31, 2017 1:30 pm

Hi Clifford,

Thanks for your patience and understanding while we work on this!

Cheers,
Stefan

RMan
User
Posts: 159
Joined: Tue Jul 02, 2013 10:06 pm

Re: Sample Program VB6 demonstrating PXV_Control_onEvent Declaration

Post by RMan » Tue Apr 11, 2017 2:32 am

I just ran into a case where the pFrom as Object doesn't work so you want to define it as a Variant if you define your own wrapper for the routine.

Private Sub Editor_OnEvent(ByVal nEventID As Long, ByVal pEvent As PDFXEditCtl.IEvent, ByVal pFrom As Variant)

User avatar
Sasha - Tracker Dev Team
User
Posts: 4076
Joined: Fri Nov 21, 2014 8:27 am
Contact:

Re: Sample Program VB6 demonstrating PXV_Control_onEvent Declaration

Post by Sasha - Tracker Dev Team » Tue Apr 11, 2017 5:30 am

Hello RMan,

As far as I remember you've used the Object type with the pFrom variable. We've used cast from the 0 type and it also worked. What case have you ran into so that the Object type is not used?

Cheers,
Alex
Join us at Google+:
https://plus.google.com/+PDFXChangeEditorTS
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ

RMan
User
Posts: 159
Joined: Tue Jul 02, 2013 10:06 pm

Re: Sample Program VB6 demonstrating PXV_Control_onEvent Declaration

Post by RMan » Tue Apr 11, 2017 1:13 pm

It had to do with the comments styles changing events and would throw an error (Error=13 Type mismatch) when I was calling my wrapper function that had it defined as an Object. Most of the other events it worked fine with.

ID#=2327
Str= e.commentStylesChanged

It looks like it's defined as a VBDataObject (VarType=13) where most of the other ones are a VBObject (VarType=9)

User avatar
Sasha - Tracker Dev Team
User
Posts: 4076
Joined: Fri Nov 21, 2014 8:27 am
Contact:

Re: Sample Program VB6 demonstrating PXV_Control_onEvent Declaration

Post by Sasha - Tracker Dev Team » Tue Apr 11, 2017 1:53 pm

Hello RMan,

I see, well good that you noticed - this will be helpful for other VB6 users.

Cheers,
Alex
Join us at Google+:
https://plus.google.com/+PDFXChangeEditorTS
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ

RMan
User
Posts: 159
Joined: Tue Jul 02, 2013 10:06 pm

Re: Sample Program VB6 demonstrating PXV_Control_onEvent Declaration

Post by RMan » Tue May 09, 2017 3:16 pm

Sasha,

I see the OnEvent was not resolved in the May release. Any reason why since it should be a fairly simple declaration in the event declaration I I would think?

User avatar
Sasha - Tracker Dev Team
User
Posts: 4076
Joined: Fri Nov 21, 2014 8:27 am
Contact:

Re: Sample Program VB6 demonstrating PXV_Control_onEvent Declaration

Post by Sasha - Tracker Dev Team » Wed May 10, 2017 7:32 am

Hello RMan,

The problem is that the VB6 does not support the interfaces derived from the IUnknown correctly. This will need to be changed to the IDispatch interface so that the VB6 translation would be correct. Though this is not such a trivial task as it may seem to look to you, as there are other languages except VB6 and the developers who are using this code - we should not cause the problems to them when making this change. One of our lead devs said that they will try to fix this till the next build, though this is not a 100% guarantee.

Cheers,
Alex
Join us at Google+:
https://plus.google.com/+PDFXChangeEditorTS
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ

prime clinical systems
User
Posts: 184
Joined: Sun Aug 05, 2012 5:20 pm

Re: Sample Program VB6 demonstrating PXV_Control_onEvent Declaration

Post by prime clinical systems » Fri Jul 07, 2017 11:59 pm

Is this still being worked on? thanks
ce

User avatar
Tracker Supp-Stefan
Site Admin
Posts: 13320
Joined: Mon Jan 12, 2009 8:07 am
Location: London
Contact:

Re: Sample Program VB6 demonstrating PXV_Control_onEvent Declaration

Post by Tracker Supp-Stefan » Mon Jul 10, 2017 9:51 am

Hi Clifford,

We are currently focusing our efforts on the ribbon interface - so unfortunately the rework for VB is currently on hold.
I do not have an estimate when we could get back to this at this moment in time.

Regards,
Stefan

AndreasH
User
Posts: 3
Joined: Thu May 16, 2019 3:08 pm

Re: Sample Program VB6 demonstrating PXV_Control_onEvent Declaration

Post by AndreasH » Thu May 23, 2019 1:27 pm

Hi,
any news to the topic? I would like to use this construct to pass the pagenumber of the current page in view to my prog, or is there a better way to do this?

Greetings
Andreas

User avatar
Tracker Supp-Stefan
Site Admin
Posts: 13320
Joined: Mon Jan 12, 2009 8:07 am
Location: London
Contact:

Re: Sample Program VB6 demonstrating PXV_Control_onEvent Declaration

Post by Tracker Supp-Stefan » Thu May 23, 2019 1:48 pm

Hello Andreas,

I've just checked with a colleague in the dev team - and I am afraid that there's still no update on this one - as we've not had the time to allocate to this task yet.

Regards,
Stefan

Post Reply