Ole And Com Errors Follow

0
Avatar
Legacy Poster

We have an application that uses Seagull.BarTender.Print.Engine to print .btw label files. The application works almost perfectly. It runs continuously for weeks at a time, printing thousands of labels.

However, occasionally it happens that our application fails to print the requested labels, our error logs show OLE and COM errors (details below), and the Windows shell (Explorer) becomes unresponsive. The solution is to kill explorer.exe in Task Manager, then shut down and restart our application.

Here are the error messages:

[code]-------------------------------------------------------------------------------
DateTime: 26-Jul-2012 20:56:56
Error OLE received a packet with an invalid header. (Exception from HRESULT: 0x80010111)

-------------------------------------------------------------------------------
DateTime: 26-Jul-2012 20:58:47
Error COM object that has been separated from its underlying RCW cannot be used.
[/code]

I'm pretty sure these happen when the LabelFormatDocument is created (by Engine.Documents.Open(path)).

Any ideas?

7 comments

0
Avatar
Ian Cummings
Moderator
Comment actions Permalink

It sounds like the bartend.exe process is hanging up for some reason.

What is the edition, version and build of BarTender in use?

Does the program that controls BarTender run as an application or service?

What version of Windows is this running upon?

Does BarTender print with Seagull printer drivers and if so what version of driver is in use.

When you check the Windows task manager are there multiple bartend.exe processes, or just the one that your program spawned?
0
Avatar
Legacy Poster
Comment actions Permalink

[quote name='Ian C - Seagull Support' timestamp='1343642011' post='2983']
It sounds like the bartend.exe process is hanging up for some reason.

What is the edition, version and build of BarTender in use?
[/quote]
The application was built with:
Edition: Automation, Version: 9.3, Build: 2704.

So the bartend.exe which the application is installing is 9.30.2704.2652.

However, the full-blown BarTender which the customer has installed, and which was used to create the .btw files, is:
Edition: Enterprise Automation, Version 9.4 SR3, Build 2781.

When my application creates an instance of a Seagull.BarTender.Print.Engine, and then gets the Engine's .Edition, .FullVersion, and .BuildNumber, it is getting the Version 9.4 info, not the info from the bartend.exe which I'm installing.

[quote name='Ian C - Seagull Support' timestamp='1343642011' post='2983']
Does the program that controls BarTender run as an application or service?
[/quote]
It runs as an application.

[quote name='Ian C - Seagull Support' timestamp='1343642011' post='2983']
What version of Windows is this running upon?
[/quote]
Windows 7 - Build 7601 (Service Pack 1)

[quote name='Ian C - Seagull Support' timestamp='1343642011' post='2983']
Does BarTender print with Seagull printer drivers and if so what version of driver is in use.
[/quote]
Some of the printers are using Seagull drivers.
Zebra ZPL-II Driver, 7.3, x64

[quote name='Ian C - Seagull Support' timestamp='1343642011' post='2983']
When you check the Windows task manager are there multiple bartend.exe processes, or just the one that your program spawned?
[/quote]
Our program spawns one bartend.exe per printer. So there were likely 2 or 3 bartend.exe's running.
0
Avatar
Legacy Poster
Comment actions Permalink

We have now also seen these same OLE and COM errors in a case where we did not need to kill explorer.exe. So it appears that that is a separate issue.
0
Avatar
Legacy Poster
Comment actions Permalink

Questions for Seagull:
Do you know what causes these OLE and COM errors?
Is it okay for me to build an .exe with 9.3, and ship to a customer with 9.4 installed?
0
Avatar
Ian Cummings
Moderator
Comment actions Permalink

Please find below some questions and answers from our development department which I hope will cover all your queries.

Questions:
1. Will any .NET SDK application (the executable file) developed with an older version of BarTender run with a newer version of BarTender?
2. What about the Visual Studio project? Will any .NET SDK project from no matter which version of BarTender (starting at BT v9.01) be compatible with a different version of BarTender?
3. Also, since BT v9.30 the .NET SDK component is now strong named. Will this strong named property not imply that you specify the target version in your project and would this not cause incompatibility issues when trying to open (or run) this project with a different version of BarTender?
4. Finally, in BarTender v9.40 we now put the SDL dll's in the GAC as well as keeping a "redirection assembly". If you develop a project in BarTender v9.3 and now run it with v9.4, will it work thanks to this "redirection assembly"?

