3

I have a very simple application that connects to QuickBooks, runs a customer query, then disconnects. In my dev environment (Windows 7, x64) everything works as expected. When spinning up a fresh VM (again with Windows 7, x64), I get a COM exception with HRESULT 80040154. This error has been reproduced on various other machines, but I've also had success on various other machines. I can't seem to find the common denominator here. I've ensured QBFC is installed and my assemblies are all compiled targeting the x86 platform.

Here is my connection code. The COM exception throws when I try to create an instance of QBSessionManager.

QBSessionManager qbs = new QBSessionManager();
IMsgSetRequest requests = qbs.CreateMsgSetRequest("US", 8, 0);
requests.Attributes.OnError = ENRqOnError.roeContinue;

qbs.OpenConnection2("Application Name", "Application Name", ENConnectionType.ctLocalQBD);
qbs.BeginSession(string.Empty, ENOpenMode.omDontCare);

Any ideas? This is my first QB SDK application, so please let me know if I've perhaps missed an obvious step.

Josh Johnson
  • 135
  • 2
  • 14
  • [How to repair COMException error 80040154](http://stackoverflow.com/q/7197506). Does this help? – dtb Oct 07 '13 at 13:50
  • Here's another one: [Error 80040154 (Class not registered exception)](http://stackoverflow.com/q/4021796) – dtb Oct 07 '13 at 13:53
  • The QBFC installer registers the COM component for us. I can also connect to QuickBooks successfully using Intuit's SDK Tester utility, so I think the problem is on my end and not due to the way the COM component is registered. Thanks for the response! – Josh Johnson Oct 07 '13 at 14:24
  • Related http://stackoverflow.com/questions/8341637/connecting-to-quickbooks-desktop – Chris Moschini Jan 23 '15 at 20:03

1 Answers1

1

This was resolved by installing QBFC11. Even though my project references QBFC12, it is apparent that QBFC11 must also be installed for the connection to succeed. I will chalk this up to inexperience with the QuickBooks SDK on my end.

Josh Johnson
  • 135
  • 2
  • 14