1. Daniel Vivier
  2. PowerBuilder
  3. Thursday, 16 June 2022 15:34 PM UTC

Has anyone successfully integrated a PowerBuilder app with the QuickBooks Desktop API, preferably using the QBFC (QuickBooks Foundation Classes)? It's all done through COM, which ought to be relatively easy in PB.

The place I'm stuck is in finding out how to access constants needed as function arguments. For instance, after creating a QBFC15.QBSessionManager object with ConnectToNewObject, I need to call a function OpenConnection2 on it, and one of the arguments is supposed to be values such as ctLocalQBD (which also shows as ENConnectionType.ctLocalQBD in their docs). How do I get that ENConnectionType object? I don't see it in the PB Object Browser, nor do I see any further details about in their docs.

And if you have an answer to that, any other helpful hints on things that won't be clear about how it works from PB, despite a careful reading of their API docs?

Thanks.

Daniel Vivier Accepted Answer Pending Moderation
  1. Thursday, 16 June 2022 16:07 PM UTC
  2. PowerBuilder
  3. # 1

OK I have solved at least how to get those constant values. I used OleView.exe (from the Windows SDK), and use its menu option File -> View TypeLib.

The relevant typelib is the QBFC15.dll that the objects are in (which on my PC is in C:\Program Files (x86)\Common Files\Intuit\QuickBooks). That gives a full list of the enum interfaces, objects and methods.

So for instance from the list I can find an entry for typedef enum ENConnectionType, and if I click on that, I see the values, for instance ctLocalQBD = 1. So I can just use that value, or define it as a constant in some script (constant int ctLocalQBD = 1).

There's no search feature in that window, so to get that, you can use the TypeLib viewer's File -> Save As menu option, save it as an IDL file, and open that in a text editor.

Comment
  1. John Fauss
  2. Thursday, 16 June 2022 16:21 PM UTC
Thank you for sharing this technique, Dan! This could be extremely helpful to someone in a situation similar to yours.
  1. Helpful 1
  1. Armeen Mazda @Appeon
  2. Thursday, 16 June 2022 16:31 PM UTC
Thanks Dan for sharing!
  1. Helpful
There are no comments made yet.
  • Page :
  • 1


There are no replies made for this question yet.
However, you are not allowed to reply to this question.