473,657 Members | 2,678 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 2953
johny10151981
1,059 Top Contributor
I have faced the same problem(probabl y 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
3101
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 is invalid. The management tools are also unable to parse the configuration. The same web site, with the same configuration, is running perfectly on Vista. Is it tied to Windows Server 2008 RC1 ? Any help appreciated.
2
2933
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
6291
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. Looked at some posts about IPv6 possibly causing the problem when in stacked ipv4/ipv6 environment, but not seeing any results after un-binding ipv6 protocol. After running some tests, interaction with the DB Server is slow even
1
2525
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 on 64-bit Windows Server 2008? Q2. How and What I should arrange the development environment, for developping 32-bit C/C++ application using VS 2008 on 64-bit Windows Server 2008? Q3. I'm trying to use Virual PC for the development, is it...
2
1536
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 to 64 bit. Please help me out. Thanks a lot.
1
1487
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 and had to be registered with Microsoft Transaction Server (COM+ Manager) through COM proxies. How have things changed in Windows Server 2008? If the answer is too long for a post, if someone has a good hyperlink reference that would be...
0
1090
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 show, it will only say the application is not working and that you can search online for solutions. Does anybody knew why list and label 12 does not work in windows server 2008? But I tried on previous versions it works. Thanks for your help...
0
3216
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 "ipconfig" but it's not showing anything. After a little quest it is found that vm is not ahowing connected to the network which further on leads to the conclusion that no network drivers are installed.. hence i tried to install the network driver for...
1
3765
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
9482
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 2003,but $output is null in Windows Server 2008 R2. Done necessary settings in IIS for perl,is there additional settings in windows server 2008 R2 for perl?
0
8737
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8509
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
1
6174
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5636
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4168
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4327
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2735
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 we have to send another system
2
1967
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1730
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.