Quick VB6 Sample and String Finder

PDF-XChange Editor SDK for Developers

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

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
RMan
User
Posts: 221
Joined: Tue Jul 02, 2013 10:06 pm

Quick VB6 Sample and String Finder

Post by RMan »

I've been working on upgrading some legacy VB6 code from the old Viewer to the Editor so I created a basic sample that others might find helpful.

I also compiled up the VB sample in this for other to use because it has routines to list the various strings for commands, commandbars, menus, tools, and so on for users to help migrate up from the Viewer. I've found the Find Text in List helpful to search for the strings I need for the various tools, cmd, and properties.
Attachments
PDF-XChangeEditorSample-V1.zip
(93.74 KiB) Downloaded 119 times
Sasha - Tracker Dev Team
User
Posts: 5522
Joined: Fri Nov 21, 2014 8:27 am
Contact:

Re: Quick VB6 Sample and String Finder

Post by Sasha - Tracker Dev Team »

Hello RMan,

Thank you very much for the sample. We will check it out and will publish it on our Git page.

Cheers,
Alex
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
prime clinical systems
User
Posts: 211
Joined: Sun Aug 05, 2012 5:20 pm

Re: Quick VB6 Sample and String Finder

Post by prime clinical systems »

Thanks a lot for this, huge help. Still have problem though that cannot load user settings from file. does nothing, doesn't throw any error, not sure if any suggestions on how to remedy this perhaps registry in the only option?

Call PDF.Inst.LoadUserSettings(PDF.Inst.CreateString(App.Path & "\PCMPDFSettingsEditMode.xcs"), 0)
RMan
User
Posts: 221
Joined: Tue Jul 02, 2013 10:06 pm

Re: Quick VB6 Sample and String Finder

Post by RMan »

Try defining it as a PDFXEditCtl.IString and leave off the optional parameter. Here's what I'm using to load it from the Registry.

Dim oString As PDFXEditCtl.IString
Set oString = PDFEditor.Inst.CreateString("HKCU\" & g_sRegistryTrackerCtrlSettings)
Call PDFEditor.Inst.LoadUserSettings(oString)
RMan
User
Posts: 221
Joined: Tue Jul 02, 2013 10:06 pm

Re: Quick VB6 Sample and String Finder

Post by RMan »

Also it might have to be the newer .xces type of file. Try renaming it as .xces and loading that into the Editor first and resaving it. But I seam to remember a couple functions where I had to define the parameters first instead of calling them inline like you were doing.
prime clinical systems
User
Posts: 211
Joined: Sun Aug 05, 2012 5:20 pm

Re: Quick VB6 Sample and String Finder

Post by prime clinical systems »

yes this function only works I found for the setting.dat, registry type file, the exported xcs file has to use the import settings command, more difficult, still learning the interfaces, as the example in C# is easy and works fine, but no issue now, just using your registry example
prime clinical systems
User
Posts: 211
Joined: Sun Aug 05, 2012 5:20 pm

Re: Quick VB6 Sample and String Finder

Post by prime clinical systems »

Hi RMAN, any chance you could explain how you got the editor to handle events in VB6, I am unclear by your example. Thanks
RMan
User
Posts: 221
Joined: Tue Jul 02, 2013 10:06 pm

Re: Quick VB6 Sample and String Finder

Post by RMan »

I don't think I've really had to use callbacks yet. I've been off this for a bit so I'll try to jump back on it and take a look. If you don't have to do anything with the callback you might be able to just pass Nothing to it or define a VB Class Module and set it to that. In the test project I have a class module I was working on for the bookmarks pane but I never got it to work yet. But here's what I had so far.

Is this for the settings or exactly what are you trying to do?
User avatar
Tracker Supp-Stefan
Site Admin
Posts: 17929
Joined: Mon Jan 12, 2009 8:07 am
Location: London
Contact:

Re: Quick VB6 Sample and String Finder

Post by Tracker Supp-Stefan »

Hi RMan,

It seems like the main discussion on this subject is now in the other topic:
https://forum.pdf-xchange.com/ ... 66&t=28826
So If you don't mind - lets continue the discussion there.

Cheers,
Stefan
Post Reply