473,500 Members | 1,748 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Having issues with setjob api

Here is what I am trying to do. I have written a working program in VB6 that monitors any number of printers simultaneously(sort of). Because VB6 doesn't support multithreading I have to do this with a timers and loops which eats up CPU power and has other inefficiencies. I am slowly converting it over to C# with major revisions. Instead of using a timer or loop I am going to have a different thread for each printer being monitored and using the api functions FindFirstPrinterChangeNotification, FindNextPrinterChangeNotification, WaitForSingleObject, etc... within each thread so that it will use next to nothing in processing power until a print job is added or changed or whatever. My problem right now is that the setjob api function doesn't seem to be functioning(for me anyway). I am trying to use setjob to cancel a job over a certain number of pages. I run the program and the setjob function returns successful but it will not delete the print job. I have tried this function using JOB_CONTROL_CANCEL and JOB_CONTROL_DELETE and neither seem to change the result. I am running WinXP and as I said the VB6 version works ok. I am logged on as a domain admin so permission isn't the issue. If anyone has any suggestions or knows what I need to do to fix this issue please let me know.
Nov 15 '05 #1
1 2673
Brad,

Can you post your declaration of SetJob as well as how you are calling
it? There could be something in your declaration that is off, and affecting
the call.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Brad M." <an*******@discussions.microsoft.com> wrote in message
news:95**********************************@microsof t.com...
Here is what I am trying to do. I have written a working program in VB6

that monitors any number of printers simultaneously(sort of). Because VB6
doesn't support multithreading I have to do this with a timers and loops
which eats up CPU power and has other inefficiencies. I am slowly
converting it over to C# with major revisions. Instead of using a timer or
loop I am going to have a different thread for each printer being monitored
and using the api functions FindFirstPrinterChangeNotification,
FindNextPrinterChangeNotification, WaitForSingleObject, etc... within each
thread so that it will use next to nothing in processing power until a print
job is added or changed or whatever. My problem right now is that the
setjob api function doesn't seem to be functioning(for me anyway). I am
trying to use setjob to cancel a job over a certain number of pages. I run
the program and the setjob function returns successful but it will not
delete the print job. I have tried this function using JOB_CONTROL_CANCEL
and JOB_CONTROL_DELETE and neither seem to change the result. I am running
WinXP and as I said the VB6 version works ok. I am logged on as a domain
admin so permission isn't the issue. If anyone has any suggestions or knows
what I need to do to fix this issue please let me know.
Nov 15 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
3524
by: Jason Kistler | last post by:
I am having some serious issues trying to set the "importance" of an ASP email. I am using the CDO.Message object. Here is the code: <% Dim recipients recipients = Request.Form("Jason") &...
1
354
by: malcolm | last post by:
Hello, We have a small team building a project that involves some 30 or so c# assembly dlls. It is a client server application with 1 exe as the starting point. The dlls and exe are sharing an...
4
11475
by: MLH | last post by:
I am having failures processing the following command and I wonder if you can tell me what I must do in order to have success. When I try to run source mysql_dump.sql.txt ==> it is a problem...
11
1752
by: Jeff Robichaud | last post by:
Are there any security issues having the ASPNET user account member of Administrators ? Is it a good practice ?
0
887
by: Cedric | last post by:
Hello, I 'm a bit confused about the size of an array of byte use by getjob or setjob. For GetJob no problem, API return size needed BUT for SetJob I must pass an array with good size. It's...
4
8026
by: Doc John | last post by:
I have a "global" MDI which will contain everything in the application. Since the application itslef will include three different "environments" with their own child Forms, I was wondering if I...
3
5026
by: =?Utf-8?B?QXhlbCBEYWhtZW4=?= | last post by:
Hi, we've got a strange problem here: We've created an ASP.NET 2.0 web application using Membership.ValidateUser() to manually authenticate users with our website. The problem is: If the...
2
1167
by: Daniel | last post by:
i seem to be having memory issues, will deplying a release build instead of a debug build help with memory usage of my .net process?
6
2017
by: Pep | last post by:
Firstly, I'm not sure if this is the right group for this query, so please forgive me if I am wrong. My problem is that most users I distribute my software to cannot install it on their systems...
0
7136
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
7018
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7232
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
6906
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
7397
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5490
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
4923
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
3110
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...
1
672
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.