473,503 Members | 10,660 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Problem with printing Barcode on cognitive HCLabel printer from Windows server 2008

7 New Member
I am trying to print a barcode form HClabel printer through my application running on Windows server 2008. The printer is a ntwork printer connected to a Windows 7 Machine.

The code to access the printer and proceed with printing is in VC++. The code has been working fine since years and it still works when I try to print from Windows XP machine(Connect and print on the same printer connected to WIndows 7 machine mentioned above).

The error code I receive when tried to print from windows server 2008 is 2 which says File not found. But when i access the machine from windows server 2008, it is accessible.

Below is the code I use:

Expand|Select|Wrap|Line Numbers
  1. if( m_hPrinter != NULL )
  2.         EndWriter();
  3.  
  4.     m_hPrinter = ::CreateFile(lpPrinterName,GENERIC_WRITE, FILE_SHARE_WRITE, NULL, OPEN_EXISTING, 0, NULL );
  5.  
  6.     if( m_hPrinter == INVALID_HANDLE_VALUE )   
  7.     {
  8.         CString strErrMsg = "";
  9.         strErrMsg.Format("Could not open file %s(error %d) - CreateFile returned invalid handle",lpPrinterName, GetLastError());
  10.         MessageBox(NULL,strErrMsg,"Error Info",1);
  11.         printf("Could not open file %s(error %d)\n - CreateFile returned invalid handle", lpPrinterName, GetLastError());
  12.     }
  13.  
Please suggest what might be causing this to failonly on the new operating system I use(Windows server 2008)
Oct 10 '12 #1
4 2934
johny10151981
1,059 Top Contributor
I have faced the same problem(probably same) with NEC MultiImpact 700JC.

You must have to have Driver supported for your operating system.
Oct 10 '12 #2
DivyaNagarajan
7 New Member
Thank you for the reply johny10151981.

The printer prints fine when I print it from Xp machine.
The situation is this : The printer is connected to Windows 7 machine. My application runs on Windows server 2008 and accesses this printer through network and that is when it fails.
When i access the printer through my application from Xp machine, it prints fine.
If it was the driver that is causing the problem it should not have worked when accessed from Xp machine as well right?
Oct 10 '12 #3
johny10151981
1,059 Top Contributor
Driver conflict or problem is with windows 8. Windows 8 need the driver
Oct 10 '12 #4
DivyaNagarajan
7 New Member
Did you mean the problem is with Windows 7?
Can you please explain how is the printer working when accessed from Xp machine though driver is causing the issue?

i am wondering of how is the same driver working fine when given a print from XP machine. Is driver dependent on the machine from where the print command is coming in??!!
Oct 10 '12 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

3
3094
by: =?Utf-8?B?T2xpdmllciBNQVRST1Q=?= | last post by:
I'm trying to run an ASP.NET 2.0 web site on Windows Server 2008 RC1. I encounter a server error : HTTP 500.19 - Configuration data is invalid IIS7 claims that the <appSettingssection in web.config...
2
2921
by: Odd B Andersen | last post by:
Does DB2 support Windows Server 2008? In the Information Center for 9.5 I only find mentioned Windows Server 2003 and Windows Vista. -- Regards Odd Bjørn Andersen ErgoGroup AS
1
6285
by: GatorDBA | last post by:
Hey Folks, Experiencing strange problem with SQL 2005 running on Windows Server 2008. When trying to connect via named pipes or tcp, it takes 25-45 seconds for the connection to be established....
1
2509
by: =?Utf-8?B?bWFzYWtpeQ==?= | last post by:
Hello, I'm trying to develop 32-bit Windows Native C/C++ application using Visual Studio 2008, on 64-bit Windows Server 2008. Q1. Is it possible to develop 32-bit C/C++ application using VS 2008...
2
1515
by: Michael Richard | last post by:
Hi, I need a help from you. I'm writing device driver for 64 bit Windows Server 2008. I have code for 32 bit Windows Server 2008, its working fine on 32 bit. I need a help to port from 32 bit...
1
1480
by: JDeats | last post by:
It's been a few years since I worked with transaction based components, last time I was involved in an enterprise project requiring transactions my .NET .DLLs were dervived from ServicedComponent...
0
1076
by: Fernan MC | last post by:
Hi, I am making a program using vb 2005 and using list and label 12 for the reports. I compiled the program and installed it in windows server 2008 but unfortunately the list and label will not...
0
3212
by: madankarmukta | last post by:
Hi All, I am facing problem while configuring new ip address for my newly configured virtual machine on the vmware.I set the ip address using netsh uility. but when I want to confirm it with...
1
3748
by: =?Utf-8?B?QW50amU=?= | last post by:
I need product keys for Terminal Server Windows Server 2008 access (CALs) under MSDN - TSLM Service said they cannot provide product keys for the access.
8
9467
by: Mangala Amargol | last post by:
For example,runnig "ipconfig" command through perl script and printing it on web browser. my $cmd = "ipconfig"; my $output = `$cmd`; print $output; Above code works fine in Windows Server...
0
7207
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7294
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7361
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
7015
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
5602
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
5026
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
3173
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1523
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
749
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.