0

I am upgrading an application, using a Brother label printer, from VB6 to VB 2008 Express on a Windows 7 x64 machine.

The examples that Brother gives for using its library are as follows (simplified):

    Dim objDoc As bpac.Document
    objDoc = CreateObject("bpac.Document")

    Dim doc As bpac.DocumentClass
    doc = New bpac.DocumentClass

In my application (automatically converted to VB 2008) the first example fails, when creating the instance, with "Cannot create ActiveX component" and in the second example "Error 80040154 retrieving COM class factory)

Now when I build a fresh application on the same PC with just the above code isolated I don't get any errors.

I realise there must be some difference in the applications' environment parameters, probably coming from the upgrade procedure but I can't see any. I have read that this sort of problem can happen with the wrong Target Platform, but both are "Any CPU" (I can't modify this in Express anyway).

I know this is a recurring question, but other answers don't seem to apply in this case, particular to the VB 2008 environment.

Thanks for any help and for bearing with a newbie to VB.NET

Kev

KevKp K
  • 1
  • 1

1 Answers1

0

Have you checked this Stackoverflow article out? How to repair COMException error 80040154?. I would also be trying a newer free-version of Visual Studio, like Visual Studio 2013 Community edition. Also, VS 2015 Community edition is due out in a week or so.

Community
  • 1
  • 1
joehanna
  • 1,471
  • 1
  • 11
  • 22