Answers:
1. In 99% of cases, yes. However, there are some things to be aware of:
• If they compile the application against BarTender 9.00-9.30, they have to include a copy of all of the SDK DLL's in their application directory.
• If they compile the application against 9.40 or later, it should "just work" on any system that uses the version they compiled it against, or later. They do not need to copy these DLL's into their directory, and in fact they'd be ignored anyway. This is pretty common in .NET development and not specific to our SDK.
2. Since we strong-named (v9.30) the component, it will be bound against the version of BarTender they used to develop it. If they upgrade BarTender on their development PC, they may need to remove and re-add the references to the SDK in their project.
3. No, actually, it does not. Here is why:
• In 9.3, the assembly was strong-named, but not in the GAC. Therefore, you still needed to distribute the SDK assembly with your application. While it is true your application is bound against one specific version of the SDK, the SDK itself only uses BarTender's ActiveX interface, which does not enforce version checking of any kind. So the 9.30 SDK assemblies included with your app will talk to BarTender 9.40.
• In 9.4 and later, the assembly was strong-named and in the GAC. The situation is more complex, because the SDK no longer relies only on BarTender, it now links with Librarian, the system database, and many other BarTender .NET assemblies. This was the main reason for the change, otherwise people need to deploy a large number of DLL's. However, by adding these assembly redirects, we allow substitutions, so that for example, an application bound to 9.4 SR1 will work with 9.40 SR2.
• We don't support going backwards. In 9.30 and earlier, since you copied the DLL's around with the application, nothing stopped you from developing in 9.3 and using it with BarTender 9.1. (It might crash if you use something that didn't exist in 9.1.) Since 9.4, that is no longer possible, and we want it that way.
4. No. A project developed in 9.30 will work in 9.40 because you needed to copy the SDK assemblies into your "bin" directory. The redirection assembly only applies to 9.40 and higher, and allows applications developed with 9.40 to work with 9.40 SR1, SR2, SR3, and following versions etc.
Basically, you must develop your application using the lowest version of BarTender you plan to support. That application should then work with later versions. It will not work with earlier versions.”
0
Avatar
Legacy Poster
Comment actions Permalink

Questions for Seagull:

Do you know what causes these OLE and COM errors?
Is there anything I can do to recover from this situation?
Would it be better if my application was running as a Service?
0
Avatar
Legacy Poster
Comment actions Permalink

Maybe this relates to my problem: Used Bartender Automation 9.3 SR1 Build 2715 SDK for an application with Visual Studio 2010 VB.net. The app shows thumbnails of labels (using Seagull.BarTender.Print.LabelFormatThumbnail.Create()). As long as the vb app is installed in users' PCs with Windows 7 (32 or 64-Bit) with Bartender 9.3 or 9.4 Automation version installed (the 2 versions we mainly use) it is able to show the thumbnails Ok. If I install the same applicatoin (compiled with the 9.3 SDK) in any PC with Windows 7 (32 or 64-Bit) that has Bartender Automation 10.0 SR4 Build 2868 (the latest version we are trying) the thumbnails do not work, instead I get the following exception:

 

Seagull.BarTender.Print.LabelFormatThumbnailException:
Seagull.BarTender.Print.LabelFormatThumbnailException: Unable to export label
format thumbnail image. BarTender may need to be reinstalled. --->
System.Runtime.InteropServices.COMException: Retrieving the COM class factory
for component with CLSID {D644CE25-129C-4FD0-BE79-2A0E0C91B8C5} failed due to
the following error: 80040154 Class not registered (Exception from HRESULT:
0x80040154 (REGDB_E_CLASSNOTREG)).

 

   at
Seagull.BarTender.Print.LabelFormatThumbnail.Create(String formatFileName,
Color backgroundColor, Int32 width, Int32 height)

 

1- Any ideas of what to do to correct this problem?

2- Can you please write the definate/clear steps ofr adding the SDK references & DLLs to a Visual Studio solution if using Bartender 9.3 SR1 Build 2715? Please include details of what DLLs one has to add to the project references with applicable settings details (Copy Local, Embed Interop Types, etc) and to the Project itself with applicable settings details (Build Action, Copy to Output Directory, etc).

 

Thank you
 

Please sign in to leave a comment.