Retrieving the COM class factory for component 80040154 Class not registered - DLL is definitely in registry and app is using x86


I'm trying to integrate a Brother QL-700 label printer into a C# application that I'm writing. I've created a console application to test the printer with and added the following code (taken from the SDK on the Brother website):

class Program
    private const string TEMPLATE_DIRECTORY = @"c:\program files\brother bpac3 sdk\templates\";
    private const string TEMPLATE_FRAME = @"NamePlate2.LBX";

    static void Main(string[] args)
        string templatePath = TEMPLATE_DIRECTORY;
        templatePath += TEMPLATE_FRAME;

        IDocument doc = new bpac.Document();

        if (doc.Open(templatePath) != false)
            doc.GetObject("objCompany").Text = "Company";
            doc.GetObject("objName").Text = "Your name here...";

            doc.StartPrint("", PrintOptionConstants.bpoDefault);
            doc.PrintOut(1, PrintOptionConstants.bpoDefault);
            Console.WriteLine("Open() error: " + doc.ErrorCode);


The application stops on the line where I create a new instance of bpac.Document and it throws the following error message:

System.Runtime.InteropServices.COMException: 'Retrieving the COM class factory for component with CLSID {B940C105-7F01-46FE-BF41-E040B9BDA83D} failed due to the following error: 80040154 Class not registered (Exception from HRESULT: 0x80040154 (REGDB_E_CLASSNOTREG)).'

There are several other posts on Stack Overflow about this issue and I have tried some of the commonly suggested fixes:

  1. The DLL in question is definitely in the Windows registry
  2. I have changed the application architecture on the console application to x86

I'm still unable to make any progress. Does anyone else have any other ideas?

asked on Stack Overflow Apr 10, 2018 by markp3rry

0 Answers

Nobody has answered this question yet.

User contributions licensed under CC BY-SA 3.0