|
deepblu@webmail.co.za wrote: I'm strugling to put together a log in code to the database
What are you having trouble with? Creating the table, the logic, what?
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
|
|
|
|
|
hi everyone!
i am trying to do some list of files, which have been printed. therefor i will try use the print event. when a file is printed the event is "started". when it is "active" i do want to get the filename of the file to be printed. with this info i do want to either create a list of files, which have been printed or add some kind of flag to the fileinfo.
but in general my step number one has to be to get the filename.
by the way, is the print event thrown when the print dialog is displayed or when the fileinfo is sent to the printer, meaning after having confirmed this dialog by clicking ok? because if the dialog is left by clicking cancel then there would be a wrong signal, because the file was not printed, when the event fires when displaying the dialog.
thanks.
stephan.
|
|
|
|
|
stephan_007 wrote: i am trying to do some list of files, which have been printed.
Is this list to be documents printed only from your application or from any application system wide??
stephan_007 wrote: when it is "active" i do want to get the filename of the file to be printed.
If this is to determine the filename system-wide - you can't get the filename. The printing application isn't required to tell the print spooler what the document filename is.
If it's from your application only - then you have the same problem, but you can write code to track which document you're printing and supply the filename through your code internal code.
stephan_007 wrote: by the way, is the print event thrown when the print dialog is displayed or when the fileinfo is sent to the printer
There is no "fileinfo" sent to the printer. The application does the rendering of the page image. The printer driver converts that image into something the printer can understand. It does NOT use the source filename of the document.
|
|
|
|
|
i do have an application, which stores my files (lets compair it to windows explorer).
i want to mark the file and then choose print. and if i press ok in the dialog window, the event is thrown (thats what it says in the docu). when it is finished the event is thrown again, but with a different id. (print started is one fixed id and finished printing is the other one).
i am not interested in when it is finished, i am just interested in if at least once the file was printed.
the application uses vbs, but i am not sure if it is real vbs. the data objects are different for sure. but because the printerobject is a windows object (uses the same printers listed there) it has to be similar.
so you think no matter which application i do use, i can't get the filename which is just printed?
lets say i do print mine.txt then i want it to be marked as printed in the database. well if it is not possible to get the filename to which the printer dialog box was just displayed and confirmed by clicking ok, then i will have to try something different. but if it is possible, please let me know.
|
|
|
|
|
stephan_007 wrote: so you think no matter which application i do use, i can't get the filename which is just printed?
Nope. There is no generic Windows print function that automagically knows how to interpret and print every file format. When you click on a file in Explorer (or any other app for that matter) and click Print, the application that created the file is launched and IT prints the file, and follows the process I outlined earlier. Nowhere in the process does the printing syustem ever know, or care about, the filename of the job that is printing.
If this is an Explorer type app where you are in control of launching the printing process for each file, then that is the only place you can get the filename. Just before you launch whatever code you're using to print the document. Trying to get the filename from the printing printing system is impossible since it doesn't know anything about filename.
|
|
|
|
|
nope, thats not what i meant. i meant if you have a file lets say in excel, then i want to print it, this starts the print event when the print dialog is displayed. when i send the file to printer this starts the event once (unique id for this event) and when it is printed and finished, then the event is thrown once again (another unique id).
so as i said before lets say i do print the file in excel. does the printer event carry some infos about which file was just sent to the printer (without checking it via the opend map)?
because if this is possible then it should be possible as well for any other application which is realized in windows, because it uses the same print function. lets say in word, internet explorer, notepad or whatever the print event should be the same.
and i was wondering, if it is possible to read some kind of parameter in the printer event telling me, which file was just sent to the printer to get the filename. the file will be printed in its "own" application (meaning excel for xls etc.).
but my question is: does the printevent store some kind of filename info in its event. because if it does i would like to access this info and read the filename for further use.
because when i read your last reply i guess there was some kind of misunderstanding. i was wondering if the printevent carries the filename info to be accessed and to know which file will be printed.
thats what i want to find out or realize in an vbs program/makro.
i know, in excel i could access the opend map, but where would i have to look for in notepad for example? thats why i wanted to access the printer event because it should know about the filename because where does the outputwindow of a printer get the info of to display the current status of the print progress?!
stephan.
|
|
|
|
|
stephan_007 wrote: i meant if you have a file lets say in excel, then i want to print it, this starts the print event
Print event? In what code?? Let's see it, because there is no "global" "print event".
stephan_007 wrote: so as i said before lets say i do print the file in excel. does the printer event carry some infos about which file was just sent to the printer
No. No file was just sent to the printer. Excel had to render an image of each page itself, which, as I explained before, is translated into the printers language by the printer driver. Nowhere in this process is the filename of the Excel document ever used.
|
|
|
|
|
so to summerize, there is no chance to get the filename in the printer event, meaning the event which is thrown when you confirm the printer dialog?
as far as i understood i am only able to get the filename accessing the program itself e.g. which file is opend in the current window or which map is opend in excel for example. is this correct? because if it is then i can't realize what i wanted to do.
this would have been to wait for a print event in an application and then ask this event which file will be send to printer or which file was just sent to the printer. so to know which file was at least once printed. thats why i have to catch the printer event and to know which file was just printed.
because i am not sure if it is a good idea to check for a document in foreground because you can't be sure this was the document just printed ...
but thanks anyway for your hints. so my idea or my project ends before it even started
stephan.
|
|
|
|
|
stephan_007 wrote: there is no chance to get the filename in the printer event, meaning the event which is thrown when you confirm the printer dialog?
There is no "printer event".
stephan_007 wrote: as far as i understood i am only able to get the filename accessing the program itself e.g. which file is opend in the current window or which map is opend in excel for example. is this correct? because if it is then i can't realize what i wanted to do
True.
stephan_007 wrote: thats why i have to catch the printer event and to know which file was just printed.
There is no "global printer event" that's fired whenever a print job is started.
stephan_007 wrote: because i am not sure if it is a good idea to check for a document in foreground because you can't be sure this was the document just printed ...
True. It's not a reliable way to tell.
|
|
|
|
|
hi,
how can Handles event click without button click ?
|
|
|
|
|
break_day wrote: event click without button click ?
What do you mean? Do you want to handle button click in another event handler instead of default handler ?
|
|
|
|
|
i play sound some time and after that i want handle button click (this click load anther form)without the user click the the button
|
|
|
|
|
if this question is as simple as I think you may register a public bool buttonclicked =false
and somewhere in your program logic if you set the value to true, a separate procedure would be called (what would normally be called upon a button click event) sg like:
void buttonclicked()
{
//do something...
}
|
|
|
|
|
If you are not using e or sender in your code you can use
EventName(Nothing, Nothing)
Quote from Great Outdoors:
its a confident traveller who farts in India
|
|
|
|
|
see Button.PerformClick method.
Luc Pattyn [Forum Guidelines] [My Articles]
this months tips:
- before you ask a question here, search CodeProject, then Google
- the quality and detail of your question reflects on the effectiveness of the help you are likely to get
- use PRE tags to preserve formatting when showing multi-line code snippets
|
|
|
|
|
Hello there.
I am creating an application that is connected to a phone line via modem.
I then use a paging software, InfoRad, that sends message to my application by dialing the phone number that my application is using.
The problem comes after InfoRad gets connected to my application then garbage data starts coming and InfoRad shows error about Handshake problem.
I am using baud rate, data bit, parity bit, stop bit as given by InfoRad (http://www.inforad.com/remoteerror.html)
In my receiving application I am printing the receiving characters byte by byte and converting it to string for display.
How should I read the receiving data? Any help will be appreciated.
Thanks.
|
|
|
|
|
Since we know nothing about InfoRad, it's just about impossible to tell you what's wrong or what InfoRad expects your code to be doing.
The generic answer would be to make sure the serial port parameters are correct (it doesn't sound like it!) and that you're using the proper encoding when converting the bytes to a string. What the correct encoding would be is determined by InfoRad.
|
|
|
|
|
I have googled and googled but not found a single simple solution:
How to print the contents of a RichTextBox? The contents is text only and font courier 12.
|
|
|
|
|
Have you tried this[^] ? Although it is in C#, you will get an idea
|
|
|
|
|
Yes, I have tried it but it won't work with SharpDevelop (the IDE that I use to code VB.net). Is there any other way?
|
|
|
|
|
If you looked at the top of that page, there's a link to the VB.NET 2005 (.NET 2.0) version of the same code. Also, the code has absolutely nothing to do with the IDE you're using. It'll still work, even if you're using Notepad to type in the code.
|
|
|
|
|
Drop this component[^] on the form that contains the rich text box, then set the extended properties for the bounding rectangle and other options and then call the FormPrintHelper1.Print method.
|
|
|
|
|
I have gridview in mine code,it has check box control. I want to fetch those rows only which has been selected by checking the check box column.
Please suggest me what I need to do.
Ashish K. vyas
-- modified at 3:44 Thursday 29th November, 2007
Ashish K. vyas
|
|
|
|
|
I use this to get the IDs (in the first column) you should be able to modify it to get the checked value from the checkbox cell
Private Sub DoReturns()<br />
Try<br />
Dim oRow As DataGridViewRow<br />
mvReturnValue = ""<br />
mvReturnValues = ""<br />
If dgData.SelectedRows.Count > 0 Then<br />
mvReturnValue = dgData.SelectedRows(0).Cells(0).Value.ToString<br />
For Each oRow In dgData.SelectedRows<br />
mvReturnValues += oRow.Cells(0).Value.ToString + ","<br />
Next<br />
End If<br />
Catch Exc As Exception<br />
Throw Exc<br />
End Try<br />
End Sub
Quote from Great Outdoors:
its a confident traveller who farts in India
|
|
|
|
|
Please read the forum guidelines. Avoid text speak. We don't care if it's urgent.
|
|
|
|