Are you using an old compiler - because I see that you used the old style C++ standard library
header file name (using the .h extension) like #include <iostream.h>
I removed all those header files(iostream,stdio,conio,stdlib) and I tried to work with the program which u sent. And thank you so much for your help. Am really thankful to you for spending much time with me.
But am really sorry to say this. When I worked with the program,it is sending the files to the printer but delete function doesn't working perfectly. Let me brief you with the example.
I have 4 files in C:\\Polytech, file1.txt, file2.txt, file3.txt, file4.txt. when I click the button (Button1Click() function) it is sending all these files to the printer. But when I tried to delete the files using other button (Button2Click() function),message box appears saying "Deleted OK". The moment it appears it is sending three more files to the printer i.e., file2.txt, file3.txt, file4.txt (not "file1.txt").So totally 7 files and when I click "ok" in the message box it deletes only 3 files (file2.txt, file3.txt, file4.txt) from the printer and rest of the files will remain as it is. It is not clearing it. Here I didn't understand how the delete button also sending the files to printer and deleting only those files which it sent. Can you please help me with this issue.
I don't understand though level and pjob parameter is set to 0 and NULL, how the setJob function sending the files to printer and deleting only those files which it sent.. Please help me with this issue..?
I removed all those header files(iostream,stdio,conio,stdlib) and I tried to work with the program which u sent. And thank you so much for your help. Am really thankful to you for spending much time with me.
But am really sorry to say this. When I worked with the program,it is sending the files to the printer but delete function doesn't working perfectly. Let me brief you with the example.
I have 4 files in C:\\Polytech, file1.txt, file2.txt, file3.txt, file4.txt. when I click the button (Button1Click() function) it is sending all these files to the printer. But when I tried to delete the files using other button (Button2Click() function),message box appears saying "Deleted OK". The moment it appears it is sending three more files to the printer i.e., file2.txt, file3.txt, file4.txt (not "file1.txt").So totally 7 files and when I click "ok" in the message box it deletes only 3 files (file2.txt, file3.txt, file4.txt) from the printer and rest of the files will remain as it is. It is not clearing it. Here I didn't understand how the delete button also sending the files to printer and deleting only those files which it sent. Can you please help me with this issue.
In your code you obviously have two buttons on your form and you have this code:
As you can see each time any of the two buttons is clicked, it calls the dbmain function.
One calls it with 0 and the other calls it with value 1.
Only when you call it with value 1 does it delete the files from the spooler. When you call it with value 0 it does not delete the files from the spooler.
You see what I mean??
So what do you want to do.?
(I notice that the buttons are called Button1 and Button2 - maybe you should give them more
meaningfull names?)
Button1 is for sending the files to the printer and Button2 is for deleting the files, which we have sent. I don't have any problem with Button1. Its working fine. But Button2 is not working as it is intended to work. Fine, I will give some meaningful names to the Buttons.
As I mentioned earlier the clearSpoolerButton again sending the same files which sendButton has done and deleting those files which clearSpoolerButton has sent and leaving remaining files which sendButton has sent. Can you please help me with this issue.....?
Yes.. Am trying all these... Even am using the google to find out the solution. But am failing all the time. And thanks for your reply. I will try this and I will let you know the result soon....
Thanks for your help. It is working fine. No problem in this. Am really sorry for disturbing you a lot. Please don't mistake me. Am just testing the different possibilities. I just tried to send the text files manually which is in "C:\\Polytech" and used the delete button from the program to delete the files. But its not deleting it. I traced the program completely. No where the send and delete buttons are linked. It has to delete any text files from that directory if it is send through manually or using send button. But its not happening. Why so..? Can you please help me..?
Am sorry. It is linked. I got it... If am not wrong, because of following two operations the delete button is not deleting the files which is sent manually
If thats case, how to delete the C:\\Polytech files, though it is sent manually.... Am sorry for troubling you much. I just tested this with different possibilities and found this problem. Please help me...?