logosres: and logosref: commands

Page 1 of 1 (16 items)

This post has
15
Replies |
1
Follower

I am working on a program / app that runs in parallel with Logos and I want to keep the two in sync. So I would like to send commands to Logos to keep my resources which are indexed by scripture references focused on the right verse(s). I know I can send a command like:

logosres:niv2011;ref=BibleNIV.Romans8.28

This will open Logos, open the NIV and scroll to Romans 8:28.

I have also seen:

logosref:Bible.Ro6.4

This will open Logos, open the ESV (I'm not sure why this was the one chosen), and then scroll to Romans 6:4.

What I would like to do is send a command for Logos to scroll in whatever scripture-ref-based resources are open, including commentaries. In other words, to leave the resource unspecified and have Logos work with whatever is open (rather than opening the ESV). Is there a way to do this?

Better yet, is there a way to tell Logos to scroll a Link Set (rather than a resource)?

Ordinarily, for resources you can click on the down-arrow next to the resource icon (upper-left corner of the open resource) and choose "Copy location as: L4" in order to see the command syntax. But this obviously only works for specific resources. I know there are other possible commands (including logos4:), but they are undocumented...

This will open Logos, open the ESV (I'm not sure why this was the one chosen), and then scroll to Romans 6:4.

The command will open your preferred resource - set via Prioritize in your Library.

Todd Hoatson:

What I would like to do is send a command for Logos to scroll in whatever scripture-ref-based resources are open, including commentaries.

If a Commentary is prioritized higher than a Bible, logosref will open that commentary. But that isn't a practical use of Prioritization. Use logosres to open a commentary, because you can't specify an Open resource nor a Link Set.

Todd Hoatson:

I know there are other possible commands (including logos4:), but they are undocumented...

I am working on a program / app that runs in parallel with Logos and I want to keep the two in sync. So I would like to send commands to Logos to keep my resources which are indexed by scripture references focused on the right verse(s). I know I can send a command like:

…

What I would like to do is send a command for Logos to scroll in whatever scripture-ref-based resources are open, including commentaries. In other words, to leave the resource unspecified and have Logos work with whatever is open (rather than opening the ESV). Is there a way to do this?

I was afraid you'd say that... Using the command(s) with ShellExecuteEx() in C++ is SO much easier than using COM. It's like the difference between a heart catheterization and a heart transplant! Even MS isn't promoting COM anymore.

I already created a little test program using the COM approach in C#, and that works kinda OK (Sometimes Logos responds, sometimes it doesn't). But it's so much harder in C++, and that's the language used for the program I'm trying to modify...

Logos classes and entry points for C# & C++ are completely different?!? I used OLE View to Open LogosCOM.exe & Save As a header file. Looking at this header file, it's definitely Logos stuff, but...

* there is no Launcher to start Logos (as I had used in my C# test program) * there is no GetOpenPanels() to list the open Logos windows - there is GetWindows(), but what can I do with it??? * most functions return LPDISPATCH, which doesn't indicate what data is returned

What is the point of Logos providing an extensive (5000+ lines of code!) API if there is so little documentation for how to use it? (I know about the Logos 4 COM API on the wiki.) And how can it be so completely different between C# & C++?

I wasn't able to successfully save as a header file with OLEView, but the TypeLib in LogosCOM.exe looks (to me) exactly like the Logos 4 COM API documented on the wiki. (I think it has to be, in order to marshal the COM interfaces between processes properly.)

Specifically, I do see a Launcher, I do see GetOpenPanels, I don't see GetWindows; I don't see any of the changes you describe.

So far, so good. This starts Logos. Now I can move forward to use the application pointer to issue commands, just as I did with C#. This code is not terribly complicated; I wish Logos / Faithlife would have provided a sample like this for us C++ users. It was quite difficult finding information about how to set this up...

One other point I should mention for completeness (maybe this will end up on the Logos 4 COM API page someday?)...

the ILogosLauncherPtr is a smart pointer, so when the launcher variable goes away (i.e. its deconstructor is called, as would happen automatically when the variable goes out of scope), the smart pointer's usage counter is decremented, and when it gets to 0, the COM object is released. So the code calls CoCreateInstance(), but there is no corresponding call to destroy that instance. It's handled automatically (at least, that's what I've been told should happen).

OnPositionInLibronixChanged is the name of a method in my program that my program asks Logos to call whenever there is a change in the biblical reference for a resource.

I believe this code is working. But when I try to translate this to C++, I get a MAJOR PROBLEM!

When I search the include file which is automatically generated from the type library by the #import statement, I don't find any references to ILogosPositionHandler or LibronixPositionHandler(). In fact, I don't find any occurrences of either Position or Handler in the .tlh file. Shouldn't the Logos COM API be the same, regardless of the language using it???

// make sure we have a Logos Launcher object if (m_pLauncher == NULL) m_bHaveLogos = GetLogosLauncher();

// if we have a Logos Launcher object, the COM object is operational if (m_pLauncher != NULL) { Logos4Lib::ILogosApplicationEvents eventSource; CEventReceiver eventReceiver;

eventReceiver.hookEvent(&eventSource); }

I get the following error message when compiling:

"usage of ATL attributes is deprecated" with regard to: [event_receiver(native)]

" 'Logos4Lib::ILogosApplicationEvents::PanelChanged': could not resolve event note: There are no events: note: 'HRESULT Logos4Lib::ILogosApplicationEvents::PanelChanged(IDispatch *,IDispatch *)': is not an event" with regard to: __hook(&Logos4Lib::ILogosApplicationEvents::PanelChanged, pEventSource, &CEventReceiver::OnLogosPanelChanged);

Sorry, it's been probably 10 years since I did COM event handling in C++, and I remember very little of it. I never used these ATL helpers; IIRC we used IConnectionPointContainer::FindConnectionPoint and IConnectionPoint::Advise. Presumably these ATL attributes do the same thing under the hood, but maybe dropping down to the lower-level interfaces will help pinpoint the problem.