|
How are you printing these documents? Are you selecting them in Explorer, right-clicking and picking Print?
Or are you trying to print these from code? What does your code look like?
RageInTheMachine9532
"...a pungent, gastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
I am trying to print them from code. Printing in a loop using the one of the following code for the respective documents .
'Print '.tif' image using Kodak Image Edit control.
imgEdForTIF.Image = gstrFilesPath & "\" & txtEDockets(intI)
imgEdForTIF.PrintImage
'Print for Word document
objWordApp.Documents.Open (gstrFilesPath & "\" & txtEDockets(intI))
objWordApp.ActiveDocument.PrintOut Background:=False
objWordApp.Documents.Close wdDoNotSaveChanges
'Print for PDF files
Call ShellExecute(hwnd, "Print", gstrFilesPath & "\" & txtEDockets(intI), "", "", 0)
lngHwnd = FindWindow(vbNullString, "Acrobat Reader")
SendMessage lngHwnd, WM_CLOSE, 0, 0
|
|
|
|
|
You're printing all of these nearly at one and depending on the Print routines for each to do the printing for you. Not a problem really, it's what anyone would do.
The problem your running into is that Word uses a background Print on a seperate thread. Your also using ShellExecute to Print .PDF files, which means Acrobat has to load, load it's plugin's and the load the document, then print. Takes a while...
With all the printing being done on seperate threads, it's, literally, a race to see which application can start it's print job first since they are all going at the same time.
The bottom line is, with the methods that you've chosen, there is no way to print the jobs out in any controlled order. You would have to either monitor the PrintQueue to catch when the job starts before firing off the next (not easy!), or you would have to monitor each application to see when it starts the actual printing (not easy!), or you could drop Thread.Sleep(oh I don't know, say5000)'s between each print job, thereby putting 5 seconds between the launch of each print job.
The final method works, is easy to implement, BUT (a very big BUT here!) It in no way guarantee's that the print jobs will come out in the order you launched them. The bottom line is there is no easy and reliable method to get the print jobs to come out in the order you want them.
RageInTheMachine9532
"...a pungent, gastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Thanks.
Putting the delay works , but i understand the risks.
Is there any other design i can choose to control the order of printing. USing PS or prn files?
|
|
|
|
|
Ummmmm...let me think about this...
OK. You MIGHT be able to getaway with this....
You could start all of your print jobs, but instead of printing to the printer, you would print to a printer object that was told to print to a file instead. This would send all of the page description code (PCL5, PCL6, PostScript, whetever it is...) to a file instead of the printer. You would have to wait until these jobs were completed. (I don't know your going to do this!) Then copy the files, in order, to another printer setup to go to the printer this time and redirecting LPT1: to it.
RageInTheMachine9532
"...a pungent, gastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Thanks for your time.
Actually I tried to read the print job status using a API:
A seperate program will polling and writing the status to aceess and after the print read command read the access to check if that document reached the status printing. here for very small documents i may not be able to read the status and that time i used to wait for 30 seconds.
This works fine but the pproblem now is that some of the PDF documents printed with only one page. The remaining pages are missing. I am giving the next print command only after the previous document status in printer is "printing".
The same behaviour when i print without any delay . But no missing of pages when i print with 15 second dely.
Any idea why this is happening.
Thanks and Regards
R Thangavel
|
|
|
|
|
I've never heard of the problem. Sounds like an issue with Acrobat, or whatever component is doing the printing.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
hi friends,
i have a datagrid in my project and i m using a datatable to fill the datagrid.the default preferredcolumnwidht property is set to 200.
but i want to use datagridtable style and disply the columns with different widhts but all efforts til now went in vain......
the code i used is pasted below..........
plz help me.
the code for style whihc i used is commented.....
hoping for quick solutions.....
Dim lDataTable As New DataTable("ItemList")
mintRecCount = Datasource.Length
lDataTable.Columns.Add("Code", System.Type.GetType("System.String"))
lDataTable.Columns.Add("Description", System.Type.GetType("System.String"))
lDataTable.Columns.Add("UOM", System.Type.GetType("System.String"))
lDataTable.Columns.Add("Quantity", System.Type.GetType("System.Int32"))
'lDataTable.Columns.Add("AltQty", System.Type.GetType("System.Int32"))
lDataTable.Columns.Add("Weight", System.Type.GetType("System.Single"))
lDataTable.Columns.Add("Price", System.Type.GetType("System.Single"))
For mRowIndex = 0 To mintRecCount - 1
lDataRow = lDataTable.NewRow()
'code for entering data into the datarow
lDataTable.Rows.Add(lDataRow)
Next mRowIndex
lDataTable.Columns(0).ReadOnly = True
lDataTable.Columns(1).ReadOnly = True
lDataTable.Columns(2).ReadOnly = True
lDataTable.Columns(4).ReadOnly = True
'Dim ts As New DataGridTableStyle
'ts.MappingName = "ItemList"
'Dim cs As DataGridTextBoxColumn
'cs = New DataGridTextBoxColumn
'cs.MappingName = "Code"
'cs.HeaderText = "Code"
'cs.Width = 64
'ts.GridColumnStyles.Add(cs)
'similiar code for other columns
'dgOrdInvAddItem.TableStyles.Add(ts)
dgOrdInvAddItem.DataSource = lDataTable
|
|
|
|
|
Here is some code I used in one of my projects and it worked quite fine. Hope it helps...
Private Sub setDGProperties()
dgDetails.TableStyles.Clear()
Dim dgts As New DataGridTableStyle
dgts.MappingName = "TransDetails"
dgts.AlternatingBackColor = Color.LightGray
Dim prod As New DataGridTextBoxColumn
prod.MappingName = "ProductID"
prod.HeaderText = "ProductID"
dgts.GridColumnStyles.Add(prod)
Dim cname As New DataGridTextBoxColumn
cname.MappingName = "ProductName"
cname.HeaderText = "Product Name"
cname.Width = 120
dgts.GridColumnStyles.Add(cname)
Dim quan As New DataGridTextBoxColumn
quan.MappingName = "Quantity"
quan.HeaderText = "Quantity"
dgts.GridColumnStyles.Add(quan)
Dim price As New DataGridTextBoxColumn
price.MappingName = "TPrice"
price.HeaderText = "Price"
price.Format = "C"
dgts.GridColumnStyles.Add(price)
dgDetails.TableStyles.Add(dgts)
End Sub
|
|
|
|
|
Ok guys,
This might be a simple question (I hope it has a simple answer). I have a program that gets a handle to an event by using GetEnvironmentVariable. My question is... How do I set this event?
Any sample code would be great!
Thanks,
Waffleman
|
|
|
|
|
WHAT??? Would you like to post some code?
An environment variable doesn't have anything to do with an event handle...
Are you saying that you want to fire an event if your app is asked to return an environment variable?
RageInTheMachine9532
"...a pungent, gastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Let me clarify, I looked a little more and I am not getting the handle. Instead I am getting the object name. In a similar C++ program the code looks as follows:
if( GetEnvironmentVariable("Notify",szValue,sizeof(szValue)) )
{
hEvent = OpenEvent(EVENT_ALL_ACCESS,FALSE,szValue);
if( NULL == hEvent )
{
printf("AppStarted OpenEvent failed %d <%s>\n",
GetLastError(),szValue);
goto RET;
}
}
if (!SetEvent(hEvent))
{
printf("AppStarted SetEvent failed %d <%s>\n",
GetLastError(),
szValue);
goto RET;
}
}
Here is a link to the details of OpenEvent in MSDN:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dllproc/base/openevent.asp
So how would I open this event and set it in VB.NET?
I hope that makes more sense...
Waffleman
|
|
|
|
|
Yes it does... Your C++ code, which I assume your trying to duplicate in VB.NET, just gets the name of an event signal object. Now, it uses that name to open the event object, provided that it already exists, then it sets the object to signaled. This is used to nofity other threads in an application that an event has happened.
What does you VB.NET code look like? With the OpenEvent function, all you get back IS the event handle, if it exists. The Environment variable is just there to supply the name of the event your getting the handle to. This event object must be created with CreateEvent in some other process before your VB.NET app can Open it...
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Here is the only VB.NET code I have:
Dim szNotify as String
szNotify = Environment.GetEnvironmentVariable("Notify")
DebugPrint("Notify: " & Notify, 1)
If (szNotify.Length > 0) Then
'** Set Event
End If
The event signal object is created by the parent program that kicks off the program that I am currently writing in VB.NET. The object name is stored in an environment variable. Right now I am just unclear on how to, when given an event object name, open the event and raise it in VB.NET.
Freiheit ist von Gott, Freiheiten vom Teufel.
|
|
|
|
|
i want to know where does the messanger (yahoo or msn or any)keep the password on the computer and how can i get it from the computer
Lost & Forgotten
|
|
|
|
|
It's stored in a cookie and encrypted. You're not retrieving the password from a cookie without some serious decryption code, that we're not giving you for obvious reasons...
RageInTheMachine9532
"...a pungent, gastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Yes, the password is stored on your computer. There are a lot of utilities to decrypt them. Try this website[^]
Aaron Eldreth
TheCollective4.com
My Articles
While much is too strange to be believed,
Nothing is too strange to have happened.
- T. Hardy
|
|
|
|
|
To add in a program an istruction that, in the moment in which it runs. ..."pause" the program?
...imagine to have a program that it is doing varied things...exists a wayto say..."Stop" (for example) for 10 seconds without makeing nothing and then "restart at the stop point"? (Everything without to have "closed" the program.....but only as likeas it was "in wait?")
Thanks early to all.
Night Soul!!!
|
|
|
|
|
????? It's very difficult to understand you, but I'll take a crack at this...
I take it you want to put your code to sleep for, say 10 seconds. Simple... Use Thread.Sleep(milliseconds As Integer), or Thread.Sleep(TimeSpan):
Imports System
Imports System.Threading
Thread.Sleep(10000) ' Puts the current thread to sleep for 10 seconds.
RageInTheMachine9532
"...a pungent, gastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
thank you again....it works!
Ps: sorry but you how would have expressed my question? (better?)
|
|
|
|
|
"How can I get my code to pause or sleep for as long as I want, and resume at the point it 'fell asleep'?"
RageInTheMachine9532
"...a pungent, gastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
hello
i new to vb.net and i need help with the compling of a project
i press F5 and this should run the project rite?
i got a message saying that im not in the "Debugging Users" group
it just ask me to add myself to this group which i have no idea what is it
can anyone help me?
i cant seen to start my project
thank you in advance
Gary
|
|
|
|
|
Start your Computer Management Console (Start -> All Programs -> Administrative Tools -> Computer Management)
Navigate to Users in the Console ( System Tools -> Local Users and Groups -> Users) and select your user name. Right-click on it, select properties, then select the "member of" tab, and Add the Debugger Users group.
"if you vote me down, I shall become more powerful than you can possibly imagine" - Michael P. Butler.
|
|
|
|
|
hii nick
thank you for your help
but the problem now is that i cant alter anything at the "member of" tab
it just pop out a message saying "The following error accur while saving....."
"Access is denied"
i have follow your instruction
then at the "member of" tab where is empty
i click add then it say select group
im not sure i did it correctly but this is what i did
i select object type and location (currently only 1 is enable for me to choose)
then i press ok...later the error message pop out
did i do anything wrong?
or maybe cause im using my college computer that i require the IT department to do the setting
im asking this cause i will also need it with my personal pc
thank you
Gary
|
|
|
|
|
You will need to be an administratror to change these settings. If you're using your college pc, you might need to ask the administrator of the machine to add the group for you.
"if you vote me down, I shall become more powerful than you can possibly imagine" - Michael P. Butler.
|
|
|
|