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: 190
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: 4089
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: 190
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: 4089
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: 190
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: 13376
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: 168
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: 13376
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: 168
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: 190
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: 190
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: 168
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: 190
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: 8202
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: 190
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: 13376
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: 190
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: 8202
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: 190
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: 13376
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: 168
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: 4089
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: 168
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: 4089
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: 168
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: 4089
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: 190
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: 13376
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: 13376
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

Dorwol
User
Posts: 278
Joined: Mon Aug 04, 2008 5:04 pm

Re: Sample Program VB6 demonstrating PXV_Control_onEvent Declaration

Post by Dorwol » Tue Aug 13, 2019 9:31 pm

Unfortunately, OnEvent still doesn't work AND VB crashes after every second start. Please fix it, because I wanted to buy the SDK today. I still use the old ViewerAX - works perfectly, but I need the editing function.

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

Re: Sample Program VB6 demonstrating PXV_Control_onEvent Declaration

Post by prime clinical systems » Tue Aug 13, 2019 10:16 pm

Hi as one of the reporters of this issue, I can assure you crashing every second time in VB is not fixable, that is what I have put up with as well, you have to load the project again, the only saving grace is that no crashes in production compiled version, and if you need to test events, can't do that in IDE, have to compile every time, and add logging routine to the events to see which are firing and results of your work. Good luck, I complained all I could as well, as I did not figure this out until after paying, but there is no other solution as powerful, so keep up the work. If you notice, Tracker removed the wording about this editor working with VB, so they no longer support with VB either, as they have no plans to fix the event.

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

Re: Sample Program VB6 demonstrating PXV_Control_onEvent Declaration

Post by RMan » Tue Aug 13, 2019 10:25 pm

You can get it to work with a couple workarounds that I talked about earlier in this post. I imagine it's not as simple as we think to redefine the event it to work with VB6 and yet still work with everything else and not cause problems with everyone else already using the SDK in other languages.

Here's the basics again.

1.) You have to compile it and run the exe, never run it in debug mode or from the VB6 Editor.

2.) When you reopen the project you need to double click on the control and then add a new event for the OnEvent and delete out the old one. I created my own PDFEditorOnEvent function that I call so I only need to copy 2 lines of code into the new event it drops in.

Code: Select all

Private Sub PDFEditor_OnEvent(ByVal nEventID As Long, ByVal pEvent As PDFXEditCtl.IEvent, ByVal pFrom As 0)
    'Copy these 2 lines of text in everytime you recreate the event
     On Error Resume Next
    Call PDFEditorOnEvent(nEventID, pEvent, pFrom)
End Sub

'And the sub I created to handle everything
Private Sub PDFEditorOnEvent(ByVal nEventID As Long, ByVal pEvent As PDFXEditCtl.IEvent, ByVal pFrom As Variant)
    On Error Resume Next
End Sub
If you ever need to use the pFrom value you just define the object type it should be and set it to it.
Dim ps As IUIX_PropSheets
Set ps = pFrom

Also here's a quick VB6 sample program I did years ago. It should still work if you redefine the event and recompile it.
viewtopic.php?f=66&t=27757&p=111690#p111690

Hope this helps.

User avatar
Sasha - Tracker Dev Team
User
Posts: 4089
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 Aug 14, 2019 6:46 am

Thanks for your reply RMan.

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

Dorwol
User
Posts: 278
Joined: Mon Aug 04, 2008 5:04 pm

Re: Sample Program VB6 demonstrating PXV_Control_onEvent Declaration

Post by Dorwol » Wed Aug 14, 2019 9:08 am

OMG, that's horror! I can't write a complex application without many tests in IDE. Also, if a customer inform us about a bug, I need to debug the code. :oops: :cry:

@TrackerTeam
You wrote me before, that this new control will work with VB6. Did you plan to fix this both (certainly small) problems? Because absolutely all other functions works like a charme and the "OnEvent" seem to be the same like your old ViewerAX.

Your old one:

Private Sub oPDFCtrl_OnEvent(ByVal nType As Long, ByVal Name As String, ByVal DataIn As Variant, DataOut As Variant, ByVal Flags As Long)

So why isn't possible to spend a little VB6-Frame, like this
https://imgur.com/F9RDaXk

This working solution also uses Codejock for compatibility of his components with MS Access. Which means that your component can be used even in VBA. And of course, VBA is definitely still alive!

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

Re: Sample Program VB6 demonstrating PXV_Control_onEvent Declaration

Post by prime clinical systems » Wed Aug 14, 2019 4:20 pm

It is not that hard, you can debug your whole program and run in IDE without events from PDF control, just comment out the event declaration

'Private Sub PDFC_OnEvent(ByVal nEventID As Long, ByVal pEvent As PDFXEditCtl.IEvent, ByVal pFrom As 0)
'Call PDFModule.Editor_OnEvent(nEventID, pEvent, pFrom)
'End Sub

then the rest will run just fine, and you can do a lot without using events, just don't listen to save, close doc events, and then in the program when compiled, just add error handler to the events with line numbers, and you will easily find which line caused the error. The old control all events fired, and you had to handle them to prevent popup of save dialogs etc,

Also in the events this code is most valuable, as at times you must get object from pointer, and I found this code which without would made the control worthless.

Function ObjFromPtr(ByVal pObj As Long) As Object
Dim obj As Object
' force the value of the pointer into the temporary object variable
CopyMemory obj, pObj, 4
' assign to the result (this increments the ref counter)
Set ObjFromPtr = obj
' manually destroy the temporary object variable
' (if you omit this step you'll get a GPF!)
CopyMemory obj, 0&, 4
End Function

User avatar
Tracker Supp-Stefan
Site Admin
Posts: 13376
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 Aug 15, 2019 11:26 am

Hi All,

Many thanks for the help @prime clinical systems!
Hope that would be useful @Dorwol!?

Regards,
Stefan

Dorwol
User
Posts: 278
Joined: Mon Aug 04, 2008 5:04 pm

Re: Sample Program VB6 demonstrating PXV_Control_onEvent Declaration

Post by Dorwol » Thu Aug 15, 2019 11:46 am

No isnt, because our company can't sell any product on the market without official Support from the component-producer. For any upcoming problem, you could claim protection that your component does't support VB6.

That's too risky, unprofessional and negligent. We don't develop in-house solutions, only products for customers. One could even sue us for further problems (in future updates of your component).

So please allow me to repeat my seriously aked question:

"You wrote me before, that this new control will work with VB6. Did you plan to fix this both (certainly small) problems?"

We must make sure to have a professional partner by our side. :?

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

Re: Sample Program VB6 demonstrating PXV_Control_onEvent Declaration

Post by RMan » Thu Aug 15, 2019 12:54 pm

As the other 2 of us apparently still using VB6 also have pointed out it VERY MUCH DOES work with VB6. At least they have still created something that will work with VB6 unlike most other companies today.

While I don't agree with Tracker's decision to never fully fix the onEvent call for VB6 users, give a second onEventVB call, or fix other minor incompatibilities with VB6 it appears from the posts that there are only a few of us actively using VB6 and hence as a business owner I see that there are more important fires to fight for a greater number of users. I myself gave up asking for it to be fixed years ago and concentrated on more important things since I had a workaround.

With a few minor workarounds that once you get used to them they are not a big deal. For various reasons I haven't debugged in the VB6 IDE in over a decade. We have our own debug routines built in that have always worked better for us and allows us to debug on a compiled version on an end users machine if needed. It's so second nature now to add in the new even when I open a project that I don't even think about it and it only takes me a few seconds once a day.

Even though I think VB6 is one of the greatest programming languages ever written it hasn't been updated in over a decade and the last official release of the development side (IDE) was almost 2 decades ago by now.

Also note that Tracker has already announced that this Version 8 will be the last one that they will provide an SDK for developers meaning you only have a 3 or 5 year window of support likely.

Again I don't like it but as a business owner I understand the economic reasons for it and I thank the entire Tracker team for what at that time will be around 25 years that they have provided amazing SDK's and printer drivers for us to use to create an amazing product for our niche market that our users absolutely love.

John - Tracker Supp
Site Admin
Posts: 8202
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 Aug 15, 2019 3:07 pm

Thanks for your comments and additions RMAN - which are very much appreciated,

For other reader's and contributor's I must reiterate - that we will not be doing any further work to provide VB compatibility or additions.

This is not just an arbitrary position - but made ever more difficult if not impossible to even contemplate as MS have moved on and many many things have altered with MS's own tools to make such support virtually impossible.

The latest releases of MS Visual Studios do nothing to enhance compatibility to older versions of Windows even - let alone VB6 and other older development tools.


On a slightly more positive note - we may have found a method to allow us to continue to provide our SDK's going forward and may well review this decision in the coming months.

Being blunt - it was not simply an economic decision, but one based on serious issues we are having with developer's in the far east using our SDK's in a manner completely outside of the terms and conditions of the SDK Licensing - without any ability to pursue legal recourse to block such use as country's like China operate outside of accepted western norm's and accepted practices and make it all but impossible for companies outside of China to seek satisfaction and redress when the laws are abused by its citizens.

For that reason we all but refuse to sell our SDKL products to developers from a number of Asian countries.

I hope to post further on this in the coming months as we make progress.

Thank you for you understanding.
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

Dorwol
User
Posts: 278
Joined: Mon Aug 04, 2008 5:04 pm

Re: Sample Program VB6 demonstrating PXV_Control_onEvent Declaration

Post by Dorwol » Thu Aug 15, 2019 3:21 pm

John - Tracker Supp wrote:
Thu Aug 15, 2019 3:07 pm
On a slightly more positive note - we may have found a method to allow us to continue to provide our SDK's going forward and may well review this decision in the coming months.

Being blunt - it was not simply an economic decision, but one based on serious issues we are having with developer's in the far east using our SDK's in a manner completely outside of the terms and conditions of the SDK Licensing - without any ability to pursue legal recourse to block such use as country's like china operate outside of accepted western norm's and accepted practices and make it all but impossible for companies outside of China to seek satisfaction and redress when the laws are abused by its citizens.
Many thanks for these consistently open words. We appreciate that and will return to your website some months later. Maybe there will be some positive news.

However, VB(A) isn't dead. It's still included in MS Office 2019. ActiveX thus lives on unchanged. Of course every VB developer would switch to VB.NET or C # (we have also implemented projects in C #). But WinForms is already dead (Or are you planning a WPF component? ) and .NET is generally a cramp and not a developer framework. .NET is a big clumsy elephant, nothing more!

VB4ever! :D

Post Reply